A high-speed dense steel ball detection and statistics method based on machine vision
By using a high-speed, intensive statistical method for steel ball detection based on machine vision, the problems of low efficiency and instability caused by manual control variables in pellet production have been solved, achieving automated detection and efficient production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN TIANHAI CHENGUANG TECH CO LTD
- Filing Date
- 2022-09-02
- Publication Date
- 2026-04-17
AI Technical Summary
In existing technologies, pellet production relies on manual observation and control of variables, resulting in low production efficiency, unstable quality, and is time-consuming and labor-intensive, requiring a large number of highly skilled workers.
A high-speed, intensive steel ball detection and statistical method based on machine vision is adopted, including scene construction, camera calibration, steel ball detection algorithm, pixel to true diameter conversion, steel ball tracking and cascade matching, and diameter statistics. Automated detection is achieved through industrial cameras and light source systems.
It enables accurate detection and statistics of high-speed moving steel balls, with fast response and high precision, reducing reliance on highly skilled workers and improving production efficiency and quality stability.
Smart Images

Figure CN115628695B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of precision testing technology, and more specifically, to a high-speed, high-density statistical method for steel ball detection based on machine vision. Background Technology
[0002] Currently, steel balls can be classified into different types according to processing technology, materials, and applications. Among them, bearing steel balls are important basic components in industry and are spherical iron alloy wear-resistant bodies that need to be produced by forging, spinning, rolling, and casting.
[0003] Pelletizing is a fundamental step in the steel industry; however, pellet plants currently rely on simple manual observation to control variables such as feed rate, water supply, and pelletizing machine speed to determine pellet size. This manual approach is inefficient, produces inconsistent quality, requires a large number of highly skilled workers, and is extremely time-consuming and labor-intensive. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies, this invention provides a high-speed, high-density steel ball detection and statistical method based on machine vision.
[0005] The technical solution adopted by this invention to solve its technical problem is: a high-speed, high-density steel ball detection and statistical method based on machine vision, the improvement of which is that the method includes the following steps:
[0006] S10. Scene setup and camera calibration for steel ball detection, including setting up the steel ball rolling slope, assuming an industrial high-speed camera, and setting up the light source system; and calculating correction parameters through camera calibration.
[0007] S20, steel ball detection algorithm and pixel to true diameter conversion, generate moving steel ball detection target, and obtain the conversion relationship between pixels and true diameter;
[0008] S30, Steel ball tracking filtering and steel ball tracking cascade matching, wherein the steel ball tracking algorithm includes detecting the moving steel ball target box for each frame of the image, obtaining the bounding rectangle of the steel ball, and initializing the tracker, and the steel ball tracking cascade matching includes detecting the steel ball detection box in the current frame and establishing the tracker using Kalman filtering;
[0009] S40. Steel ball diameter statistics: By monitoring all trackers, trackers with unreasonable cycles are filtered out, and the average diameter of the Hough circle of each tracker is calculated to statistically analyze the distribution of steel ball diameters over a certain period of time.
[0010] Furthermore, in step S10, the scenario setup for steel ball detection includes the following steps:
[0011] S101. The surface on which the steel ball rolls down the ramp must be smooth and matte, and its color must be distinguishable from that of the steel ball.
[0012] S102. A camera lens is mounted perpendicular to the inclined plane where the steel ball rolls down.
[0013] S103. Adjust the camera distance so that the camera's field of view encompasses the detection area, and manually focus;
[0014] S104. Use strong industrial lighting to shine directly onto the inclined surface of the steel ball to remove the shadows cast by the light source.
[0015] Furthermore, in step S10, camera calibration includes preparing a checkerboard calibration board, acquiring calibration images from various angles on the plane, and calculating correction parameters.
[0016] Furthermore, the camera calibration includes the following steps:
[0017] S110. Adjust the size of the chessboard grid according to the distance from the camera to the slope where the steel ball rolls down;
[0018] S111. Place the checkerboard pattern flat on the inclined plane where the steel ball rolls down and take pictures of the checkerboard pattern from various angles and positions.
[0019] S112. For each calibration image, use OpenCV to extract corner information;
[0020] S113. For each calibration image, further extract sub-pixel corner information;
[0021] S114. Draw the found interior corner points on the chessboard calibration diagram;
[0022] S115. Calculate the camera's intrinsic and extrinsic parameters and evaluate the calibration performance using the back projection method.
[0023] S116. Using the obtained intrinsic and extrinsic parameters of the camera, perform distortion correction on the image and check the correction effect.
[0024] Furthermore, in step S20, the steel ball detection algorithm includes the following steps:
[0025] S201. Real-time acquisition of video captured by the camera, decoding of the video, and acquisition of a complete and clear currently captured image;
[0026] S202. Adaptive threshold binarization of the input image to obtain a mask image, and opening operation on the mask image to remove noise points;
[0027] S203. Perform corresponding closing operations on the opening operation mask diagram to ensure that the steel balls are of the same size;
[0028] S204. Detect contour lines on the mask image, generate contour circles, and perform Hough transform on all contours on the contour circles to fit a circle.
[0029] S205. Filter out unreasonable Hough circles based on the diameter of the fitted circle to generate moving steel ball detection targets.
[0030] Furthermore, in step S20, obtaining the conversion relationship between pixels and the actual diameter includes the following steps:
[0031] S211. Multiple steel balls of known size and the same dimensions are dropped from the detection area;
[0032] S212. Collect multiple images of the steel ball during its descent.
[0033] S213. According to steps S202-S205, detect steel balls on the above images and calculate the average diameter of the steel balls detected in all images.
[0034] S214. By calculating the ratio of the average diameter of the steel ball to the actual diameter, the conversion relationship between pixels and the actual diameter is obtained.
[0035] Furthermore, in step S30, the steel ball tracking cascade matching includes the following steps:
[0036] S301. Detect the steel ball target and its bounding rectangle in the current frame according to step S20;
[0037] S302. Perform Kalman prediction on all current trackers to obtain predicted target boxes, and match the detected target boxes in the current frame with the predicted target boxes of the trackers based on IoU;
[0038] S303. Target boxes that are successfully matched for IOU are filtered based on size, that is, the Hough circle diameters corresponding to the target boxes matched in the previous frame and the current frame are matched.
[0039] S304. If a target box is successfully matched, the tracker is updated; if a target box is not successfully matched, a new tracker is initialized.
[0040] Furthermore, in step S30, the steel ball tracking algorithm includes the following steps:
[0041] S311. For each input frame image, detect the Hough circle of the steel ball target according to step S20, and obtain the bounding rectangle for all steel ball target Hough circles.
[0042] S312. Cache all current rectangles for use in the steel ball tracking cascade matching method in steps S301-S304;
[0043] S313. If there is no tracker for the target box, create a new tracker for all target boxes and build a velocity model based on the Kalman filter principle.
[0044] S314. If the target box currently has a tracker, update the tracker according to the steel ball tracking cascade matching method in steps S301-S304.
[0045] Furthermore, step S40 includes the following steps:
[0046] S401. Detect all trackers and filter all currently dead trackers;
[0047] S402. Currently, all death trackers are filtered based on their survival period, filtering out trackers with periods that are too long or too short.
[0048] S403. Calculate the average diameter of all Hough circles detected in each tracker cycle.
[0049] S404. Calculate the actual steel ball diameter distribution based on the above average diameter according to step S20.
[0050] The beneficial effects of this invention are: the high-speed, high-density steel ball detection and statistical method based on machine vision provided by this invention can accurately detect clustered steel balls in high-speed motion, and has significant advantages such as fast response, high precision, and low operation requirements, and can achieve efficient production without the need for highly skilled workers. Attached Figure Description
[0051] Figure 1 This is a flowchart illustrating a high-speed, high-density steel ball detection and statistical method based on machine vision, as described in this invention. Detailed Implementation
[0052] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0053] The following will clearly and completely describe the concept, specific structure, and technical effects of the present invention in conjunction with embodiments and accompanying drawings, so as to fully understand the purpose, features, and effects of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. Other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are all within the scope of protection of the present invention. Furthermore, all connections / linkages involved in the patent do not simply refer to direct contact between components, but rather to the ability to form a better connection structure by adding or reducing connecting accessories according to specific implementation conditions. The various technical features in this invention can be combined interactively without contradicting each other.
[0054] Reference Figure 1 As shown, this invention discloses a high-speed, high-density steel ball detection statistical method based on machine vision. In this embodiment, the method includes steps S10 to S40, specifically as follows:
[0055] S10. Scene setup and camera calibration for steel ball detection, including setting up the steel ball rolling slope, assuming an industrial high-speed camera, and setting up the light source system; and calculating correction parameters through camera calibration.
[0056] In this embodiment, step S10, setting up the scene for steel ball detection includes the following steps:
[0057] S101. The surface on which the steel ball rolls down the ramp must be smooth and matte, and its color must be distinguishable from that of the steel ball.
[0058] S102. A camera lens is mounted perpendicular to the inclined plane where the steel ball rolls down.
[0059] S103. Adjust the camera distance so that the camera's field of view encompasses the detection area, and manually focus;
[0060] S104. Use strong industrial lighting to shine directly onto the inclined surface of the steel ball to remove the shadows cast by the light source.
[0061] In step S10, camera calibration includes preparing a checkerboard calibration board, acquiring calibration images from various angles on the plane, and calculating correction parameters.
[0062] More specifically, in this embodiment, the camera calibration includes the following steps:
[0063] S110. Adjust the size of the chessboard grid according to the distance from the camera to the slope where the steel ball rolls down;
[0064] S111. Place the checkerboard pattern flat on the inclined plane where the steel ball rolls down and take pictures of the checkerboard pattern from various angles and positions.
[0065] S112. For each calibration image, use OpenCV to extract corner information;
[0066] S113. For each calibration image, further extract sub-pixel corner information;
[0067] S114. Draw the found interior corner points on the chessboard calibration diagram;
[0068] S115. Calculate the camera's intrinsic and extrinsic parameters and evaluate the calibration performance using the back projection method.
[0069] S116. Using the obtained intrinsic and extrinsic parameters of the camera, perform distortion correction on the image and check the correction effect.
[0070] In the camera calibration process, the Zhang Zhengyou calibration method can be used to calculate the camera intrinsic parameter mtx, and the distortion coefficient dist is used for image correction.
[0071] S20, steel ball detection algorithm and pixel to true diameter conversion, generate moving steel ball detection target, and obtain the conversion relationship between pixels and true diameter;
[0072] In step S20, the steel ball detection algorithm includes the following steps:
[0073] S201. Real-time acquisition of video captured by the camera, decoding of the video, and acquisition of a complete and clear currently captured image;
[0074] S202. Adaptive threshold binarization of the input image is performed to obtain a mask image, and an opening operation is performed on the mask image to remove noise points; in this embodiment, adaptive threshold binarization of the input image is performed based on OpenCV.
[0075] S203. Perform corresponding closing operations on the opening operation mask diagram to ensure that the steel balls are of the same size;
[0076] S204. Detect contour lines on the mask image, generate contour circles, and perform Hough transform on all contours on the contour circles to fit the circles; In this embodiment, contour line detection is performed on the mask image after opening and closing operations and denoising based on OpenCV to generate a contour image; and Hough transform is performed on all contours on the contour image based on OpenCV to fit the circles.
[0077] S205. Filter out unreasonable Hough circles based on the diameter of the fitted circle to generate moving steel ball detection targets.
[0078] Furthermore, in step S20, obtaining the conversion relationship between pixels and the actual diameter includes the following steps:
[0079] S211. Multiple steel balls of known size and the same dimensions are dropped from the detection area;
[0080] S212. Collect multiple images of the steel ball during its descent.
[0081] S213. According to steps S202-S205, detect steel balls on the above images and calculate the average diameter of the steel balls detected in all images.
[0082] S214. By calculating the ratio of the average diameter of the steel ball to the actual diameter, the conversion relationship between pixels and the actual diameter is obtained.
[0083] S30, Steel ball tracking filtering and steel ball tracking cascade matching, wherein the steel ball tracking algorithm includes detecting the moving steel ball target box for each frame of the image, obtaining the bounding rectangle of the steel ball, and initializing the tracker, and the steel ball tracking cascade matching includes detecting the steel ball detection box in the current frame and establishing the tracker using Kalman filtering;
[0084] In step S30, the steel ball tracking cascade matching includes the following steps:
[0085] S301. Detect the steel ball target and its bounding rectangle in the current frame according to step S20;
[0086] S302. Perform Kalman prediction on all current trackers to obtain predicted target boxes, and match the detected target boxes in the current frame with the predicted target boxes of the trackers based on IoU;
[0087] S303. Target boxes that are successfully matched for IOU are filtered based on size, that is, the Hough circle diameters corresponding to the target boxes matched in the previous frame and the current frame are matched.
[0088] S304. If a target box is successfully matched, the tracker is updated; if a target box is not successfully matched, a new tracker is initialized.
[0089] In step S30, the steel ball tracking algorithm includes the following steps:
[0090] S311. For each input frame image, detect the Hough circle of the steel ball target according to step S20, and obtain the bounding rectangle for all steel ball target Hough circles.
[0091] S312. Cache all current rectangles for use in the steel ball tracking cascade matching method in steps S301-S304;
[0092] S313. If there is no tracker for the target box, create a new tracker for all target boxes and build a velocity model based on the Kalman filter principle.
[0093] S314. If the target box currently has a tracker, update the tracker according to the steel ball tracking cascade matching method in steps S301-S304.
[0094] S40. Steel ball diameter statistics: By monitoring all trackers, trackers with unreasonable cycles are filtered out, and the average diameter of the Hough circle of each tracker is calculated to statistically analyze the distribution of steel ball diameters over a certain period of time.
[0095] In the above embodiments, step S40 includes the following steps:
[0096] S401. Detect all trackers and filter all currently dead trackers;
[0097] S402. Currently, all death trackers are filtered based on their survival period, filtering out trackers with periods that are too long or too short.
[0098] S403. Calculate the average diameter of all Hough circles detected in each tracker cycle.
[0099] S404. Calculate the actual steel ball diameter distribution based on the above average diameter according to step S20.
[0100] Through the above steps, this invention provides a high-speed, high-density steel ball detection and statistical method based on machine vision. This method can accurately detect clusters of steel balls moving at high speeds, offering significant advantages such as fast response, high precision, and low operational requirements. It enables efficient production without the need for highly skilled workers. By combining machine vision methods and tracking algorithms, the method can effectively count the number and radius distribution of steel balls during movement. Furthermore, the obtained intrinsic and extrinsic parameters of the camera can be used to correct image distortion and examine the correction effect.
[0101] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A high-speed, high-density statistical method for steel ball detection based on machine vision, characterized in that, The method includes the following steps: S10. Scene setup and camera calibration for steel ball detection, including setting up the steel ball rolling slope, assuming an industrial high-speed camera, and setting up the light source system; and calculating correction parameters through camera calibration. In step S10, the scenario setup for steel ball detection includes the following steps: S101. The surface on which the steel ball rolls down the ramp must be smooth and matte, and its color must be distinguishable from that of the steel ball. S102. A camera lens is mounted perpendicular to the inclined plane where the steel ball rolls down. S103. Adjust the camera distance so that the camera's field of view encompasses the detection area, and manually focus; S104. Use strong industrial lighting to shine directly onto the inclined surface of the steel ball to eliminate the shadows cast by the light source on the sphere. S20, steel ball detection algorithm and pixel to true diameter conversion, generate moving steel ball detection target, and obtain the conversion relationship between pixels and true diameter; In step S20, the steel ball detection algorithm includes the following steps: S201. Real-time acquisition of video captured by the camera, decoding of the video, and acquisition of a complete and clear currently captured image; S202. Adaptive threshold binarization of the input image to obtain a mask image, and perform an opening operation on the mask image to remove noise points; S203. Perform corresponding closing operations on the opening operation mask diagram to ensure that the steel balls are of the same size; S204. Detect contour lines on the mask image, generate contour circles, and perform Hough transform on all contours on the contour circles to fit a circle. S205. Filter out unreasonable Hough circles based on the diameter of the fitted circle to generate moving steel ball detection targets; S30, Steel ball tracking filtering and steel ball tracking cascade matching, wherein the steel ball tracking algorithm includes detecting the moving steel ball target box for each frame of image, obtaining the bounding rectangle of the steel ball, and initializing the tracker, and the steel ball tracking cascade matching includes detecting the steel ball detection box of the current frame and establishing the tracker using Kalman filtering; S40. Steel ball diameter statistics: By monitoring all trackers, trackers with unreasonable cycles are filtered out, and the average diameter of the Hough circle for each tracker is calculated to statistically analyze the distribution of steel ball diameters over a certain period of time.
2. The high-speed, high-density steel ball detection and statistical method based on machine vision according to claim 1, characterized in that, In step S10, camera calibration includes preparing a checkerboard calibration board, acquiring calibration images from various angles on the plane, and calculating correction parameters.
3. The high-speed, high-density steel ball detection and statistical method based on machine vision according to claim 1, characterized in that, The camera calibration includes the following steps: S110. Adjust the size of the chessboard grid according to the distance from the camera to the slope where the steel ball rolls down; S111. Place the checkerboard pattern flat on the inclined plane where the steel ball rolls down and take pictures of the checkerboard pattern from various angles and positions. S112. For each calibration image, use OpenCV to extract corner information; S113. For each calibration image, further extract sub-pixel corner information; S114. Draw the found interior corner points on the chessboard calibration diagram; S115. Calculate the camera's intrinsic and extrinsic parameters and evaluate the calibration performance using the back projection method. S116. Using the obtained intrinsic and extrinsic parameters of the camera, perform distortion correction on the image and check the correction effect.
4. The high-speed, high-density steel ball detection and statistical method based on machine vision according to claim 1, characterized in that, In step S20, obtaining the conversion relationship between pixels and the actual diameter includes the following steps: S211. Multiple steel balls of known size and the same dimensions are dropped from the detection area; S212. Collect multiple images of the steel ball during its descent. S213. According to steps S202-S205, detect steel balls on the above images and calculate the average diameter of the steel balls detected in all images. S214. By calculating the ratio of the average diameter of the steel ball to the actual diameter, the conversion relationship between pixels and the actual diameter is obtained.
5. The high-speed, high-density steel ball detection and statistical method based on machine vision according to claim 4, characterized in that, In step S30, the steel ball tracking cascade matching includes the following steps: S301. Detect the steel ball target and its bounding rectangle in the current frame according to step S20; S302. Perform Kalman prediction on all current trackers to obtain predicted target boxes, and match the detected target boxes in the current frame with the predicted target boxes of the trackers based on IoU; S303. The target boxes that are successfully matched for IOU are filtered based on size, that is, the Hough circle diameters corresponding to the target boxes matched in the previous frame and the current frame are matched. S304. If a target box is successfully matched, the tracker is updated; if a target box is not successfully matched, a new tracker is initialized.
6. The high-speed, high-density steel ball detection and statistical method based on machine vision according to claim 5, characterized in that, In step S30, the steel ball tracking algorithm includes the following steps: S311. For each frame of the input image, detect the Hough circle of the steel ball target according to step S20, and obtain the bounding rectangle for all steel ball target Hough circles. S312. Cache all current rectangles for use in the steel ball tracking cascade matching method in steps S301-S304; S313. If there is no tracker for the target box, create a new tracker for all target boxes and build a velocity model based on the Kalman filter principle. S314. If the target box currently has a tracker, update the tracker according to the steel ball tracking cascade matching method in steps S301-S304.
7. The high-speed, high-density steel ball detection and statistical method based on machine vision according to claim 5, characterized in that, Step S40 includes the following steps: S401. Detect all trackers and filter all currently dead trackers; S402. Currently, all death trackers are filtered based on their survival period, filtering out trackers with periods that are too long or too short. S403. Calculate the average diameter of all Hough circles detected in each tracker cycle. S404. Calculate the actual steel ball diameter distribution based on the above average diameter according to step S20.
Citation Information
Patent Citations
Steel-ball diameter detecting system
CN106323183A
Steel ball precision counting and size identification device and method
CN107274407A