CN113096106A - Steel ball detection method based on machine vision - Google Patents

Steel ball detection method based on machine vision Download PDF

Info

Publication number
CN113096106A
CN113096106A CN202110413592.XA CN202110413592A CN113096106A CN 113096106 A CN113096106 A CN 113096106A CN 202110413592 A CN202110413592 A CN 202110413592A CN 113096106 A CN113096106 A CN 113096106A
Authority
CN
China
Prior art keywords
image
steel ball
camera
type lamp
basket
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.)
Pending
Application number
CN202110413592.XA
Other languages
Chinese (zh)
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.)
Luoyang Institute of Science and Technology
Original Assignee
Luoyang Institute of Science and Technology
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 Luoyang Institute of Science and Technology filed Critical Luoyang Institute of Science and Technology
Priority to CN202110413592.XA priority Critical patent/CN113096106A/en
Publication of CN113096106A publication Critical patent/CN113096106A/en
Pending legal-status Critical Current

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration by the use of histogram techniques
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • G06V10/12Details of acquisition arrangements; Constructional details thereof
    • G06V10/14Optical characteristics of the device performing the acquisition or on the illumination arrangements
    • G06V10/141Control of illumination

Abstract

The steel ball detection method based on machine vision comprises a steel ball identification detection algorithm and on-line machine vision system image processing, monitors the quenching process of a salt bath resistance furnace on steel balls, shoots the steel balls, counts the steel balls in shot images by utilizing an image identification technology, and can intelligently control the quenching process of the steel balls to be carried out according to the regulations; and the real-time online detection system is completed, and an alarm is given for the condition that the number of the steel balls does not meet the specification. The detection system comprises an illuminating device, a camera, a draining basket, a frame, a first support, a second support and a Hall sensor, wherein the illuminating device consists of an LED light source and a plate-type lamp which are connected with each other, and the LED light source is arranged on the plate-type lamp; the drop basket passes through the pull rod to be established on the frame and carry out the up-and-down motion, and frame upper portion is equipped with the hall sensor who links to each other with the switch, is equipped with the board type lamp through first leg joint on the frame, is equipped with the camera through second leg joint on the frame, and board type lamp, camera are located drop basket in proper order and the place ahead just all towards the setting of drop basket.

Description

Steel ball detection method based on machine vision
Technical Field
The invention belongs to the technical field of steel ball processing, and particularly relates to a steel ball detection method based on machine vision.
Background
At present, steel balls can be divided into different types according to processing technology, materials, application and the like, wherein bearing steel balls are important basic parts in industry, and spherical ferroalloy wear-resistant bodies are required to be generated by forging, spinning, rolling, casting and the like. In the manufacturing process of the steel ball, quenching plays an important role. The quenching can increase the strength, hardness, elasticity and wear resistance of the steel, and the quenched workpiece can effectively prolong the service life of the steel, thereby reducing the industrial cost. The bearing steel ball is an important basic part in industry, the quenching process in the production process is accurately mastered, and the strength, the hardness and the like of the steel ball can be effectively ensured.
Image processing refers to a technique of analyzing and processing a digital image by a computer to achieve a desired effect and obtain desired information, and commonly used image processing methods include image enhancement, image segmentation, image recognition, image classification, and the like. According to the actual requirements of a steel ball manufacturer, an image recognition counting algorithm of steel balls after salt bath quenching is researched, and the purpose is to perform automatic recognition counting research on the steel balls by collecting steel ball images output from a quenching tank at the tail end of a salt bath furnace and applying image recognition counting to ensure that the steel ball quenching process is performed according to the regulations.
Disclosure of Invention
In view of the above, in order to solve the defects of the prior art, the invention aims to provide a steel ball detection method based on machine vision, which monitors the quenching process of a salt bath resistance furnace on a steel ball, shoots the steel ball, counts the steel balls in the shot image by using an image recognition technology, and can intelligently control the quenching process of the steel ball to be performed according to the regulations; and the real-time online detection system is completed, and an alarm is given for the condition that the number of the steel balls does not meet the specification.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
the steel ball detection method based on machine vision comprises a detection system used in the detection method and comprising an illumination device, a camera, a draining basket, a frame, a first support, a second support and a Hall sensor, wherein the illumination device consists of an LED light source and a plate-type lamp which are connected with each other, and the LED light source is arranged on the plate-type lamp;
the draining basket is arranged on the frame through a pull rod and moves up and down, a Hall sensor connected with a switch is arranged at the upper part of the frame, a plate-type lamp is connected to the frame through a first support, a camera is connected to the frame through a second support, and the plate-type lamp and the camera are sequentially positioned in front of the draining basket and are both arranged towards the draining basket;
the detection method comprises the following steps:
s1: by adopting a front illumination irradiation scheme, a plate-type lamp and a camera are both arranged in front of the upper part of a draining basket provided with steel balls by utilizing a rotating mechanism, the plate-type lamp illuminates from the side, and the camera shoots from the right front; according to the requirement that a light source needs to ensure enough overall brightness to illuminate an object during shooting, the characteristic quantity of the object in an image needs to be maximized, and the contrast is increased;
s2: when the draining basket is lifted to the highest point from the molten salt through a pull rod on the frame, a basket cover above the draining basket is opened to the maximum angle, a Hall sensor is triggered, a camera and a plate type lamp start to work after a switch is contacted, the draining basket cover is opened to pour out the steel ball within the set shooting interval and the set shooting duration, and an image completely displayed by the steel ball is selected from shooting and is subjected to subsequent image processing and identification;
s3: image processing:
s31: image preprocessing: s311: cutting out a required target area from the original image by using a matting operator, so that the interference caused by a large number of light reflecting points on the basket cover or the edge can be effectively avoided;
s312: performing basic linear transformation on the digital image by using point calculation, enhancing the image, stretching the pixel value of a target area, and improving the contrast ratio of a target and a background; the image enhancement is mainly performed in the spatial domain by using a gray scale transformation method, wherein a transformation function meeting the actual requirement of identifying the steel ball is used, and the expression is as follows:
g(x,y)=k×f(x,y)+a (1)
wherein, f (x, y) represents the pixel value of the original image coordinate (x, y), g (x, y) represents the pixel value after transformation, k represents the slope of the transformation function, k is 255/(GMax-GMin), a is-k GMin, GMax is the maximum pixel value of the image, and GMin is the minimum pixel value of the image;
s313: removing various random noises in the image by adopting a spatial filtering method, and inhibiting and removing the noises by using a median filter under the condition of keeping the edge details of the steel ball as much as possible;
s32: identifying and counting: s321: segmenting the target and the background by using a threshold value, wherein the threshold value is selected by analyzing and calculating an actual image, and the formula is as follows:
TH(x,y)=g(x,y)+k×f(x,y)+n (2)
wherein, TH (x, y) is a threshold value of original image coordinates (x, y), g (x, y) represents a local mean value, f (x, y) represents a local standard deviation, k is a weight coefficient, and n is a set constant; equation (2) that is, the threshold for the location pixel is determined by the weighted sum of the local statistics, mean and standard deviation of the location (x, y) in its neighborhood;
s322: because the image after threshold segmentation has noises such as isolated points, burrs and the like, the noise is eliminated by carrying out mathematical morphology operation on the image, and the image is corroded and expanded by utilizing open operation; reducing the white area in the target inwards by using an erosion function, and filling a white gap in the target object; expanding the white area outwards by using an expansion function to eliminate noise at the target connection boundary;
and (3) corrosion: a Θ B ═ { z | (B) z ═ Ac ═ Φ } (3)
Expansion:
Figure BDA0003024970540000043
meanwhile, the shape of a larger object in the image is kept basically unchanged in the corrosion process by utilizing the opening operation; smoothing the image contour in the expansion process by using a closing operation;
opening operation:
Figure BDA0003024970540000042
closing operation:
Figure BDA0003024970540000041
s323: after the processed images are connected, recognizing a reflective point in the image, which is regarded as a rectangle or a circular spot with a certain area, by using an image matching function, wherein the radius and the area need to be set with parameters, and the reflective point also needs to be obtained in the analysis and calculation of the actual image; and extracting independent targets of corresponding characteristic values according to the range of the characteristic values such as shape, radius, area, gray level and the like.
Furthermore, the first support and the second support are both triangular supports.
Furthermore, the plate-type lamp and the camera are connected to the support through a rotating mechanism.
Further, the rotating mechanisms are all rotating shafts of 360 degrees.
Furthermore, a steel ball is arranged in the leaching basket, and the leaching basket can move in and out of the bath salt.
Furthermore, the illuminating device and the camera are connected with a switch, and the switch is connected with the Hall sensor.
The invention has the beneficial effects that:
the steel ball detection method based on machine vision monitors the quenching process of a salt bath resistance furnace on steel balls, shoots the steel balls, counts the steel balls in shot images by utilizing an image recognition technology, and can intelligently control the quenching process of the steel balls to be carried out according to the regulations; and the real-time online detection system is completed, and an alarm is given for the condition that the number of the steel balls does not meet the specification.
The detection system not only applies the image processing and recognition technology to industrial manufacturing, but also ensures the correctness of the quenching process of the steel ball, improves the qualified rate of the steel ball generation, and improves the efficiency and the quality of the steel ball production by utilizing intelligent manufacturing to a great extent;
the invention relates to a machine vision-based steel ball detection method, which has the following main innovation points:
1. steel ball identification and detection algorithm
Designing a method based on dynamic threshold segmentation and morphological detection, which is a comprehensive algorithm of two basic detection methods, firstly preprocessing an input image to remove background noise, such as interference of uneven illumination and shadow; then, enhancing target characteristics by utilizing linear operation, and removing noise such as block structures; secondly, performing threshold segmentation on the preprocessed image by utilizing a maximum between-class variance algorithm, wherein the threshold can be a dynamic threshold according to a gray level histogram of the image or can be obtained by a self-adaptive algorithm; and finally, selecting larger structural elements to perform operations such as corrosion, expansion, opening operation, closing operation and the like on the image. The method can effectively utilize the shape attribute, connectivity, curvature and the like of the target in the image, and is more applied to the detection research of the bearing surface defects;
2. online machine vision system
A steel ball detection system based on machine vision is designed, different detection methods are analyzed according to characteristic values in shot steel ball images, a detection flow is established, industrial machine vision image processing software Halcon is adopted to carry out software analysis, and the characteristics of a special light source required by a bearing ring in the shooting process and the industrial design of how to carry out light source irradiation and the like are calculated and analyzed in combination with a light source theory.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic block diagram of a detection system of the present invention;
the labels in the figure are: 1. camera, 2, drop basket, 3, frame, 4, first support, 5, second support, 6, hall sensor, 7, LED light source, 8, board type lamp, 9, pull rod.
Detailed Description
The following specific examples are given to further clarify, complete and detailed the technical solution of the present invention. The present embodiment is a preferred embodiment based on the technical solution of the present invention, but the scope of the present invention is not limited to the following embodiments.
The steel ball detection method based on machine vision comprises the steps that a detection system used in the detection method comprises an illuminating device, a camera 1, a draining basket 2, a frame 3, a first support 4, a second support 5 and a Hall sensor 6, wherein the illuminating device consists of an LED light source 7 and a plate-type lamp 8 which are connected, and the LED light source 7 is arranged on the plate-type lamp 8;
the draining basket 2 is arranged on the frame 3 through a pull rod 9 and moves up and down, a Hall sensor 6 connected with a switch is arranged at the upper part of the frame 3, a plate-type lamp 8 is connected to the frame 3 through a first support 4, a camera 1 is connected to the frame 3 through a second support 5, and the plate-type lamp 8 and the camera 1 are sequentially positioned in front of the draining basket 2 and are both arranged towards the draining basket 2;
in this embodiment, the camera 1 adopts an FA lens of a Haikang robot, and the selection of the focal length depends on the shooting distance, the number of pixels, and the size of the photosensitive pixels distributed on the surface. Through field measurement, an MVL-MF1628M-8MP800 ten thousand-pixel 16mm/8mm industrial lens, a 2/3-inch target surface and an FA2.8 manual diaphragm are adopted, so that the measurement precision is ensured, the high cost performance is realized, the structure is compact, and the industrial integration is facilitated. The Haekwev vision MV-CA013-21UC 130 ten thousand pixel USB3.0 color camera 1/2' CMOS global shutter robot camera is adopted, hard and soft trigger and free running modes are supported, a user-defined ROI is supported, horizontal mirror images and vertical mirror images are supported, the structure is compact, and actual installation is facilitated. According to the actual conditions of the shot object, the distance and the equipment installation position, a single camera is researched for shooting, and all steel balls needing to be identified and counted are shot;
in addition, the light source used in shooting needs to ensure sufficient overall brightness to illuminate the object, and also should consider highlighting the feature quantity of the object in the image as much as possible to increase the contrast. Therefore, the lighting device of the research mainly comprises an LED light source 7 and a plate-type lamp 8, so that a complete image with high contrast can be obtained as required under the conditions of external light noise, steel ball inclination, material, size, manufacturing system vibration and the like in the production process. Due to the specific situation of the salt bath quenching furnace production line, the research adopts a front illumination irradiation scheme, a light source is placed in front of an object from the angle of a camera, and a stable light source with high luminous intensity and large apparent area is adopted to ensure lower background light interference and vertical shooting angle as much as possible;
the detection method comprises the following steps:
s1: by adopting a front illumination irradiation scheme, the plate-type lamp 8 and the camera 1 are both arranged in front of the upper part of the draining basket 2 filled with the steel balls by utilizing a rotating mechanism, the plate-type lamp 8 illuminates from the side, and the camera 1 takes a picture from the right front; according to the requirement that a light source needs to ensure enough overall brightness to illuminate an object during shooting, the characteristic quantity of the object in an image needs to be maximized, and the contrast is increased;
s2: when the leaching basket 2 is lifted to the highest point from the molten salt through a pull rod 9 on the frame 3, a basket cover above the leaching basket 2 is opened to the maximum angle, the Hall sensor 6 is triggered, the camera 1 and the plate type lamp 8 start working after contacting a switch, the leaching basket 2 is opened to pour out the steel ball within the set shooting interval and the set shooting duration, and an image completely displayed by the steel ball is selected from shooting and is subjected to subsequent image processing and identification;
s3: image processing:
s31: image preprocessing: s311: cutting out a required target area from the original image by using a matting operator, so that the interference caused by a large number of light reflecting points on the basket cover or the edge can be effectively avoided;
s312: performing basic linear transformation on the digital image by using point calculation, enhancing the image, stretching the pixel value of a target area, and improving the contrast ratio of a target and a background; the image enhancement is mainly performed in the spatial domain by using a gray scale transformation method, wherein a transformation function meeting the actual requirement of identifying the steel ball is used, and the expression is as follows:
g(x,y)=k×f(x,y)+a (1)
wherein, f (x, y) represents the pixel value of the original image coordinate (x, y), g (x, y) represents the pixel value after transformation, k represents the slope of the transformation function, k is 255/(GMax-GMin), a is-k GMin, GMax is the maximum pixel value of the image, and GMin is the minimum pixel value of the image;
s313: removing various random noises in the image by adopting a spatial filtering method, and inhibiting and removing the noises by using a median filter under the condition of keeping the edge details of the steel ball as much as possible;
s32: identifying and counting: s321: segmenting the target and the background by using a threshold value, wherein the threshold value is selected by analyzing and calculating an actual image, and the formula is as follows:
TH(x,y)=g(x,y)+k×f(x,y)+n (2)
wherein, TH (x, y) is a threshold value of original image coordinates (x, y), g (x, y) represents a local mean value, f (x, y) represents a local standard deviation, k is a weight coefficient, and n is a set constant; equation (2) that is, the threshold for the location pixel is determined by the weighted sum of the local statistics, mean and standard deviation of the location (x, y) in its neighborhood; the threshold value is set to be dynamic, a threshold value exists in each position pixel point, and a proper threshold value can be extracted from the image by using the existing operator in the halcon;
s322: because the image after threshold segmentation has noises such as isolated points, burrs and the like, the noise is eliminated by carrying out mathematical morphology operation on the image, and the image is corroded and expanded by utilizing open operation; reducing the white area in the target inwards by using an erosion function, and filling a white gap in the target object; expanding the white area outwards by using an expansion function to eliminate noise at the target connection boundary;
and (3) corrosion: a Θ B ═ { z | (B) z ═ Ac ═ Φ } (3)
Expansion:
Figure BDA0003024970540000091
meanwhile, the shape of a larger object in the image is kept basically unchanged in the corrosion process by utilizing the opening operation; smoothing the image contour in the expansion process by using a closing operation; under the condition of not obviously changing the area, the image can be subjected to opening operation, firstly corroded and then expanded, and the method has the effects of eliminating a fine area with high brightness, separating an object at a fine point, smoothing the boundary of a larger object and the like. The image can be subjected to closed operation, expansion is carried out firstly, and then corrosion is carried out, so that the method has the effects of filling a region with fine black cavities of a white object, connecting adjacent objects, using the same structural element, carrying out repeated iterative processing and the like;
opening operation:
Figure BDA0003024970540000092
closing operation:
Figure BDA0003024970540000093
s323: after the processed images are connected, recognizing a reflective point in the image, which is regarded as a rectangle or a circular spot with a certain area, by using an image matching function, wherein the radius and the area need to be set with parameters, and the reflective point also needs to be obtained in the analysis and calculation of the actual image; and extracting independent targets of corresponding characteristic values according to the range of the characteristic values such as shape, radius, area, gray level and the like.
Further, the first support 4 and the second support 5 are both triangular supports. Is beneficial to the stability and the durability of the bracket. Because original drop basket 2 is in motion, so the shooting process utilizes proximity switch to control camera 1 and board type lamp 8, promote to the peak from the fused salt when drop basket 2 passes through pull rod 9 on the frame 3, the basket lid of drop basket 2 top is opened to the maximum angle, trigger hall sensor 6, camera 1 and board type lamp 8 begin to work behind the contact switch, in setting up shooting interval and shooting duration, drop basket 2 uncaps and pours the steel ball, select the complete image that shows of steel ball and carry out follow-up image processing and discernment from shooing.
Further, the plate-shaped lamp 8 and the camera 1 are both connected to the support through a rotating mechanism.
Further, the rotating mechanisms are all rotating shafts of 360 degrees.
Furthermore, a steel ball is arranged in the leaching basket 2, and the leaching basket 2 can move in and out of the bath salt.
Further, the lighting device and the camera 1 are both connected with a switch, and the switch is connected with the Hall sensor 6.
The detection system of the invention not only applies the image processing and recognition technology to the industrial manufacture, but also ensures the correctness of the quenching process of the steel ball, improves the qualified rate of the steel ball generation, and improves the efficiency and the quality of the steel ball production by utilizing the intelligent manufacture to a great extent;
the invention discloses a steel ball detection method based on machine vision, which has the following main innovation points: 1. steel ball identification and detection algorithm: designing a method based on dynamic threshold segmentation and morphological detection, which is a comprehensive algorithm of two basic detection methods, firstly preprocessing an input image to remove background noise, such as interference of uneven illumination and shadow; then, enhancing target characteristics by utilizing linear operation, and removing noise such as block structures; secondly, performing threshold segmentation on the preprocessed image by utilizing a maximum between-class variance algorithm, wherein the threshold can be a dynamic threshold according to a gray level histogram of the image or can be obtained by a self-adaptive algorithm; and finally, selecting larger structural elements to perform operations such as corrosion, expansion, opening operation, closing operation and the like on the image. The method can effectively utilize the shape attribute, connectivity, curvature and the like of the target in the image, and is more applied to the detection research of the bearing surface defects; 2. an online machine vision system: a steel ball detection system based on machine vision is designed, different detection methods are analyzed according to characteristic values in shot steel ball images, a detection flow is established, industrial machine vision image processing software Halcon is adopted to carry out software analysis, and the characteristics of a special light source required by a bearing ring in the shooting process and the industrial design of how to carry out light source irradiation and the like are calculated and analyzed in combination with a light source theory.
In conclusion, the steel ball detection method based on machine vision monitors the quenching process of the salt bath resistance furnace on the steel ball, shoots the steel ball, counts the steel balls in the shot image by utilizing the image recognition technology, and can intelligently control the quenching process of the steel ball to be carried out according to the regulations; and the real-time online detection system is completed, and an alarm is given for the condition that the number of the steel balls does not meet the specification.
The principal features, principles and advantages of the invention have been shown and described above. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to explain the principles of the invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the invention as expressed in the following claims. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (6)

1. The steel ball detection method based on machine vision is characterized in that: the detection system used in the detection method comprises an illuminating device, a camera (1), a draining basket (2), a frame (3), a first support (4), a second support (5) and a Hall sensor (6), wherein the illuminating device consists of an LED light source (7) and a plate-type lamp (8) which are connected, and the LED light source (7) is arranged on the plate-type lamp (8);
the draining basket (2) is arranged on the frame (3) through a pull rod (9) and moves up and down, a Hall sensor (6) connected with a switch is arranged at the upper part of the frame (3), a plate-type lamp (8) is connected to the frame (3) through a first support (4), a camera (1) is connected to the frame (3) through a second support (5), and the plate-type lamp (8) and the camera (1) are sequentially positioned in front of the draining basket (2) and are both arranged towards the draining basket (2);
the detection method comprises the following steps:
s1: by adopting the front illumination scheme, the plate-type lamp (8) and the camera (1) are arranged in front of the upper part of the draining basket (2) filled with the steel balls by utilizing the rotating mechanism, the plate-type lamp (8) illuminates from the side, and the camera (1) shoots from the right front; according to the requirement that a light source needs to ensure enough overall brightness to illuminate an object during shooting, the characteristic quantity of the object in an image needs to be maximized, and the contrast is increased;
s2: when the draining basket (2) is lifted to the highest point from the molten salt through a pull rod (9) on the frame (3), a basket cover above the draining basket (2) is opened to the maximum angle, a Hall sensor (6) is triggered, a camera (1) and a plate type lamp (8) start to work after a switch is contacted, the draining basket (2) is opened to pour out a steel ball in a set shooting interval and a set shooting duration, and an image completely displayed by the steel ball is selected from shooting to perform subsequent image processing and identification;
s3: image processing:
s31: image preprocessing: s311: cutting out a required target area from the original image by using a matting operator, so that the interference caused by a large number of light reflecting points on the basket cover or the edge can be effectively avoided;
s312: performing basic linear transformation on the digital image by using point calculation, enhancing the image, stretching the pixel value of a target area, and improving the contrast ratio of a target and a background; the image enhancement is mainly performed in the spatial domain by using a gray scale transformation method, wherein a transformation function meeting the actual requirement of identifying the steel ball is used, and the expression is as follows:
g(x,y)=k×f(x,y)+a (1)
wherein, f (x, y) represents the pixel value of the original image coordinate (x, y), g (x, y) represents the pixel value after transformation, k represents the slope of the transformation function, k is 255/(GMax-GMin), a is-k GMin, GMax is the maximum pixel value of the image, and GMin is the minimum pixel value of the image;
s313: removing various random noises in the image by adopting a spatial filtering method, and inhibiting and removing the noises by using a median filter under the condition of keeping the edge details of the steel ball as much as possible;
s32: identifying and counting: s321: segmenting the target and the background by using a threshold value, wherein the threshold value is selected by analyzing and calculating an actual image, and the formula is as follows:
TH(x,y)=g(x,y)+k×f(x,y)+n (2)
wherein, TH (x, y) is a threshold value of original image coordinates (x, y), g (x, y) represents a local mean value, f (x, y) represents a local standard deviation, k is a weight coefficient, and n is a set constant; equation (2) that is, the threshold for the location pixel is determined by the weighted sum of the local statistics, mean and standard deviation of the location (x, y) in its neighborhood;
s322: because the image after threshold segmentation has noises such as isolated points, burrs and the like, the noise is eliminated by carrying out mathematical morphology operation on the image, and the image is corroded and expanded by utilizing open operation; reducing the white area in the target inwards by using an erosion function, and filling a white gap in the target object; expanding the white area outwards by using an expansion function to eliminate noise at the target connection boundary;
and (3) corrosion: a Θ B ═ { z | (B) z ═ Ac ═ Φ } (3)
Expansion: a { { z | (B) z ≠ Pq } (4)
Meanwhile, the shape of a larger object in the image is kept basically unchanged in the corrosion process by utilizing the opening operation; smoothing the image contour in the expansion process by using a closing operation;
opening operation: AoB ═ B ≠ B (5)
Closing operation: a.b ═ (a ≧ B) Θ B (6);
s323: after the processed images are connected, recognizing a reflective point in the image, which is regarded as a rectangle or a circular spot with a certain area, by using an image matching function, wherein the radius and the area need to be set with parameters, and the reflective point also needs to be obtained in the analysis and calculation of the actual image; and extracting independent targets of corresponding characteristic values according to the range of the characteristic values such as shape, radius, area, gray level and the like.
2. The machine-vision-based steel ball detection method according to claim 1, characterized in that: the first support (4) and the second support (5) are triangular supports.
3. The machine-vision-based steel ball detection method according to claim 1, characterized in that: the plate-type lamp (8) and the camera (1) are connected to the support through the rotating mechanism.
4. The machine-vision-based steel ball detection method according to claim 3, characterized in that: the rotating mechanisms are all 360-degree rotating shafts.
5. The machine-vision-based steel ball detection method according to claim 1, characterized in that: the steel ball is arranged in the leaching basket (2), and the leaching basket (2) can move in and out of the bath salt.
6. The machine-vision-based steel ball detection method according to claim 1, characterized in that: the lighting device and the camera (1) are connected with a switch, and the switch is connected with the Hall sensor (6).
CN202110413592.XA 2021-04-16 2021-04-16 Steel ball detection method based on machine vision Pending CN113096106A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110413592.XA CN113096106A (en) 2021-04-16 2021-04-16 Steel ball detection method based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110413592.XA CN113096106A (en) 2021-04-16 2021-04-16 Steel ball detection method based on machine vision

Publications (1)

Publication Number Publication Date
CN113096106A true CN113096106A (en) 2021-07-09

Family

ID=76678258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110413592.XA Pending CN113096106A (en) 2021-04-16 2021-04-16 Steel ball detection method based on machine vision

Country Status (1)

Country Link
CN (1) CN113096106A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116136393A (en) * 2023-03-02 2023-05-19 宁波川原精工机械有限公司 Bearing ring inner ring detection system and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116136393A (en) * 2023-03-02 2023-05-19 宁波川原精工机械有限公司 Bearing ring inner ring detection system and method

Similar Documents

Publication Publication Date Title
CN107610111B (en) deep learning-based welding spot image detection method
CN110445921A (en) A kind of Mobile phone screen backlight foreign matter defect diagnostic method and device based on machine vision
CN111539935A (en) Online cable surface defect detection method based on machine vision
CN106097368B (en) A kind of recognition methods in veneer crack
CN113177924A (en) Industrial production line product flaw detection method
CN113658131A (en) Tour type ring spinning broken yarn detection method based on machine vision
CN111192273A (en) Digital shot blasting coverage rate measuring method based on computer vision technology
CN115170669A (en) Identification and positioning method and system based on edge feature point set registration and storage medium
CN111583193A (en) Pistachio nut framework extraction device based on geometric contour template matching and algorithm thereof
CN113096106A (en) Steel ball detection method based on machine vision
CN111754525A (en) Industrial character detection process based on non-precise segmentation
CN214846819U (en) Steel ball detecting system based on machine vision
Li et al. Detection and recognition of characters on the surface of metal workpieces with complex background
CN112614139B (en) Conveyor belt ore briquette screening method based on depth map
CN110487807A (en) A kind of dry cell zinc cylinder open defect vision inspection apparatus and method
CN111489367B (en) Positioning method for automatically selecting feasible coding area of hub two-dimensional code
CN109544513A (en) A kind of steel pipe end surface defect extraction knowledge method for distinguishing
CN110530894B (en) Light guide plate bright spot defect detection method
CN108280841A (en) A kind of foreground extracting method based on neighborhood territory pixel intensity correction
CN114932292B (en) Narrow-gap passive vision weld joint tracking method and system
CN111833350A (en) Machine vision detection method and system
CN115661110A (en) Method for identifying and positioning transparent workpiece
CN112102319B (en) Dirty image detection method, dirty image detection device, and dirty image detection mechanism
WO2022088544A1 (en) Following robot multi-target identification system and method based on coded thermal infrared marker
CN115900854A (en) Belt ore conveying weighing and granularity estimation intelligent detection system and method

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