Machine vision-based on-line image detection method for material particle size
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG JIANGXUAN TECH CO LTD
- Filing Date
- 2026-05-28
- Publication Date
- 2026-08-07
AI Technical Summary
物料输送过程中易出现颗粒相互粘连、重叠堆叠的状态,常规算法无法精准定位颗粒隐藏分界位置,极易将多个粘连颗粒判定为单一整体,造成颗粒轮廓提取失真,粒度分级判断出现偏差
[0074]By leveraging the characteristics of particle edge curvature variation and the distribution characteristics of local gray-level minima, pseudo-boundaries of particles are constructed. The execution logic of connected component analysis is optimized, and hidden boundary positions between particles are identified from two dimensions: particle edge morphology changes and local gray-level differences. Material particles that are stuck together and stacked in the visual image are separated, reducing the interference caused by particle aggregation and adhesion on contour segmentation. The obtained independent particle contour information after separation is complete and closely matches the actual shape. The acquisition of geometric parameters such as particle projected area, projected perimeter, equivalent diameter, and shape factor is more closely aligned with the actual object state. The judgment criteria for particle size classification threshold range comparison are more comprehensive, and the single-particle recognition and discrimination in complex material stacking scenarios are improved.
Smart Images

Figure CN122282573B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision inspection technology, and in particular to a machine vision-based online image detection method for material particle size. Background Technology
[0002] In industrial material continuous conveying production scenarios, material particle size detection is a crucial aspect of production quality control. Currently, machine vision online inspection is widely used. This involves acquiring real-time images of the material surface on the conveyor belt, utilizing basic image processing techniques to remove noise and segment particle contours, and classifying the material particle size based on basic geometric parameter calculations. This enables routine online screening of material particle size and is widely applied in material conveying and processing scenarios such as mining, construction materials, and other industries.
[0003] Traditional image processing methods for particle segmentation rely solely on basic edge detection and conventional connected component algorithms to divide particle regions. During material transport, particles often stick together and overlap, making it difficult for conventional algorithms to accurately pinpoint hidden boundaries. This can easily lead to multiple stuck particles being mistaken for a single entity, resulting in distorted particle contour extraction and inaccurate particle size classification. Furthermore, fixed image data analysis methods can only output particle quantity percentages, providing a limited data format that is unsuitable for the dynamic conditions of continuous industrial production.
[0004] Segmentation errors caused by particle adhesion and overlap continuously interfere with the accuracy of particle geometric feature extraction, resulting in deviations in overall particle size detection results. Static particle statistics cannot reflect the flow rate changes during continuous material transport. By constructing pseudo-boundaries for particle segmentation based on multi-dimensional image features, the separation capability of particles in complex stacking conditions is improved. The detection data is converted by integrating the operating parameters of the conveying equipment, improving the particle size data output format for dynamic production scenarios and adapting to the actual application scenario of continuous detection on production lines. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a machine vision-based online image detection method for material particle size.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: a machine vision-based online image detection method for material particle size, comprising:
[0007] Collect a sequence of grayscale images of the material flow on the conveyor belt to obtain an initial material surface image containing variations in brightness;
[0008] The initial material surface image is subjected to background noise suppression processing to obtain an enhanced material surface feature image;
[0009] The enhanced material surface feature image is subjected to particle region segmentation processing based on edge information to extract multiple independent particle contour information;
[0010] Based on the particle contour information, an improved connected component analysis algorithm is used to separate particles that are stuck or overlapping in the image. The improved connected component analysis algorithm realizes the construction of particle pseudo-boundaries based on the particle edge curvature change characteristics and local gray-level minimum value distribution characteristics.
[0011] Based on the separated particles, the projected geometric features of each particle are calculated, including the particle's projected area, projected perimeter, equivalent diameter, and shape factor.
[0012] The projected geometric features are compared with a preset particle size classification threshold range to determine the particle size classification of each particle.
[0013] The number of particles belonging to different particle size levels within the field of view of the image is counted, and the proportion of particles at each particle size level is calculated.
[0014] Combined with the conveyor belt running speed, the particle quantity ratio is converted into continuous mass flow distribution data;
[0015] An online particle size distribution detection report is generated based on the mass flow rate distribution data.
[0016] As a further aspect of the present invention, the initial material surface image is subjected to background noise suppression processing to obtain an enhanced material surface feature image, including:
[0017] The initial material surface image is subjected to multi-scale Gaussian filtering to generate reference background images with different smoothness levels;
[0018] The reference background image with the lowest gray value at the corresponding position is subtracted pixel by pixel from the initial material surface image to obtain a preliminary corrected image that removes the influence of uneven lighting.
[0019] The preliminary corrected image is subjected to local contrast stretching processing, wherein the local contrast stretching processing calculates the gray-level histogram and performs equalization mapping on the image sub-blocks as units.
[0020] The image after contrast stretching is subjected to gradient amplitude-based edge enhancement processing to highlight the gray-level transition boundaries between material particles and the background and between particles.
[0021] An adaptive binarization segmentation is performed on the image after edge enhancement processing. The threshold for the adaptive binarization segmentation is dynamically calculated based on the mean and variance of the gray levels in the local region of the image.
[0022] Morphological opening operations are performed on the binarized segmentation results to eliminate isolated bright spots and fine burrs caused by noise in the image, forming the final enhanced material surface feature image.
[0023] As a further aspect of the present invention, the enhanced material surface feature image is subjected to particle region segmentation processing based on edge information to extract multiple independent particle contour information, including:
[0024] Edge detection is performed on the enhanced material surface feature image to generate a set of edge pixels of material particles. The edge detection uses operators that respond to edges in different directions.
[0025] Edge connection and contour tracking processing is performed on the set of edge pixels to connect edge pixels belonging to the same closed contour into an ordered sequence of contour points, forming a preliminary contour set.
[0026] Each contour point sequence in the preliminary contour set is subjected to polygon approximation processing to approximate the geometry of the original contour with fewer vertices.
[0027] Filter out contours that have too few vertices or too small area after polygon approximation processing, where the contours correspond to image noise or non-granular impurities.
[0028] The filtered contours are marked as independent candidate particle contours and assigned a unique contour identifier to form the multiple independent particle contour information.
[0029] As a further aspect of the present invention, the improved connected component analysis algorithm constructs particle pseudo-boundaries based on the particle edge curvature variation characteristics and local gray-level minimum value distribution characteristics, including:
[0030] For the particle contour information input from the improved connected component analysis algorithm, the curvature value at each pixel on the contour is calculated to form a contour curvature distribution curve.
[0031] In the contour curvature distribution curve, convex points with positive curvature and a value greater than the positive curvature threshold, and concave points with negative curvature and an absolute value greater than the negative curvature threshold are identified. The convex points and the concave points together constitute a potential set of particle contact points.
[0032] In the enhanced material surface feature image, locate the image region corresponding to the potential set of particle contact points, and search for the gray-level minimum point within the image region;
[0033] In the set of potential particle contact points, candidate points that exist in a preset neighborhood and have the minimum gray value are selected as effective particle separation seed points.
[0034] Centered on each effective particle separation seed point, a virtual dividing line is constructed into the particle adhesion area based on the edge direction and gray-scale gradient direction of its vicinity. The endpoint of the virtual dividing line is the effective particle separation seed point on the other side or the particle edge on the other side.
[0035] All the constructed virtual dividing lines, together with the original particle outline, constitute a new, separated closed particle outline.
[0036] As a further aspect of the present invention, taking each effective particle separation seed point as the center, and based on the edge direction and gray-scale gradient direction of its vicinity, a virtual dividing line is constructed into the particle adhesion region, including:
[0037] At the effective particle separation seed point, calculate the tangent direction of the original particle profile at the effective particle separation seed point;
[0038] In the enhanced material surface feature image, the gray-level gradient direction at the effective particle separation seed point is calculated;
[0039] The tangent direction and the gray-level gradient direction are weighted and synthesized to obtain the initial extension direction of the virtual segmentation line at the seed point.
[0040] Along the initial extension direction, the search path points are iteratively extended into the adhesion region with a fixed step size. In each extension step, the extension direction of the next step is adjusted according to the gray distribution in the neighborhood of the current path point, so that the extension path tends to move along the gray valley line.
[0041] When the extended path encounters another valid particle separation seed point, or intersects with another determined particle profile, the extension stops, and all the searched path points are connected into a continuous curve as the final virtual dividing line.
[0042] As a further aspect of the present invention, the calculation of the projected geometric features of each particle based on the separated particles includes:
[0043] For each independent particle closed contour separated by the improved connected component analysis algorithm, the total number of pixels contained inside its contour is calculated as the projected area of the independent particle.
[0044] Calculate the perimeter of the closed contour of each individual particle, where the perimeter is the sum of the Euclidean distances between all adjacent pixels on the contour;
[0045] Based on the projected area, calculate the diameter of a circle with the same projected area, and use it as the equivalent diameter of the corresponding particle.
[0046] The shape factor of the particle is calculated based on the projected area and the perimeter, whereby the shape factor is the ratio of the square of the perimeter to the product of four times the projected area and pi.
[0047] The projected area, perimeter, equivalent diameter, and shape factor are combined to form a projected geometric feature describing the morphology of a single particle.
[0048] As a further aspect of the present invention, the projected geometric features are compared with a preset particle size classification threshold range to determine the particle size classification of each particle, including:
[0049] Multiple consecutive granularity levels are pre-defined, and each level corresponds to a threshold range of the equivalent diameter value.
[0050] The equivalent diameter calculated for the current particle is read.
[0051] The equivalent diameter of the current particle is compared one by one with the threshold range of the equivalent diameter of all preset particle size levels.
[0052] Identify the threshold range of the equivalent diameter value at a specific particle size level into which the current particle's equivalent diameter falls;
[0053] Mark the current particle as belonging to the specific particle size level;
[0054] For particles whose shape factor is greater than the shape anomaly threshold, regardless of their equivalent diameter, they are marked as abnormal shape particles and excluded from the normal particle size classification.
[0055] As a further aspect of the present invention, the statistical analysis of the number of particles belonging to different particle sizes within the field of view of the image, and the calculation of the proportion of particles at each particle size level, includes:
[0056] Traverse all particles within the current image field of view that have completed the granularity level attribution determination;
[0057] The total number of particles belonging to each of the preset particle size levels;
[0058] The total number of particles at all granularity levels is accumulated as the total number of particles detected within the image's field of view;
[0059] Divide the total number of particles at each granularity level by the total number of particles detected within the image field of view to obtain the percentage of particles at the corresponding granularity level.
[0060] Combine the percentage of particles at all granularity levels to form a granularity level particle quantity distribution vector for the current image frame.
[0061] As a further aspect of the present invention, the step of converting the particle quantity ratio into continuous mass flow distribution data in conjunction with the conveyor belt operating speed includes:
[0062] The speed of the conveyor belt and the bulk density of the material are obtained at the moment of image acquisition.
[0063] The material volume flow rate represented by a single frame image is calculated based on the field of view area of the image acquisition, the running speed, and the time interval of single frame image processing.
[0064] Assuming that materials of all particle size classes have the same bulk density, the total mass flow rate of the material is obtained by multiplying the volumetric flow rate of the material by the bulk density.
[0065] The total mass flow rate is proportionally allocated according to the particle number distribution vector of the current image frame at each particle size level, and the mass flow rate of each particle size level passing through the detection section per unit time is calculated.
[0066] The mass flow rates at each granularity level calculated from multiple consecutive frames of images are subjected to time-series moving average filtering to obtain smooth and continuous mass flow rate distribution data.
[0067] As a further aspect of the present invention, generating an online particle size distribution detection report based on the mass flow rate distribution data includes:
[0068] The mass flow distribution data within a fixed time interval is summarized.
[0069] Calculate the average, maximum, minimum, and standard deviation of the mass flow rate for each particle size level within the cycle;
[0070] Fill the statistical data of mass flow rate at each particle size level, as well as the total mass flow rate data within the cycle, into the preset report template;
[0071] Add timestamps, testing equipment identification, and material batch information to the report template;
[0072] The completed report template is generated as an electronic document in the specified format, which is then stored or output as the online detection report for the granularity distribution.
[0073] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0074] By leveraging the characteristics of particle edge curvature variation and the distribution characteristics of local gray-level minima, pseudo-boundaries of particles are constructed. The execution logic of connected component analysis is optimized, and hidden boundary positions between particles are identified from two dimensions: particle edge morphology changes and local gray-level differences. Material particles that are stuck together and stacked in the visual image are separated, reducing the interference caused by particle aggregation and adhesion on contour segmentation. The obtained independent particle contour information after separation is complete and closely matches the actual shape. The acquisition of geometric parameters such as particle projected area, projected perimeter, equivalent diameter, and shape factor is more closely aligned with the actual object state. The judgment criteria for particle size classification threshold range comparison are more comprehensive, and the single-particle recognition and discrimination in complex material stacking scenarios are improved.
[0075] By combining conveyor belt speed parameters to convert particle quantity percentages, the system moves beyond the single mode of outputting only static particle statistics in particle size analysis. Discrete particle size distribution data is transformed into a coherent mass flow distribution. This allows for the integration of material particle size classification results with conveyor operation conditions, providing a complete picture of the distribution fluctuations of different particle sizes during continuous conveying. The system also enriches the output types of particle size analysis data, ensuring the analysis content aligns with the production characteristics of continuous industrial conveying. It provides comprehensive feedback on particle size distribution fluctuations during long-cycle material conveying, further broadening the scope of particle size distribution analysis reports. Attached Figure Description
[0076] Figure 1 This is a flowchart of the online image detection method for material particle size based on machine vision according to the present invention;
[0077] Figure 2 The flowchart for background noise suppression processing;
[0078] Figure 3 This is a flowchart for granular region segmentation based on edge information. Detailed Implementation
[0079] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0080] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0081] See Figure 1 This invention provides a machine vision-based online image detection method for material particle size. The method includes: fixing an industrial camera and lighting device above a conveyor belt to acquire a sequence of grayscale images of the surface of the moving material flow on the conveyor belt, thereby obtaining an initial material surface image containing the light and dark variations of the material surface. Background noise suppression processing is applied to the acquired initial material surface image to reduce uneven lighting and noise interference, resulting in an enhanced material surface feature image. Particle region segmentation processing based on edge information is performed on the enhanced material surface feature image to identify and extract multiple independent particle contour information from the image. For the extracted particle contours, an improved connected component analysis algorithm is used to separate particles that are not correctly segmented due to adhesion or overlap, based on the particle contour information. This improved connected component analysis algorithm constructs particle pseudo-boundaries based on the particle edge curvature variation characteristics and local grayscale minimum value distribution characteristics. Based on the separated, independent particles, the projected geometric features of each particle are calculated, including the particle's projected area, projected perimeter, equivalent diameter, and shape factor. The calculated projected geometric features of each particle are compared with a preset particle size classification threshold range to determine the particle size classification of each particle. The number of particles belonging to different particle size classes within the field of view of a single image is counted, and the proportion of particles at each particle size class is calculated. Combined with process parameters such as conveyor belt speed, the calculated particle quantity proportions are converted into continuous mass flow rate distribution data. A formatted online particle size distribution detection report is generated based on this mass flow rate distribution data.
[0082] In one embodiment of the present invention, see [reference] Figure 2The initial material surface image is subjected to multi-scale Gaussian filtering. Multiple convolutions of the original image with Gaussian kernels of different sizes generate a series of reference background images with varying degrees of smoothness. From the initial material surface image, the image with the lowest grayscale value at the corresponding position in all reference background images is subtracted pixel-by-pixel. This operation counteracts the effect of uneven background illumination, resulting in a preliminary corrected image free from the influence of uneven illumination. Local contrast stretching is then applied to this preliminary corrected image. The process is performed on a sub-block basis, calculating the grayscale histogram within each block and performing equalization mapping based on the histogram to enhance grayscale contrast within the block. Edge enhancement based on gradient magnitude is then applied to the contrast-stretched image. By calculating the image gradient and enhancing pixels with larger gradients, the grayscale transition boundaries between material particles and the background, as well as between different particles, are highlighted. Adaptive binarization segmentation is then performed on the edge-enhanced image. The segmentation threshold is not calculated using a fixed value but is dynamically calculated based on the mean and variance of grayscale values in each local region of the image. The binarized segmentation results are processed by morphological opening operation, which consists of erosion followed by dilation operation. This operation is used to eliminate isolated bright spots and small burrs caused by noise in the image, forming the final enhanced material surface feature image.
[0083] In specific implementation, background noise suppression processing is performed on the initial material surface image to obtain an enhanced material surface feature image. An industrial camera captures the reflected light from the material surface on the conveyor belt to form the initial material surface image. Each pixel in the initial material surface image has a gray value ranging from 0 to 255. Due to uneven lighting and sensor noise, the image background has variations in brightness and noise. In specific implementation, multi-scale Gaussian filtering is performed on the initial material surface image to construct three Gaussian kernels of different sizes: 5×5 pixels, 15×15 pixels, and 31×31 pixels. Each Gaussian kernel has a different standard deviation parameter. Two-dimensional convolution operations are performed on the initial material surface image using these three Gaussian kernels to generate three reference background images with different degrees of smoothness. The larger the Gaussian kernel, the smoother the reference background image and the less detail is retained. In some embodiments, the reference background image with the lowest gray value at the corresponding position is subtracted pixel by pixel from the initial material surface image. For a pixel with coordinates (x, y), the gray values at that point are compared with those of three reference background images. The minimum value is selected as the background estimate. This minimum value is then subtracted from the original gray value of the initial material surface image at point (x, y). If the result is negative, it is set to zero, resulting in a preliminary corrected image free from the influence of uneven lighting. In practice, the preliminary corrected image undergoes local contrast stretching. The preliminary corrected image is divided into multiple non-overlapping image sub-blocks, each 16×16 pixels in size. For each sub-block, its internal gray-level histogram is independently calculated. Based on the gray-level histogram, the cumulative distribution function is calculated and equalization mapping is performed, linearly transforming the original gray-level range to the full range of 0 to 255. This achieves local contrast enhancement on a per-sub-block basis. Optionally, the image after contrast stretching is subjected to edge enhancement processing based on gradient magnitude. The gradient components in the horizontal and vertical directions are calculated, and convolution is performed using the Sobel operator. The formula for calculating the gradient magnitude G is:
[0084]
[0085] in: Represents the gradient in the horizontal direction. Representing the vertical gradient, the calculated gradient magnitude is multiplied by an enhancement coefficient and added to the original image pixel value to highlight the grayscale transition boundaries between material particles and the background, as well as between particles. In practice, adaptive binarization segmentation is performed on the edge-enhanced image, defining a sliding window of 15×15 pixels. For each pixel in the image, the mean grayscale value of all pixels within the sliding window centered on it is calculated. and standard deviation Threshold for adaptive binarization segmentation The calculation is based on the dynamic calculation of the mean and variance of gray levels in local image regions. The calculation formula is as follows: ,in It is a preset constant parameter, which can be understood as follows: if the gray value of a pixel is greater than or equal to a threshold... If the value is true, the point is output as the foreground; otherwise, it is output as the background. In some embodiments, the binarized segmentation result is processed by morphological opening operation, which is a combination of erosion and dilation operations. A circular structuring element with a radius of 2 pixels is used to first erode the binary image to eliminate isolated bright spots and small burrs caused by noise in the image. Then, the erosion result is dilated to restore the shape of the main part of the particle and form the final enhanced material surface feature image.
[0086] In one embodiment of the present invention, the enhanced material surface feature image is subjected to particle region segmentation processing based on edge information to extract multiple independent particle contour information. (See also...) Figure 3 Edge detection is performed on the enhanced material surface feature image using operators that respond to edges in different directions, such as the Sobel or Canny operators. The detection results generate a set of edge pixels for the material particles. Edge connection and contour tracking are then performed on the obtained edge pixel set. This process connects spatially adjacent edge pixels belonging to the same closed contour and organizes them into an ordered sequence of contour points, forming a preliminary contour set. Polygon approximation processing is then applied to each contour point sequence in the preliminary contour set. This process uses an algorithm to approximate the geometry of the original contour with a smaller number of vertices, reducing the complexity of the contour data. Contours with too few vertices or too small an area after polygon approximation are filtered out; these filtered contours correspond to image noise or non-particle impurities. The filtered contours are then marked as independent candidate particle contours, and a unique contour identifier is assigned to each contour, thus forming multiple independent particle contour information.
[0087] In the specific implementation, the enhanced material surface feature image undergoes particle region segmentation processing based on edge information to extract multiple independent particle contour information. The enhanced material surface feature image is a binary image, where foreground white pixels represent possible particle regions and background black pixels represent non-particle regions. In the specific implementation, edge detection is performed on the enhanced material surface feature image using the Sobel operator, which responds to edges in different directions. The Sobel operator includes a horizontal template. and vertical template The two templates, each 3×3 pixels in size, are slid across the enhanced material surface feature image and convolved. The gradient magnitude of each pixel is calculated, and a gradient magnitude threshold is set. Pixels with gradient magnitudes greater than this threshold are marked as edge pixels. All marked edge pixels form an edge pixel set. In some embodiments, edge connection and contour tracking are performed on the edge pixel set. The algorithm starts from an unvisited edge pixel, searches for adjacent edge pixels in its eight neighborhoods, and connects the found adjacent points to the current contour point sequence. This process is iterated until the starting point is returned or no new connection point is found, thus connecting edge pixels belonging to the same closed contour into an ordered contour point sequence. All found contour point sequences form a preliminary contour set. In specific implementations, polygon approximation processing is performed on each contour point sequence in the preliminary contour set using the Douglas-Peucker algorithm, and a distance tolerance parameter is set for each contour point sequence. The algorithm retains the start and end points of the contour sequence as the vertices of the initial approximating polygon, and calculates the maximum perpendicular distance from all other points in the sequence to the edges of the current approximating polygon. ,if Greater than or equal to If the maximum distance is found, the point that generates the maximum distance is added as a new vertex, and this process is recursively repeated for the segmented subsequences until the distance from all points to the corresponding polygon edges is less than 1. The final set of vertices is used to describe the geometry of the original contour. Optionally, contours with too few vertices or too small area after polygon approximation are filtered out. The lower limit for the number of vertices is set to 5, and the lower limit for the area is set to 10 pixels. The number of vertices contained in each contour after polygon approximation is calculated, and the number of pixels contained in each contour is calculated as the contour area. Contours with fewer than 5 vertices or a contour area of less than 10 pixels are deleted from the initial contour set. These filtered contours correspond to image noise or non-grainy impurities. In some embodiments, the filtered contours are marked as independent candidate grainy contours. A unique integer contour identifier is assigned to each retained contour. The contour identifier starts from 1 and increments sequentially. All contours with identifiers constitute multiple independent grainy contour information. It can be understood that this grainy contour information is stored in the form of a data list. Each item in the list contains a contour identifier and its corresponding ordered sequence of contour point coordinates for subsequent processing.
[0088] In one embodiment of the present invention, the improved connected component analysis algorithm implements specific steps for constructing particle pseudo-boundaries based on the particle edge curvature variation characteristics and local gray-level minimum value distribution characteristics. For the input particle contour information, the curvature value at each pixel on the contour is calculated, forming a contour curvature distribution curve. In the contour curvature distribution curve, points with positive curvature and values greater than a preset positive curvature threshold are identified and marked as convex points; simultaneously, points with negative curvature and absolute values greater than a preset negative curvature threshold are identified and marked as concave points; convex and concave points together constitute a potential set of particle contact points. In the enhanced material surface feature image, the image regions corresponding to the potential set of particle contact points are located, and gray-level minimum points are searched within these image regions. In the potential set of particle contact points, candidate points containing gray-level minimum points within a preset neighborhood are further selected, and these points are used as effective particle separation seed points. Centered on each effective particle separation seed point, a virtual segmentation line is constructed into the particle adhesion region based on the edge orientation and gray-level gradient direction of its vicinity. The endpoint of the virtual segmentation line is either an effective particle separation seed point on the other side or the particle edge on the other side. At each effective particle separation seed point, the tangent direction of the original particle contour at that point is calculated. In the enhanced material surface feature image, the gray-level gradient direction at each effective particle separation seed point is calculated. The calculated tangent direction and gray-level gradient direction are weighted and synthesized to obtain the initial extension direction of the virtual segmentation line at the seed point. Along this initial extension direction, the search path points are iteratively extended into the adhesion region with a fixed step size. In each step, the extension direction of the next step is adjusted according to the gray-level distribution in the neighborhood of the current path point, so that the extension path tends to advance along the gray-level valley line. When the extension path encounters another effective particle separation seed point or intersects with another determined particle contour, the extension stops, and all the searched path points are connected into a continuous curve as the final virtual segmentation line. All the constructed virtual segmentation lines and the original particle contour together constitute a new, separated closed particle contour.
[0089] In practical implementation, the improved connected component analysis algorithm constructs particle pseudo-boundaries based on the characteristics of particle edge curvature variation and local gray-level minimum distribution. The particle contour information input to the improved connected component analysis algorithm contains a series of ordered contour point coordinate sequences. For each contour point sequence, the curvature value at each pixel on the contour is calculated. The contour point sequence consists of pixel coordinates. Composition, in which It is the index of the point in the sequence. In specific implementation, the discrete curvature is calculated using the adjacent point vector method for contour points. Its forward point and backward point Calculate vector and ,point curvature value at Estimate using the following formula:
[0090]
[0091] in: It is a vector with vector The angle between them and These are the magnitudes of the vectors. After calculating the curvature values for all contour points, a contour curvature distribution curve is formed. In some embodiments, convex points with positive curvature and values greater than the positive curvature threshold, and concave points with negative curvature and absolute values greater than the negative curvature threshold are identified in the contour curvature distribution curve. The positive curvature threshold is set to 0.15, and the negative curvature threshold is set to -0.15. The convex and concave points together constitute a set of potential particle contact points. Refer to Table 1, which shows the curvature values and judgment results of some points extracted from a contour sequence.
[0092] Table 1: Contour Point Curvature Calculation and Feature Point Recognition Table
[0093]
[0094] In specific implementation, the image region corresponding to the set of potential particle contact points is located in the enhanced material surface feature image. The image region is defined as a square neighborhood with a side length of 15 pixels, centered on each potential particle contact point. Within these image regions, a minimum grayscale value is searched. The search method involves traversing all pixels within each neighborhood to find the pixel with the minimum grayscale value. Optionally, candidate points containing a minimum grayscale value within a preset neighborhood (radius 5 pixels) are selected from the set of potential particle contact points. If the Euclidean distance between a potential particle contact point and its nearest minimum grayscale value is less than or equal to 5 pixels, the point is marked as valid. Particle separation seed points, as understood, are the starting points for constructing virtual segmentation lines. In some embodiments, a virtual segmentation line is constructed into the particle adhesion region centered on each effective particle separation seed point, based on the edge direction and gray-level gradient direction of its vicinity. At each effective particle separation seed point, the tangent direction of the original particle contour at that point is calculated. The tangent direction is obtained by calculating the coordinate difference between adjacent contour points before and after the seed point. In the enhanced material surface feature image, the gray-level gradient direction at each effective particle separation seed point is calculated. The gray-level gradient direction is calculated using the Sobel operator to determine the horizontal gradient at that point. and vertical gradient Then by In practice, the tangent direction and the gray-level gradient direction are weighted and synthesized to obtain the initial extension direction of the virtual segmentation line at the seed point. The weighting coefficients are set as the weights of the tangent direction. Gray gradient direction weights Synthesis direction :
[0095]
[0096] in: It is the angle of the tangent direction. It is the grayscale gradient direction angle, which is optional. It iteratively extends the search path points into the adhesion region along the initial extension direction with a fixed step size. The fixed step size is set to 2 pixels. In each extension step, the extension direction of the next step is adjusted according to the grayscale distribution in the neighborhood of the current path point. The neighborhood size is 3×3 pixels. The direction with the smallest grayscale change in the neighborhood is used as the adjustment direction, so that the extension path tends to move along the grayscale valley line. When the extension path encounters another valid particle separation seed point or intersects with another determined particle contour, the extension stops and all the searched path points are connected into a continuous curve as the final virtual segmentation line. It can be understood that all the constructed virtual segmentation lines together with the original particle contour constitute a new closed contour of the separated particles.
[0097] In one embodiment of the present invention, based on the separated particles, the projected geometric features of each particle are calculated, and the projected geometric features are compared with a preset particle size classification threshold range to complete the particle size classification determination. For each independent particle closed contour separated by the improved connected component analysis algorithm, the total number of pixels contained within its contour is calculated, which is the projected area of the independent particle. The perimeter of each independent particle closed contour is calculated, which is the sum of the Euclidean distances between all adjacent pixels on the contour. Based on the projected area, the diameter of a circle with the same projected area is calculated, and this diameter is used as the equivalent diameter of the corresponding particle. Based on the projected area and perimeter, the shape factor of the particle is calculated, which is the ratio of the square of the perimeter to the product of four times the projected area and pi. The projected area, perimeter, equivalent diameter, and shape factor are combined to form the projected geometric features describing the morphology of a single particle. The particle size classification determination requires the pre-setting of multiple consecutive particle size levels, each level corresponding to a threshold range for the equivalent diameter. The equivalent diameter calculated for the current particle is read. The equivalent diameter of the current particle is compared one by one with the threshold ranges of equivalent diameter values for all preset particle size levels. The threshold range of equivalent diameter values for a specific particle size level that the current particle's equivalent diameter falls into is identified. The current particle is then marked as belonging to that specific particle size level. For particles with a shape factor greater than the shape anomaly threshold, regardless of their equivalent diameter size, they are marked as anomalous shape particles and excluded from the normal particle size level classification.
[0098] In practice, the projected geometric features of each separated particle are calculated, and these features are compared with a preset particle size classification threshold range to determine the particle size classification. The input consists of multiple independent closed contours separated by an improved connected component analysis algorithm. Each independent closed contour is represented by an ordered sequence of coordinate points. In practice, for each independent closed contour, the total number of pixels contained within its contour is calculated as the projected area of the independent particle. The calculation uses either the ray casting method or a seed fill algorithm to count the number of pixels completely inside the contour. In practice, the perimeter of the closed contour of each individual particle is calculated. The perimeter is the sum of the Euclidean distances between all adjacent pixels on the contour, and the contour point sequence is... ,in The formula for calculating the perimeter is:
[0099]
[0100] in: and It is a point The coordinates, in some embodiments, are based on the projected area. Calculate the diameter of the circle with the same projected area as the equivalent diameter of the corresponding particle. The formula is In specific implementation, based on the projected area and perimeter Calculate the shape factor of the particles Shape factor It is the ratio of the square of the perimeter to the product of four times the projected area and pi, calculated using the following formula: It is understandable that the projected area ,perimeter equivalent diameter and shape factor The combined projection geometric features describe the morphology of a single particle. In some embodiments, the particle size classification needs to pre-set multiple consecutive particle size levels, each of which corresponds to a threshold range of the equivalent diameter. See Table 2, which shows a preset particle size level and equivalent diameter threshold range.
[0101] Table 2: Preset Granularity Levels and Equivalent Diameter Threshold Ranges
[0102]
[0103] In practice, the equivalent diameter calculated for the current particle is read. The equivalent diameter of the current particle The comparison is performed one by one with the equivalent diameter values of all preset granularity levels, starting from Level 1 and proceeding sequentially. Does it satisfy the condition that "lower limit of the threshold interval ≤ "<Threshold range upper limit", optional, identifies the equivalent diameter of the current particle. The threshold range of the equivalent diameter at a specific particle size level, such as the value of a single particle. mm, after comparison, it falls within the Level 3 threshold range (10.0mm ≤ 12.5mm < 20.0mm). In specific implementation, the current particle is marked as belonging to the identified specific granularity level, and a "granularity level" field is added to each particle data record and filled with a level identifier, such as "Level 3". This can be understood as, for shape factors... Greater than the shape anomaly threshold Particles, regardless of their equivalent diameter Size, labeling them as anomalous shape particles, anomaly shape threshold. Set it to 2.5, and exclude these abnormally shaped particles from the normal particle size classification. The exclusion operation means that such particles will not be included in the subsequent particle size statistics.
[0104] In one embodiment of the present invention, the process includes calculating the percentage of particle count, converting the percentage into mass flow distribution data, and generating an online detection report. The process involves iterating through all particles within the current image field of view that have completed particle size level classification. The total number of particles belonging to each preset particle size level is accumulated. The total number of particles across all particle sizes is accumulated and used as the total number of particles detected within the image field of view. The total number of particles at each particle size level is divided by the total number of particles detected within the image field of view to obtain the percentage of particles at the corresponding particle size level. The percentages of particles at all particle size levels are combined to form the particle count percentage distribution vector for the current image frame. To convert the particle count percentage into continuous mass flow distribution data by combining the conveyor belt speed, the conveyor belt speed at the time of image acquisition and the material's bulk density need to be obtained. Based on the image acquisition field of view, the conveyor belt speed, and the time interval for processing a single frame image, the volumetric flow rate of the material represented by the single frame image is calculated. Assuming that the material at each particle size level has the same bulk density, the calculated volumetric flow rate is multiplied by the bulk density to obtain the total mass flow rate of the material. The total mass flow rate is proportionally allocated according to the particle quantity distribution vector at each particle size level in the current image frame, and the mass flow rate of each particle size level passing through the detection cross section per unit time is calculated. A time-series moving average filter is applied to the mass flow rates calculated for each particle size level across multiple consecutive images to obtain smooth and continuous mass flow rate distribution data. An online particle size distribution detection report is generated based on the mass flow rate distribution data, summarizing the mass flow rate distribution data within a fixed time interval. The average, maximum, minimum, and standard deviation of the mass flow rate at each particle size level within that period are calculated. The statistical data of the mass flow rate at each particle size level, along with the total mass flow rate data for that period, are filled into a preset report template. A timestamp, detection equipment identifier, and material batch information are added to the report template. The completed report template is generated as an electronic document in a specified format and stored or output as an online particle size distribution detection report.
[0105] In practice, the number of particles belonging to different granularity levels within the image's field of view is counted, and the proportion of particles at each granularity level is calculated. All particles within the current image's field of view that have completed granularity level classification are traversed, and the granularity level classification results are stored in a data list. Each record in the data list contains a particle identifier and a granularity level label. The total number of particles belonging to each preset granularity level is accumulated. The preset granularity levels are Level1, Level2, Level3, Level4, and Level5. The total number of particles across all granularity levels is taken as the total number of particles detected within the image's field of view. In practice, the total number of particles at each granularity level is divided by the total number of particles detected within the image's field of view. This yields the percentage of particles at the corresponding particle size level. The calculation formula is:
[0106]
[0107] in: It refers to the number of particles belonging to a specific granularity level. In essence, it combines the percentage of particles at all granularity levels to form the granularity level particle quantity distribution vector for the current image frame. ,vector The form is In some embodiments, converting the particle quantity percentage into continuous mass flow distribution data by combining the conveyor belt speed requires obtaining the conveyor belt speed at the time of image acquisition. and the bulk density of the material running speed The bulk density is measured in real time by an encoder installed on the conveyor belt. These are inherent physical property parameters of the material. In specific implementation, they are determined based on the field of view area acquired by the image acquisition. Running speed and the time interval for processing a single frame of image Calculate the volume of material represented by a single frame image. The calculation formula is: Field of view Time interval obtained through camera calibration It is the fixed time difference between two consecutive camera exposures, assuming that materials of all particle sizes have the same bulk density. , material volume Multiply by bulk density The material mass corresponding to a single frame image is obtained. ,Right now In practical implementation, the material quality corresponding to a single frame image is... According to the particle number distribution vector at the current image frame granularity level Perform proportional allocation and calculate the material mass corresponding to each particle size level. The calculation relationship is as follows ,in Represents a granularity level index. It is a vector The corresponding percentage value can be optionally processed by performing a time-series moving average filtering on the material mass corresponding to each particle size level calculated from multiple consecutive frames of images. The window size of the moving average is set to 10 frames, and the value is applied to each particle size level. Take the quality values calculated from the current frame and the previous 9 frames. Calculate the arithmetic mean as the smoothed quality at the current time. Then based on frame rate ( Convert quality data into quality flow rate and calculate the quality flow rate per unit time for each granularity level. This yields smooth and continuous mass flow rate distribution data. It can be understood that an online granularity distribution detection report is generated based on this mass flow rate distribution data at fixed time intervals. The mass flow rate distribution data is summarized over a fixed period of time. The timeframe is set to 300 seconds; in practice, the calculation period is... Average mass flow rate of each particle size class within Maximum value Minimum value and standard deviation Statistical data of mass flow rate at each particle size level and cycle The total mass flow rate data is filled into a preset report template. The report template is a spreadsheet format containing data fields. In some embodiments, a timestamp, detection device identifier, and material batch information are added to the report template. The timestamp is the time when the report is generated, the detection device identifier is the unique number of the camera, and the material batch information comes from the upstream production system. The completed report template is generated as an electronic document in a specified format, which is PDF format, and is stored or output as an online particle size distribution detection report.
[0108] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A machine vision-based online image detection method for material particle size, characterized in that, include: Collect a sequence of grayscale images of the material flow on the conveyor belt to obtain an initial material surface image containing variations in brightness; The initial material surface image is subjected to background noise suppression processing to obtain an enhanced material surface feature image; The enhanced material surface feature image is subjected to particle region segmentation processing based on edge information to extract multiple independent particle contour information; Based on the particle contour information, an improved connected component analysis algorithm is used to separate adhered or overlapping particles in the image. This improved algorithm constructs pseudo-boundaries for particles based on particle edge curvature variation characteristics and local gray-level minimum distribution characteristics, including: For the particle contour information input from the improved connected component analysis algorithm, the curvature value at each pixel on the contour is calculated to form a contour curvature distribution curve. In the contour curvature distribution curve, convex points with positive curvature and a value greater than the positive curvature threshold, and concave points with negative curvature and an absolute value greater than the negative curvature threshold are identified. The convex points and the concave points together constitute a potential set of particle contact points. In the enhanced material surface feature image, locate the image region corresponding to the potential set of particle contact points, and search for the gray-level minimum point within the image region; In the set of potential particle contact points, candidate points that exist in a preset neighborhood and have the minimum gray value are selected as effective particle separation seed points. Centered on each effective particle separation seed point, a virtual dividing line is constructed into the particle adhesion area based on the edge direction and gray-scale gradient direction of its vicinity. The endpoint of the virtual dividing line is the effective particle separation seed point on the other side or the particle edge on the other side. All the constructed virtual dividing lines together with the original particle outline constitute a new, separated closed particle outline. Based on the separated particles, the projected geometric features of each particle are calculated, including the particle's projected area, projected perimeter, equivalent diameter, and shape factor. The projected geometric features are compared with a preset particle size classification threshold range to determine the particle size classification of each particle. The number of particles belonging to different particle size levels within the field of view of the image is counted, and the proportion of particles at each particle size level is calculated. Combined with the conveyor belt running speed, the particle quantity ratio is converted into continuous mass flow distribution data; An online particle size distribution detection report is generated based on the mass flow rate distribution data.
2. The online image detection method for material particle size based on machine vision according to claim 1, characterized in that, The initial material surface image is subjected to background noise suppression processing to obtain an enhanced material surface feature image, including: The initial material surface image is subjected to multi-scale Gaussian filtering to generate reference background images with different smoothness levels; The reference background image with the lowest gray value at the corresponding position is subtracted pixel by pixel from the initial material surface image to obtain a preliminary corrected image that removes the influence of uneven lighting. The preliminary corrected image is subjected to local contrast stretching processing, wherein the local contrast stretching processing calculates the gray-level histogram and performs equalization mapping on the image sub-blocks as units. The image after contrast stretching is subjected to gradient amplitude-based edge enhancement processing to highlight the gray-level transition boundaries between material particles and the background, as well as between particles. An adaptive binarization segmentation is performed on the image after edge enhancement processing. The threshold for the adaptive binarization segmentation is dynamically calculated based on the mean and variance of the gray levels in the local region of the image. Morphological opening operations are performed on the binarized segmentation results to eliminate isolated bright spots and fine burrs caused by noise in the image, forming the final enhanced material surface feature image.
3. The online image detection method for material particle size based on machine vision according to claim 1, characterized in that, The enhanced material surface feature image is subjected to particle region segmentation processing based on edge information to extract multiple independent particle contour information, including: Edge detection is performed on the enhanced material surface feature image to generate a set of edge pixels of material particles. The edge detection uses operators that respond to edges in different directions. Edge connection and contour tracking processing is performed on the set of edge pixels to connect edge pixels belonging to the same closed contour into an ordered sequence of contour points, forming a preliminary contour set. Each contour point sequence in the preliminary contour set is subjected to polygon approximation processing to approximate the geometry of the original contour with fewer vertices. Filter out contours that have too few vertices or too small area after polygon approximation processing, where the contours correspond to image noise or non-granular impurities. The filtered contours are marked as independent candidate particle contours and assigned a unique contour identifier to form the multiple independent particle contour information.
4. The online image detection method for material particle size based on machine vision according to claim 3, characterized in that, Centered on each effective particle separation seed point, a virtual dividing line is constructed into the particle adhesion region based on the nearby edge orientation and grayscale gradient direction, including: At the effective particle separation seed point, calculate the tangent direction of the original particle profile at the effective particle separation seed point; In the enhanced material surface feature image, the gray-level gradient direction at the effective particle separation seed point is calculated; The tangent direction and the gray-level gradient direction are weighted and synthesized to obtain the initial extension direction of the virtual segmentation line at the seed point. Along the initial extension direction, the search path points are iteratively extended into the adhesion region with a fixed step size. In each extension step, the extension direction of the next step is adjusted according to the gray distribution in the neighborhood of the current path point, so that the extension path tends to move along the gray valley line. When the extended path encounters another valid particle separation seed point, or intersects with another determined particle profile, the extension stops, and all the searched path points are connected into a continuous curve as the final virtual dividing line.
5. The online image detection method for material particle size based on machine vision according to claim 1, characterized in that, The calculation of the projected geometric features of each particle based on the separated particles includes: For each independent particle closed contour separated by the improved connected component analysis algorithm, the total number of pixels contained inside its contour is calculated as the projected area of the independent particle. Calculate the perimeter of the closed contour of each individual particle, where the perimeter is the sum of the Euclidean distances between all adjacent pixels on the contour; Based on the projected area, calculate the diameter of a circle with the same projected area, and use it as the equivalent diameter of the corresponding particle. The shape factor of the particle is calculated based on the projected area and the perimeter, whereby the shape factor is the ratio of the square of the perimeter to the product of four times the projected area and pi. The projected area, perimeter, equivalent diameter, and shape factor are combined to form a projected geometric feature describing the morphology of a single particle.
6. The online image detection method for material particle size based on machine vision according to claim 1, characterized in that, The projected geometric features are compared with a preset grain size classification threshold range to determine the grain size classification of each particle, including: Multiple consecutive granularity levels are pre-defined, and each level corresponds to a threshold range of the equivalent diameter value. The equivalent diameter calculated for the current particle is read. The equivalent diameter of the current particle is compared one by one with the threshold range of the equivalent diameter of all preset particle size levels. Identify the threshold range of the equivalent diameter value at a specific particle size level into which the current particle's equivalent diameter falls; Mark the current particle as belonging to the specific particle size level; For particles whose shape factor is greater than the shape anomaly threshold, regardless of their equivalent diameter, they are marked as abnormal shape particles and excluded from the normal particle size classification.
7. The online image detection method for material particle size based on machine vision according to claim 6, characterized in that, The statistical image field of view includes the number of particles belonging to different grain size levels, and the calculation of the proportion of particles at each grain size level, including: Traverse all particles within the current image field of view that have completed the granularity level attribution determination; The total number of particles belonging to each of the preset particle size levels; The total number of particles at all granularity levels is accumulated as the total number of particles detected within the image's field of view; Divide the total number of particles at each granularity level by the total number of particles detected within the image field of view to obtain the percentage of particles at the corresponding granularity level. Combine the percentage of particles at all granularity levels to form a granularity level particle quantity distribution vector for the current image frame.
8. The online image detection method for material particle size based on machine vision according to claim 1, characterized in that, The process of converting the particle quantity percentage into continuous mass flow distribution data by combining the conveyor belt operating speed includes: The speed of the conveyor belt and the bulk density of the material are obtained at the moment of image acquisition. The material volume flow rate represented by a single frame image is calculated based on the field of view area of the image acquisition, the running speed, and the time interval of single frame image processing. Assuming that materials of all particle size classes have the same bulk density, the total mass flow rate of the material is obtained by multiplying the volumetric flow rate of the material by the bulk density. The total mass flow rate is proportionally allocated according to the particle number distribution vector of the current image frame at each particle size level, and the mass flow rate of each particle size level passing through the detection section per unit time is calculated. The mass flow rates at each granularity level calculated from multiple consecutive frames of images are subjected to time-series moving average filtering to obtain smooth and continuous mass flow rate distribution data.
9. The online image detection method for material particle size based on machine vision according to claim 8, characterized in that, Based on the mass flow rate distribution data, an online particle size distribution detection report is generated, including: The mass flow distribution data within a fixed time interval is summarized. Calculate the average, maximum, minimum, and standard deviation of the mass flow rate for each particle size level within the cycle; Fill the statistical data of mass flow rate at each particle size level, as well as the total mass flow rate data within the cycle, into the preset report template; Add timestamps, testing equipment identification, and material batch information to the report template; The completed report template is generated as an electronic document in the specified format, which is then stored or output as the online detection report for the granularity distribution.