CN106780473B - A kind of magnet ring defect multi-vision visual detection method and system - Google Patents

A kind of magnet ring defect multi-vision visual detection method and system Download PDF

Info

Publication number
CN106780473B
CN106780473B CN201611209466.8A CN201611209466A CN106780473B CN 106780473 B CN106780473 B CN 106780473B CN 201611209466 A CN201611209466 A CN 201611209466A CN 106780473 B CN106780473 B CN 106780473B
Authority
CN
China
Prior art keywords
image
magnet ring
detection
ring
shooting
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.)
Expired - Fee Related
Application number
CN201611209466.8A
Other languages
Chinese (zh)
Other versions
CN106780473A (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.)
Xian Jiaotong University
Original Assignee
Xian Jiaotong 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 Xian Jiaotong University filed Critical Xian Jiaotong University
Priority to CN201611209466.8A priority Critical patent/CN106780473B/en
Publication of CN106780473A publication Critical patent/CN106780473A/en
Application granted granted Critical
Publication of CN106780473B publication Critical patent/CN106780473B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/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
    • 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

Landscapes

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

Abstract

A kind of magnet ring defect multi-vision visual detection method and system,Realize that polyphaser on-line checking and is in communication with each other simultaneously,It is connected respectively with 6 hosts using 11 cameras,The defects of completing different station is detected,Testing result is sent to main control computer by 6 hosts by serial ports,Main control computer judges 6 road signals,When 6 road signals all be GOOD when main control computer by control air pump from detection mouth magnet ring is blown into one of hole,Otherwise magnet ring is blown into another hole,Detection algorithm core thinking is to shoot magnet ring upper and lower surface image respectively using two cameras,One camera shoots magnet ring height image,Around the eight cameras shooting magnet ring inner and outer ring image set,Eight cameras are uniformly distributed,Guarantee the inside and outside ring region of 360 degree of magnet ring of shooting,The defects of different station operation is different detect program,Method proposed by the present invention,Whole system can reach 240~260/min of detection speed,Yield 0% by mistake,False drop rate 3%;Detection radius can reach 29mm, meet industrial demand.

Description

A kind of magnet ring defect multi-vision visual detection method and system
Technical field
The invention belongs to technical field of image detection, more particularly to a kind of magnet ring defect multi-vision visual detection method and it is System.
Background technology
An important indicator of the surface defect as evaluation magnet ring quality, the detection quick and precisely stablized to it become An essential link in production process at present, in current magnet ring production, production process, due to production technology, machine Tool equipment and think that the surface defect caused by reasons such as operation happens occasionally, mainly appear on the front of magnet ring, reverse side, outer circle Circumferential surface and inner ring, defect generally can be divided into:Crackle, impurity, fall paint, hanger glues the susceptible condition kind such as glutinous.
The width of crackle is smaller, but the region being distributed is wider compared with other defect.Area is smaller but with apparent color The defects of poor, is then split for the arrisdefect and circle on surface, and impurity is then that area is larger and there are apparent aberration with surface other positions Defect.
Using traditional method testing result easily by factors such as quality inspection personnel visual fatigue, proficient, mood swings Influence, be difficult to meet current speed of production and requirement in precision, stability and detection speed, so as to cause judge by accident, fail to judge, Misjudgement happens, in addition, artificial contact also has certain probability damage magnet ring.
The content of the invention
The shortcomings that in order to overcome the above-mentioned prior art, it is an object of the invention to provide a kind of inspections of magnet ring defect multi-vision visual Method and system are surveyed, inner and outer ring and upper and lower surface defect and magnet ring that can be from several pictures of captured in real-time to magnet ring be high Degree is continuously detected, and is realized and is detected and be in communication with each other while polyphaser, the judging result of the picture of comprehensive multi-angled shooting Judge magnet ring quality, can solve to be difficult in precision, stability and detection speed in the prior art to meet current speed of production and It is required that the problem of.
To achieve these goals, the technical solution adopted by the present invention is:
A kind of magnet ring defect multi-vision visual detection method, includes the following steps:
First, magnet ring inner and outer ring image is shot in inner and outer ring detection station using camera, magnetic is shot in Surface testing station The positive and negative surface image of ring shoots magnet ring height image in height detection station;
Secondly, an inner ring detection zone, outer shroud detection zone are set respectively to the image of inner and outer ring detection station shooting;To table The positive and negative surface image of magnet ring of face detection station shooting sets Surface testing area;Magnetic is set to the image of height detection station shooting Ring height detection area, is respectively used to inner ring, outer shroud and surface defects detection and elevation carrection;
Then, defects detection is carried out;
Inner and outer ring defects detection:The image in inner ring and outer rings detection zone is first become into gray-scale map, then to gray-scale map with one One of then in the following way fixed threshold value is into row threshold division,:
Mode one is recorded the pixel number that the pixel value added up at the image different height after Threshold segmentation is 0, is led to The difference for judging 0 pixel value occurrence number of the image added up at adjacent height is crossed whether more than a certain range, if it is, in explanation Ring or outer shroud existing defects;
Mode two, the left margin and right margin in the picture black unicom region after marking-threshold segmentation, by an identified left side The value of all pixels point between right margin is both configured to 255, when there are slight crack either hanger adhesion or during sundries defect, that The pixel value that image must have partial pixel point remains as 0, illustrates inner ring or outer shroud existing defects;
Mode three, the left margin and right margin in the picture black unicom region after marking-threshold segmentation, counts right boundary Between 0 pixel value number, if at different height cumulative number exceed preset value, illustrate inner ring or outer shroud existing defects;
Mode four, the coboundary in the picture black unicom region after marking-threshold segmentation and lower boundary, if up-and-down boundary Difference beyond preset value, illustrate inner ring or outer shroud existing defects;
Magnet ring elevation carrection:Image in magnet ring height detection area is become into gray-scale map, then to gray-scale map with certain threshold It is worth into row threshold division, it is fixed in transverse axis pixel, record the starting that 0 pixel value occurs in the image after Threshold segmentation Coordinate and coordinate is terminated, the difference of the two is multiplied by with the height of scale factor, that is, magnet ring, by the height value being calculated and regulation Magnet ring height make it is poor, if difference error allow in the range of, illustrate that magnet ring does not have height defect.
Surface defects detection:Image in magnet ring Surface testing area is become into gray-scale map, then to gray-scale map with certain threshold It is worth into row threshold division, profile is retrieved from the image after Threshold segmentation, area filtering then is carried out to the profile of acquisition, if The profile number detected afterwards is filtered still above 0, illustrates defective presence, is otherwise determined as no defect;
Disadvantages described above detection and elevation carrection link are carried out at the same time, and when testing result judges all qualified, are judged Magnet ring is qualification, is otherwise judged as unqualified.
The present invention shoots magnet ring lower surface image using camera 5, and a camera 6 shoots magnet ring height image, one Camera 15 shoots magnet ring upper surface image, around eight cameras 7~14 shooting magnet ring inner and outer ring image set.
The setting principle of each detection zone is as follows:
Four detection zones are rectangular area;
In the picture of inner and outer ring detection station shooting, inner ring detection zone is arranged on the right half part of image range, rectangle Up-and-down boundary close to shooting image lower edges, about 5 distances to 10 pixels of range image lower edges, square The right margin of shape is overlapped with image right hand edge, and rectangle left margin is positioned close to the position of 1/2 transaxial width of image;
In the picture of inner and outer ring detection station shooting, outer shroud detection zone is arranged on the left-half of image range, rectangle Up-and-down boundary close to shooting image lower edges, about 5 distances to 10 pixels of range image lower edges, square The left margin of shape is overlapped with image left edge, and rectangle right margin is positioned close to the position of 1/2 transaxial width of image;
In the picture of magnet ring height detection station shooting, the rectangle close shooting in border up and down in height detection area The edge up and down of image, range image about 10 distances to 20 pixels in edge up and down;
In the picture of magnet ring surface defects detection station shooting, close-perspective recording is leaned on border to the rectangle in Surface testing area up and down The edge up and down for the image taken the photograph, range image about 10 distances to 20 pixels in edge up and down;
The influence of environmental factor and quickening algorithm speed in order to prevent, image processing process afterwards is all only to detection zone figure As carrying out.
Specifically, the present invention can calculate the threshold value of image binaryzation using threshold segmentation method, to no region Using no threshold value into row threshold division, piece image is then synthesized again.
In the mode two of inner and outer ring defects detection, after gray-scale map Threshold segmentation, to the spy of the image after Threshold segmentation Determine region removal background sundries, morphological erosion operation then is carried out to image, to eliminate smaller only point.Then to image 3* 3 structural element carries out a closing operation of mathematical morphology processing, and disconnected image is made to merge blocking, " specific region " one here As be set as width of the image border close to 5 pixels to 10 pixels, to image inverse and extract profile again area filter, most Defect is marked afterwards;
In the mode one and mode three of inner and outer ring defects detection, the left margin and right margin of magnet ring are true in the following way It is fixed:
Image after Threshold segmentation is first scanned from left to right, is 0 if there is continuous multiple pixel values, determining should Point is the left margin in picture black unicom region after Threshold segmentation, save it in array widhist, is then being searched It is from left to right scanned on the basis of left margin, is 255 if there is multiple pixel values, determine the point for image black after Threshold segmentation Chromaesthesia leads to the right margin in region, saves it in array dishist, wherein i, and the scope of j is all 0~height, height It is longitudinally wide to refer to image.
The extraction profile mainly from a seed point, the profile of closure is found with the method for search, is examined by setting The profile area defined size scope measured, after filtering out a part of profile, if there remains profile, illustrates magnetic Ring existing defects mark remaining profile in the artwork finally read again from camera.
In the surface defects detection, entire detection zone is scanned by left and right and up and down, determine the side up and down of magnet ring Boundary, and then determine the center of magnet ring, if magnet ring center is to the left or to the right, magnet ring is divided into three parts respectively with difference Threshold value be split, meanwhile, on the basis of the definite magnet ring center of circle and radius, the pixel on interior outer magnetic ring border is set to 255, prevent influence of the miscellaneous point in these places to defects detection.
The defects detection link and elevation carrection link are carried out at the same time, and when testing result judges all qualified, are judged Magnet ring is qualification, is otherwise judged as unqualified.
The present invention also provides the detecting system based on the magnet ring defect multi-vision visual detection method, including:
Annular vibration platform 1 is sent magnet ring to ring rotation device 4 using conveyer belt;
Above ring rotation device 4, screening is provided with along the radial direction of ring rotation device 4 for magnet ring position fixing apparatus 2 Block material and fixture do uniform circular motion, while stationary annular on ring rotation device 4 to constrain magnet ring around radii fixus Rotating device 4 prevents it from shaking;
Infrared pulse camera trigger device 3 is arranged at the top of ring rotation device 4, when have magnet ring by when, start to count When, and triggering camera is taken pictures after a certain number of pulses are generated;
More cameras are respectively completed the image taking of the positive and negative surface of magnet ring, height and inner and outer ring;
Host is connected with camera, is obtained magnet ring different parts image and is completed the detection at the position.
The magnet ring is lain on ring rotation device, and wherein ring rotation device 4 is transparent, ensures magnet ring bottom surface It can be photographed by camera.
The camera has Shi Yitai, a shooting magnet ring lower surface image, a shooting magnet ring height image, a shooting Magnet ring upper surface image, remaining eight, around setting, shoot magnet ring inner and outer ring image;The host has six, wherein five masters Machine two cameras of every connection, another host connect a camera, and testing result is sent to master by six hosts by serial ports Control machine 17, main control computer 17 illustrate magnet ring qualification, the main control computer 17 and detection mouth 16 when judging six tunnel testing results all for qualification Air pump connection, detection mouth 16 is there are two hole, and when magnet ring qualification, control detection mouth 16 sucks magnet ring in one of hole, When magnet ring is unqualified, control detection mouth 16 sucks magnet ring in another hole.
Compared with prior art, the present invention can reach 240~260/min of detection speed, by mistake yield 0%, false drop rate 3%.Detection radius can reach within 29mm, can meet industrial demand.
Description of the drawings
Fig. 1 is a kind of magnet ring defect multi-vision visual TT&C system mechanical structure schematic diagram.
Fig. 2 is a kind of magnet ring defect multi-vision visual TT&C system control section schematic diagram.
Fig. 3 is a kind of magnet ring defect multi-vision visual TT&C system device cut-away view.
Fig. 4 is the image taken from magnet ring inner and outer ring detection station, and A represents inner ring detection zone.
Fig. 5 is the image taken from magnet ring inner and outer ring detection station, and B represents outer shroud detection zone.
Fig. 6 is the image taken from magnet ring height detection station, and C represents height detection area.
Fig. 7 is the image that bottom surface detection station takes from magnet ring, and D represents Surface testing area.
Fig. 8 is the elevation carrection algorithm flow chart of magnet ring.
Fig. 9 is the surface defects detection algorithm flow chart of magnet ring.
Figure 10 is the inner and outer ring defects detection algorithm flow chart of magnet ring.
Specific embodiment
The embodiment that the present invention will be described in detail with reference to the accompanying drawings and examples.
As depicted in figs. 1 and 2, annular vibration platform 1 is sent magnet ring to ring rotation device 4 using conveyer belt;Magnet ring position Fixing device 2 above ring rotation device 4, is provided with shelter and fixture, about along the radial direction of ring rotation device 4 For beam magnet ring as ring rotation device 4 fixes the uniform circular motion of radius on ring rotation device 4, magnet ring lies in ring On shape rotating device, wherein ring rotation device is transparent, ensures that magnet ring bottom surface can be photographed by camera 5.It is fixed simultaneously Ring rotation device 4 prevents it from shaking;
Infrared pulse camera trigger device 3 is arranged at the top of ring rotation device 4, when have magnet ring by when, start to count When, and triggering camera is taken pictures after a certain number of pulses are generated;
More cameras are respectively completed the image taking of the positive and negative surface of magnet ring, height and inner and outer ring;Wherein, camera 5 is used for Magnet ring bottom defect is detected, camera 6 is used to detect magnet ring height;No. 7 to No. 14 cameras are used to detect inner ring and outer shroud defect, phase Machine 15 is used to detect defect at the top of magnet ring.
Host 18~22, is connected with camera, obtains magnet ring different parts image and completes the detection at the position.
The camera has Shi Yitai, a shooting magnet ring lower surface image, a shooting magnet ring height image, a shooting Magnet ring upper surface image, remaining eight, around setting, shoot magnet ring inner and outer ring image, it is ensured that eight cameras can take magnet ring 360 degree of inner and outer ring image;The host has six, wherein there is 5 hosts, two cameras is connected on every host, for magnetic The defects of ring each position, is detected, and in addition a host connects an individual camera and is used for magnet ring elevation carrection.Specific connection Mode is referring to Fig. 3.Camera 5 and camera 15 are connected with industrial personal computer 18, and camera 7 and camera 12 are connected with industrial personal computer 19, camera 8 and phase Machine 13 is connected with industrial personal computer 20, and camera 9 and camera 14 are connected with industrial personal computer 21, and camera 10 and camera 11 are connected with industrial personal computer 22, Camera 6 is connected with industrial personal computer 23.
Testing result is sent to main control computer 17 by 6 industrial personal computers by serial ports, and main control computer 17 judges 6 road signals all for qualification When illustrate magnet ring qualification.
The main control computer 17 is connected with detecting the air pump of mouth 16, and there are two holes, when magnet ring qualification, control inspection for detection mouth 16 Outlet 16 sucks magnet ring in one of hole, and when magnet ring is unqualified, control detection mouth 16 sucks magnet ring in another hole.
For magnet ring defect multi-vision visual detection method,
(1) outer shroud, inner ring, surface and height detection area are set
Magnet ring lower surface image is shot using a camera 5, a camera 6 shoots magnet ring height image, a camera 15 Magnet ring upper surface image is shot, around eight cameras 7~14 shooting magnet ring inner and outer ring image set.Eight cameras uniformly divide Cloth, it is ensured that the inside and outside ring region of 360 degree of magnet ring can be shot.
It is the magnetic loop image shot from different station as shown in Fig. 4, Fig. 5, Fig. 6, Fig. 7.
A. inner ring detection zone in figure, B. outer shroud detection zones, C. height detections area, D. Surface testings area.
The setting principle of each detection zone is as follows:
More than four detection zones be rectangular area.
In the picture of inner and outer ring detection station shooting, inner ring detection zone is arranged on the right half part of image range, rectangle Up-and-down boundary close to shooting image lower edges, about 5 distances to 10 pixels of range image lower edges.Square The right margin of shape is overlapped with image right hand edge.Rectangle left margin is positioned close to the position of 1/2 transaxial width of image.Rectangle region Domain completely includes the inner ring pattern in the A of region in Fig. 4.
In the picture of inner and outer ring detection station shooting, outer shroud detection zone is arranged on the left-half of image range, rectangle Up-and-down boundary close to shooting image lower edges, about 5 distances to 10 pixels of range image lower edges.Square The left margin of shape is overlapped with image left edge.Rectangle right margin is positioned close to the position of 1/2 transaxial width of image.Rectangle region Domain completely includes the outer shroud pattern in the B of region in Fig. 5.
In the picture of magnet ring height detection station shooting, the rectangle close shooting in border up and down in height detection area The edge up and down of image, range image about 10 distances to 20 pixels in edge up and down.Rectangular area is complete Include the magnet ring height pattern in region C in Fig. 6.
In the picture of magnet ring surface defects detection station shooting, close-perspective recording is leaned on border to the rectangle in Surface testing area up and down The edge up and down for the image taken the photograph, range image about 10 distances to 20 pixels in edge up and down.Rectangular area Completely include the magnet ring surface pattern in the D of region in Fig. 7.
The influence of environmental factor and quickening algorithm speed in order to prevent, image processing process afterwards is all only to detection zone figure As carrying out.
(2) magnet ring height is detected
As shown in figure 8, become gray scale after will height detection area being set from the image that magnet ring height detection station takes Figure, then to the image into row threshold division, segmentation threshold is arranged to the segmentation threshold of the image acquired according to Da-Jin algorithm, to being more than The pixel of segmentation threshold is set to 255, and the pixel less than or equal to segmentation threshold is set to 0.
Be fixed on the position of x0 pixel in transverse axis position, record 0 pixel value of the longitudinal axis appearance origin coordinates (x0, Topq) and coordinate (x0, botq) is terminated, for the difference of the two multiplied by with the height H of scale factor, that is, magnet ring, unit is mm.It calculates Formula is:
H=(botq-topq) * p0
Here p0 is the pixel shared by the picture middle magnetic ring height of the height and corresponding shooting by measuring actual magnet ring Points, what the ratio both asked for was worth to.Here the position of the x0 pixel set can be suitably modified, it is only necessary to which guarantee is leaned on 1/2 transaxial width of nearly image.
Then judge
|H-H0|<δ
It is whether true.Wherein H0 is magnet ring given size, and δ is allowed error range.If inequality above is set up, Illustrate that magnet ring height does not have defect.
(3) surface defect is detected
As shown in figure 9, become ash after will Surface testing area being set from the image that magnet ring upper and lower surface detection station takes Degree figure, then to the image into row threshold division, segmentation threshold is arranged to the image segmentation threshold acquired according to Da-Jin algorithm, to being more than The pixel of segmentation threshold is set to 255, and the pixel less than or equal to segmentation threshold is set to 0.Statistic num is set to 0 first, from two-value Profile is retrieved in image, area filtering then is carried out to the profile of acquisition, when meeting contour area area in certain threshold range Internal clock knows defect and statistic num is added 1, if traveling through num after complete contouring is more than 0, illustrates defective presence, Magnet ring is determined as NG.Here the threshold range that we set is that area is more than 600 and less than 13000.
Under normal circumstances, magnet ring should be located at the centre position of picture, but in motion process, magnet ring is it is possible that position Situation on the upper side or on the lower side is put, we can scan whole region by left and right and up and down, determine the coboundary top of magnet ring, Lower boundary bottom, left margin left and right margin right.And then determine the centre coordinate (x, y) of magnet ring and radius r.In The calculation formula of heart coordinate and radius r is
X=| left+ (right-left)/2 |
Y=| top+ (bottom-top)/2 |
R=(bottom-top)/2
If magnet ring center is to the left or to the right, at this moment magnet ring can be divided into three parts respectively with different threshold values It is split.
Due to being present with the impurity of some 0 pixel values after the image after magnet ring Threshold segmentation on inside and outside annulus, if not This part is processed, behind will be mistaken for NG, the specific practice for solving the problems, such as this be by the image after Threshold segmentation with (x, y) be the center of circle, using r-1 as the circle of radius and with (x, y) for the center of circle, using r-r0 as all pixels point on the circle of radius Pixel value is set to 255.So as to exclude the interference of this part.R0 is the difference of inside and outside annular radii.
(4) inner and outer ring defect is detected
As shown in Figure 10, inner and outer ring detection zone is set to the image that magnet ring inner and outer ring detection station takes.By inner ring and Image in outer shroud detection zone becomes gray-scale map, then to gray-scale map with certain threshold value into row threshold division, crucial ground here Side is in the acquisition of Threshold segmentation image.Scanning up and down is carried out to image, determines the coboundary top of magnet ring and lower boundary bottom, Because the entire magnet ring regional exposure amount of the picture taken is different, it is possible to it is present with a part of deep a part of shallow situation, At this moment just need to different regions then to become piece image into row threshold division using different threshold values in synthesis, obtain The Threshold segmentation image that we want.
Threshold value T is acquired by the maximum between-cluster variance of the parts of images after asking for segmentation.Magnet ring region two up and down The area image segmentation threshold for dividing light exposure larger is T+T1, and the more uniform parts of images segmentation threshold of intermediate exposures amount is T- T1.The value of T1 can be set according to actual conditions.
Histogram is calculated first and normalizes histogram, can obtain 1~M of image gray levels, i-stage pixel niIt is a, Total pixel number is N, then the probability that i-stage gray scale occurs is
Pi=ni/N
Calculate gradation of image average
Calculate the zeroth order w [i] and a class interval u [i] of histogram
w1=1-w [k] μ-μ [k]
Make following processing to level-one square:
μ0=μ [k]/w [k], μ1=[μ-μ [k]]/[1-w [k]]
Calculate and find the gray value as threshold value inter-class variance to be looked for that maximum inter-class variance corresponds to this maximum variance:
σ2[k]=[μ w [k]-μ [k]]2/{w[k]·[1-w[k]]}
K changes from 1~M, and the k of inter-class variance maximum is required optimum thresholding.
Background sundries is removed to the specific region of the image after Threshold segmentation, morphological erosion behaviour then is carried out to image Make, to eliminate smaller only point such as noise.Then a closing operation of mathematical morphology is carried out with the structural element of 3*3 to image to handle, it can So that disconnected image merging is blocking.Here " specific region " is usually set to image border close to 5 pixels to 10 The width of pixel.
Then the image after Threshold segmentation is first scanned from left to right, is 0 if there is continuous multiple pixel values, really The fixed point is the left margin in picture black unicom region after Threshold segmentation, saves it in array widehist, is then searching Rope to left margin on the basis of from left to right scan, be 255 if there is multiple pixel values, determine the point for after Threshold segmentation The right margin in picture black unicom region, saves it in array dishist.The scope of wherein i, j are all 0~height (image is longitudinally wide).
The first method of discrimination is the value of all pixels point between identified right boundary to be both configured to 255, reason Situation about thinking is that magnet ring stands intact, then treated at this time Threshold segmentation image should the pixel value of all pixels point be 255;When there are slight crack either hanger adhesions or during sundries defect, then image must have the pixel value of partial pixel point still For 0.Then to extracting profile after image inverse, and profile when filtering out area area in certain threshold range, if into The profile number that the filtering of row area detects afterwards is still above 0, then and illustrate existing defects, finally mark profile, And carry out NG judgements.Here threshold range is set as being less than 180 or more than 17000 by we.
Second of method of discrimination is to count 0 pixel value number between the Threshold segmentation image inner and outer boundary preserved above, It is stored in array hist.
Hist [i]=(dishist [i]-widehist [i])
If hist [i] numerical value is beyond scope is limited when i takes the different value of 0~height, illustrate magnet ring width unevenness It is even, it is determined as NG.
The third method of discrimination is, when image lengthwise position coordinate tw meets
tw>a
tw<b
Wherein a=top+a0, b=bottom-b0 take a0=120, b0=200 here.Namely intercept magnet ring location The domain uniform part of intermediate exposures degree.The value of a0 and b0 is set according to actual conditions.Define the border of center section magnet ring The tolerable error threshold of Curvature varying on pixel level is T, then
If | dishist [tw]-dishist [tw-10] |>T meets.Illustrate there is paint or adhesion defect, image It is determined as NG;
Alternatively, image lengthwise position coordinate tw meets
tw>a
tw<b
Wherein a=top+a0, b=top+b0 take a0=60, b0=200 here.Namely intercept on magnet ring region The too strong part of edge printing.The value of a0 and b0 is set according to actual conditions.The border curvature for defining the part magnet ring becomes The tolerable error threshold changed on pixel level is T1, then
If | dishist [tw]-dishist [tw-10] |>T1 meets.Illustrate there is paint or adhesion defect, image It is determined as NG;
Alternatively, image lengthwise position coordinate tw meets
tw>a
tw<b
Wherein a=bottom-a0, b=bottom-b0 take a0=200, b0=20 here.Namely intercept magnet ring place Region lower edge exposes too strong part.The value of a0 and b0 is set according to actual conditions.Define the border of the part magnet ring The tolerable error threshold of Curvature varying on pixel level is T2, then
If | dishist [tw]-dishist [tw-10] |>T2 meets explanation and there is paint or adhesion defect, image It is determined as NG;
Alternatively, image lengthwise position coordinate tw meets
tw>a
tw<b
Wherein a=top+a0, b=bottom-b0 when, take a0=120, b0=200 here.Namely intercept among magnet ring The uniform part of exposure.The value of a0 and b0 is set according to actual conditions.If
Dishist [tw]=0&dishist [tw+1]=0&dishist [tw+2]=0&dishist [tw+3]=0 is full Foot, illustrates that there are full through check defect, spectral discrimination NG;
4th kind of method of discrimination is that define the tolerable error threshold of the outer diameter length of magnet ring on pixel level be T3, that If
|bottom-top|<T3
Illustrate, in the presence of fracture defect, to be determined as NG.
Comprehensive method of discrimination a variety of above, any method of discrimination judge that magnet ring is NG, and final result is all NG.
Comprehensive 11 cameras are respectively to the testing result on magnet ring surface, inner and outer ring defect and magnet ring height, when all knots When fruit is GOOD, magnet ring is judged as qualification, is otherwise judged as unqualified.
Whole system can reach 240~260/min of detection speed, by mistake yield 0%, false drop rate 3%.Detection radius can To reach within 29mm, industrial demand can be met.
It is worth noting that, above-mentioned specific embodiment is for illustrating the present invention, it is only the preferred reality of the present invention It applies scheme rather than limits the invention, in the protection domain of spirit and claims of the present invention, the present invention is done Any modification, equivalent substitution, improvement and etc. gone out, belong to protection scope of the present invention.

Claims (3)

1. a kind of magnet ring defect multi-vision visual detection method, which is characterized in that include the following steps:
First, magnet ring lower surface image is shot using a camera, a camera shoots magnet ring height image, a camera shooting Magnet ring upper surface image, around the eight cameras shooting magnet ring inner and outer ring image set;
Secondly, an inner ring detection zone, outer shroud detection zone are set respectively to the image of inner and outer ring detection station shooting;Surface is examined The positive and negative surface image of magnet ring for surveying station shooting sets Surface testing area;Set magnet ring high the image of height detection station shooting Detection zone is spent, is respectively used to inner ring, outer shroud and surface defects detection and elevation carrection;The setting principle of each detection zone is such as Under:
Four detection zones are rectangular area;
In the picture of inner and outer ring detection station shooting, inner ring detection zone is arranged on the right half part of image range, rectangle it is upper The lower edges of the image of the close shooting of lower boundary, about 5 distances to 10 pixels of range image lower edges, rectangle Right margin is overlapped with image right hand edge, and rectangle left margin is positioned close to the position of 1/2 transaxial width of image;
In the picture of inner and outer ring detection station shooting, outer shroud detection zone is arranged on the left-half of image range, rectangle it is upper The lower edges of the image of the close shooting of lower boundary, about 5 distances to 10 pixels of range image lower edges, rectangle Left margin is overlapped with image left edge, and rectangle right margin is positioned close to the position of 1/2 transaxial width of image;
In the picture of magnet ring height detection station shooting, the image of the rectangle close shooting in border up and down in height detection area Edge up and down, range image about 10 distances to 20 pixels in edge up and down;
In the picture of magnet ring surface defects detection station shooting, the rectangle close shooting in border up and down in Surface testing area The edge up and down of image, range image about 10 distances to 20 pixels in edge up and down;
The influence of environmental factor and accelerate algorithm speed in order to prevent, image processing process afterwards all only to detection zone image into Row;
Then, defects detection is carried out;
Inner and outer ring defects detection:The image in inner ring and outer rings detection zone is first become into gray-scale map, then to gray-scale map with certain One of then in the following way threshold value is into row threshold division,:
Mode one records the pixel number that the pixel value added up at the image different height after Threshold segmentation is 0, by sentencing Whether the difference of the 0 pixel value occurrence number of image added up at disconnected adjacent height is more than a certain range, if it is, illustrate inner ring or Person's outer shroud existing defects;
Mode two, the left margin and right margin in the picture black unicom region after marking-threshold segmentation, by identified left and right side The value of all pixels point between boundary is both configured to 255, when there are slight crack either hanger adhesions or during sundries defect, then figure The pixel value that picture must have partial pixel point remains as 0, illustrates inner ring or outer shroud existing defects;
Mode three, marking-threshold segmentation after picture black unicom region left margin and right margin, count right boundary between 0 pixel value number, if at different height cumulative number exceed preset value, illustrate inner ring or outer shroud existing defects;
Mode four, the coboundary in the picture black unicom region after marking-threshold segmentation and lower boundary, if the difference of up-and-down boundary Beyond preset value, illustrate inner ring or outer shroud existing defects;
Magnet ring elevation carrection:Image in magnet ring height detection area is become into gray-scale map, then to gray-scale map with certain threshold value into Row threshold division, it is fixed in transverse axis pixel, record the origin coordinates that 0 pixel value occurs in the image after Threshold segmentation With terminate coordinate, the difference of the two is multiplied by with the height of scale factor, that is, magnet ring, by the height value being calculated and defined magnetic It is poor that ring height is made, if difference illustrates that magnet ring does not have height defect in the range of error permission;
Surface defects detection:Image in magnet ring Surface testing area is become into gray-scale map, then to gray-scale map with certain threshold value into Row threshold division retrieves profile from the image after Threshold segmentation, then carries out area filtering to the profile of acquisition, if filtering The profile number detected afterwards illustrates defective presence still above 0, is otherwise determined as no defect;
Disadvantages described above detection and elevation carrection link are carried out at the same time, and when testing result judges all qualified, judge magnet ring For qualification, otherwise it is judged as unqualified.
2. magnet ring defect multi-vision visual detection method according to claim 1, which is characterized in that using threshold segmentation method come The threshold value of image binaryzation is calculated, into row threshold division then one width is synthesized again using different threshold values to different regions Image.
3. magnet ring defect multi-vision visual detection method according to claim 1, which is characterized in that the surface defects detection In, entire detection zone is scanned by left and right and up and down, determine the border up and down of magnet ring, and then determine the center of magnet ring, such as Fruit magnet ring center is to the left or to the right, then magnet ring is divided into three parts is split respectively with different threshold values, meanwhile, true On the basis of determining the magnet ring center of circle and radius, the pixel on interior outer magnetic ring border is set to 255, prevents the miscellaneous point in these places to lacking Fall into the influence of detection.
CN201611209466.8A 2016-12-23 2016-12-23 A kind of magnet ring defect multi-vision visual detection method and system Expired - Fee Related CN106780473B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611209466.8A CN106780473B (en) 2016-12-23 2016-12-23 A kind of magnet ring defect multi-vision visual detection method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611209466.8A CN106780473B (en) 2016-12-23 2016-12-23 A kind of magnet ring defect multi-vision visual detection method and system

Publications (2)

Publication Number Publication Date
CN106780473A CN106780473A (en) 2017-05-31
CN106780473B true CN106780473B (en) 2018-05-18

Family

ID=58920294

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611209466.8A Expired - Fee Related CN106780473B (en) 2016-12-23 2016-12-23 A kind of magnet ring defect multi-vision visual detection method and system

Country Status (1)

Country Link
CN (1) CN106780473B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109030499B (en) * 2018-07-27 2021-08-24 江苏理工学院 Device and method suitable for continuous online detection of target defects and preventing repeated counting of defect number
CN108844961A (en) * 2018-08-01 2018-11-20 佛山科学技术学院 A kind of temperature controller case vision detection system and method
CN109557110A (en) * 2019-01-11 2019-04-02 新昌浙江工业大学科学技术研究院 The full surface blemish detection device of bearing ring and method based on machine vision
CN110517233A (en) * 2019-08-15 2019-11-29 浙江赤霄智能检测技术有限公司 A kind of defect classification learning system and its classification method based on artificial intelligence
CN111257324B (en) * 2020-01-17 2024-01-12 天津理工大学 On-line detection system based on visual technology
CN111915607A (en) * 2020-08-31 2020-11-10 佛山市南海区广工大数控装备协同创新研究院 Metal film resistor surface strip defect detection method based on machine vision
CN113720857A (en) * 2021-09-30 2021-11-30 格兰德电气有限公司 Method for automatically comparing stator defects
CN114257736A (en) * 2021-11-12 2022-03-29 北京京仪仪器仪表研究总院有限公司 Self-adaptive shooting method for workpieces
CN114199895B (en) * 2021-12-15 2023-11-21 珠海高纳智能科技有限公司 Visual detection method for inductance defect
CN114994060B (en) * 2022-07-15 2022-11-15 君享科技(深圳)有限公司 Intelligent detection system and method for magnetic ring appearance defects under machine vision

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7961908B2 (en) * 2007-12-21 2011-06-14 Zoran Corporation Detecting objects in an image being acquired by a digital camera or other electronic image acquisition device
CN101320004A (en) * 2008-07-03 2008-12-10 西北工业大学 Bamboo strip defect on-line detection method based on machine vision
CN102393397B (en) * 2011-08-30 2014-04-09 成都四星液压制造有限公司 System and method for detecting surface defects of magnetic shoe
CN102374996B (en) * 2011-09-23 2012-11-07 西安交通大学 Multicast detection device and method for full-depth tooth side face defects of bevel gear

Also Published As

Publication number Publication date
CN106780473A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106780473B (en) A kind of magnet ring defect multi-vision visual detection method and system
CN109141232B (en) Online detection method for disc castings based on machine vision
CN105069790B (en) A kind of gear open defect fast image detection method
CA2151344C (en) Lens inspection system and method
AU668606B2 (en) Ophthalmic lens inspection method and apparatus
JP2001523815A (en) Automatic lens inspection system
CN110009618B (en) Shaft part surface quality detection method and device
CN109900711A (en) Workpiece, defect detection method based on machine vision
CN111047655B (en) High-definition camera cloth defect detection method based on convolutional neural network
CN108364291A (en) Grey cloth rapid detection method based on computer vision technique
CN107203990A (en) A kind of labeling damage testing method based on template matches and image quality measure
CN106991688A (en) Human body tracing method, human body tracking device and electronic installation
CN116559183B (en) Method and system for improving defect judging efficiency
CN109741314A (en) A kind of visible detection method and system of part
CN108896574A (en) A kind of bottled liquor method for detecting impurities and system based on machine vision
CN110008947A (en) A kind of silo Grain Quantity monitoring method and device based on convolutional neural networks
CN110096980A (en) Character machining identifying system
Fu et al. Medicine glass bottle defect detection based on machine vision
EP0686841A2 (en) System and method for inspecting lenses
JPH07159337A (en) Fault inspection method for semiconductor element
CN103718025B (en) Container mouth portion inspection method and device
CN108663376B (en) Seamless steel tube quality detection device and detection method
CN111008960A (en) Aluminum electrolytic capacitor bottom appearance detection method and device based on machine vision
CN116237266A (en) Flange size measuring method and device
CN109975307A (en) Bearing surface defect detection system and detection method based on statistics projection training

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180518

Termination date: 20201223

CF01 Termination of patent right due to non-payment of annual fee