A magnesium ore particle size detection method and system based on image processing
Through image preprocessing and watershed algorithm combined with two-dimensional directional Gaussian nuclear convolution and Hough linear detection, the problem of oversegment of magnesium ore is solved, and high-precision particle size detection is achieved, which is suitable for industrial automation analysis.
Patent Information
- Application Number
- CN202510857604.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-06-25
AI Technical Summary
Traditional magnesium ore detection methods are inefficient and susceptible to environmental and human factors. The watershed algorithm is prone to oversegment when processing ore images containing cracks or cracks, affecting the accuracy of particle size detection.
Image preprocessing and watershed algorithm combined with two-dimensional directional Gaussian nuclear convolution and Hough line detection are used to set the cleavage direction, and the correlation between the crack candidate line and the segmentation line and the grayscale characteristic value judgment are combined, and the particle size data is calculated.
It improves the accuracy and reliability of magnesium ore particle size detection and is suitable for automated analysis in industrial scenarios.
Smart Images

Figure CN120374617B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method and system for detecting the particle size of magnesium ore based on image processing. Background Art
[0002] As a key industrial raw material, magnesium ore plays a critical role in numerous fields, including metallurgy, chemicals, and building materials. It not only possesses significant economic value, but its environmental impact during use has also attracted considerable attention. In industrial production, the uneven distribution of magnesium ore particle size, shape, and physical properties presents numerous challenges in its detection. Particle size directly impacts ore processing efficiency and product quality, while shape and physical properties influence its compatibility with subsequent process flows. Therefore, accurate detection of magnesium ore characteristics is crucial.
[0003] Traditional magnesium ore testing methods rely primarily on physical sampling and laboratory analysis, which consumes significant manpower, material resources, and time, resulting in extremely low efficiency. Furthermore, test results are easily affected by environmental factors and operator subjective factors, making it difficult to ensure accuracy and consistency.
[0004] In recent years, with the rapid development of computer vision technology, image processing-based detection methods have emerged as a mainstream technology in the field of ore detection. Among them, the watershed segmentation algorithm, with its excellent ability to capture image boundaries, has become an important method for separating magnesium ore from background images.
[0005] However, in the actual application of magnesium ore particle size detection, some magnesium ores may contain cracks or fissures. When using the watershed algorithm to process such ore images, the grayscale changes at the cracks or fissures are mistakenly interpreted as object boundaries by the algorithm, leading to over-segmentation. Over-segmentation can lead to errors in ore particle size statistics, causing originally larger ore particles to be incorrectly divided into multiple smaller particles, seriously affecting the accuracy of magnesium ore particle size detection. Summary of the Invention
[0006] In order to solve the above-mentioned technical problem of over-segmentation in magnesium ore particle size detection, the present invention provides solutions in the following aspects.
[0007] In a first aspect, the present invention provides a method for detecting the particle size of magnesium ore based on image processing, the method comprising the steps of:
[0008] The invention provides a method for collecting a magnesium ore image and preprocessing it to obtain a grayscale image; processing the grayscale image using a watershed algorithm to obtain an initial segmented image; the initial segmented image includes multiple segmentation lines and multiple segmentation areas; setting multiple cleavage directions of the magnesium ore, constructing a two-dimensional directional Gaussian kernel for each cleavage direction, and convolving the initial segmented image using the two-dimensional directional Gaussian kernel to obtain a convolved segmented image; performing line detection on the convolved segmented image to obtain a number of crack candidate lines; when the crack candidate line is positionally associated with any segmentation line, calculating the grayscale feature values of two segmentation areas adjacent to the segmentation line, and when the grayscale feature values meet a merging condition, marking the two segmentation areas as areas to be merged; calculating the grayscale difference of each area to be merged in the convolved segmented image one by one, and merging the two segmentation areas contained therein when the grayscale of the area to be merged is consistent to obtain a target segmented image; and calculating the particle size data of the magnesium ore based on the target segmented image according to the geometric characteristics of the magnesium ore.
[0009] The present invention obtains a magnesium ore grayscale image through preprocessing and segments it through a watershed algorithm, laying the foundation for subsequent processing. Setting the cleavage direction to construct a directional Gaussian kernel convolution can enhance the edge of the cleavage direction, suppress noise, and improve the pertinence of crack detection. Hough line detection combines the cleavage direction with the gradient threshold to accurately identify the candidate crack line and reduce false detection. The area to be merged is determined by associating the candidate crack line with the segmentation line and judging the grayscale value to avoid misjudging the cleavage cracks in the same particle as the boundary. After calculating the boundary smoothness, the area is merged to make the segmentation more consistent with the actual particle morphology. Finally, the particle size data is calculated based on the merged area, which improves the accuracy and reliability of magnesium ore particle size detection and is suitable for automated particle size analysis in industrial scenarios.
[0010] Optionally, the two-dimensional directional Gaussian kernel satisfies the relationship: ;in, It is The two-dimensional directional Gaussian kernel function of the cleavage direction is calculated at the pixel point The output value at and is the Gaussian kernel in Axis and The standard deviation in the axial direction, It is The angle corresponding to the cleavage direction, is the Gaussian kernel in the The scale parameter in the horizontal direction of the cleavage direction, is the Gaussian kernel in the The scale parameter in the direction perpendicular to the cleavage direction, and is the position value of the pixel point on the coordinate axis, is a natural exponential function.
[0011] The present invention introduces the cleavage direction angle and scale parameters and , which can enhance the edge information of specific cleavage directions and suppress vertical interference. and The kernel function morphology can be flexibly adjusted. After convolution processing with a two-dimensional directional Gaussian kernel function, key features such as cleavage cracks can be effectively highlighted, the impact of noise can be reduced, and high-quality image data can be provided for subsequent Hough line detection to accurately identify crack candidate lines, thereby improving the accuracy and reliability of particle size detection.
[0012] Optionally, the convolved segmented image is subjected to line detection to obtain a number of crack candidate lines, including: processing the convolved segmented image using line detection to obtain a plurality of cleavage lines; calculating the angle and gradient of the cleavage lines, and when the angle of any of the cleavage lines satisfies a preset error angle of the cleavage direction and its gradient is greater than a preset gradient threshold, marking the cleavage line as a crack candidate line.
[0013] This method uses Hough line detection to process the convolved segmented image and combines the cleavage direction angle and gradient to screen candidate crack lines. A preset error angle is used to match the cleavage characteristics of magnesite, eliminating interference from non-cleavage directions. A gradient threshold distinguishes between true and false edges, reducing false detections. These two methods work together to improve crack detection accuracy and robustness, providing reliable crack information for subsequent particle size analysis and enhancing the accuracy of magnesium ore particle size detection.
[0014] Optionally, the crack candidate line is positionally associated with any dividing line, including: the crack candidate line has the same position or direction as any dividing line, the same position means that the crack candidate line partially overlaps or completely overlaps, and the same direction means that the crack candidate line and the dividing line are parallel.
[0015] Optionally, the grayscale feature values of two adjacent segmentation areas of the segmentation line satisfy the relationship: ;in, It is The grayscale feature values of the two segmentation areas adjacent to the segmentation line, It is Pixels on the dividing line The grayscale variance of the neighborhood window, is the grayscale variance of all pixels in the segmented image, It is The similarity of the edge direction of the pixels in the two segmentation areas adjacent to the segmentation line, is the standard normalization function.
[0016] This method comprehensively considers grayscale variance and edge direction similarity. By comparing the grayscale variance of a neighborhood window with the maximum grayscale variance and considering edge direction similarity, it effectively characterizes the differences between segmented regions. Accurately measuring the grayscale characteristics of adjacent regions provides a reliable basis for determining whether to merge regions, avoiding incorrect segmentation or merging, and improving the accuracy and reliability of granularity detection results.
[0017] Optionally, the The calculation of the similarity of the edge direction of the pixels in the two segmentation areas adjacent to the segmentation line includes: calculating the The method comprises the following steps: determining the gradient directions of the pixels in two adjacent segmentation areas along a segmentation line; quantizing the gradient directions of the pixels in the two segmentation areas respectively; and calculating the similarity of the quantized histograms of the two segmentation areas.
[0018] Optionally, calculating the grayscale difference of each of the areas to be merged in the segmented image after convolution includes: calculating the curvature of all three consecutive pixel points on the boundary of the area to be merged one by one, and calculating the standard deviation of the curvature, which is recorded as the grayscale difference of the area to be merged.
[0019] This method measures smoothness by calculating the curvature and standard deviation of three consecutive points along the boundary of the region to be merged. Comparing the curvature standard deviation with a preset threshold accurately determines the smoothness of the boundary, avoiding mis-mergers or missed merges. This ensures that the merged region more closely matches the actual particle morphology, providing a reliable basis for accurately calculating magnesium ore particle size data and improving the accuracy and reliability of particle size detection.
[0020] Optionally, the calculating the particle size data of the magnesium ore includes: obtaining the perimeter and projected area of the magnesium ore in the target segmented image; and calculating the particle size of the magnesium ore using Kemeny's empirical formula, which is recorded as the particle size data of the magnesium ore.
[0021] Optionally, the line detection is achieved using Hough line detection technology.
[0022] In a second aspect, the present invention provides a magnesium ore particle size detection system based on image processing. The magnesium ore particle size detection system includes a memory and a processor. The memory stores computer program instructions. When the computer program instructions are executed by the processor, a magnesium ore particle size detection method based on image processing according to the first aspect of the present invention is implemented.
[0023] By adopting the above technical solution, a magnesium ore particle size detection method based on image processing according to the first aspect of the present invention is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.
[0024] Beneficial effects of the present invention: The present invention realizes high-precision detection through multi-step collaborative optimization, pre-processes magnesium ore images, performs watershed segmentation, uses cleavage directions to construct directional Gaussian kernels to enhance edges and suppress noise, and uses straight line detection combined with cleavage direction angle constraints and gradient thresholds to accurately identify valid crack candidate lines and reduce non-cleavage direction interference and false detection; through the positional association between crack candidate lines and segmentation lines, the grayscale value differences of adjacent regions, and the edge direction similarity analysis, the areas to be merged are judged to avoid misjudging cleavage cracks within the same particle as boundaries; finally, the particle size of the magnesium ore is calculated. The present invention fully combines the crystal structure characteristics of the ore, effectively improves the accuracy of particle segmentation and morphological fit, significantly improves the accuracy and reliability of particle size detection, and is suitable for automated particle size analysis in industrial scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A flow chart of a method for detecting magnesium ore particle size based on image processing provided by an embodiment of the present invention;
[0026] Figure 2 This is a structural block diagram of a magnesium ore particle size detection system based on image processing provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The first aspect of the embodiment of the present invention provides a method for detecting the particle size of magnesium ore based on image processing, such as Figure 1 As shown, the method includes steps S100 to S700:
[0028] Step S100: collecting a magnesium ore image and preprocessing it to obtain a grayscale image.
[0029] It should be noted that magnesium ore images are typically captured using industrial cameras. These images often contain multiple pieces of magnesium ore, often located adjacent to each other. Furthermore, to reduce the computational complexity of subsequent calculations, grayscale processing is often performed on the images to simplify their color information.
[0030] Specifically, the piled magnesium ore is transported to the testing table by a vibrating feeder, and the particles are flattened into a single layer through vibration. An industrial camera is installed on the testing table to obtain magnesium ore images in real time and simultaneously perform denoising and grayscale preprocessing.
[0031] In addition, the grayscale processing and denoising processing technologies are relatively mature and belong to the existing technology, so they are not elaborated here.
[0032] At this point, a grayscale image of the magnesium ore is obtained.
[0033] Step S200: Process the grayscale image using a watershed algorithm to obtain an initial segmented image.
[0034] It should be noted that the watershed algorithm is an image segmentation technique based on topological theory. Its principle is similar to the concept of watersheds in geography. Magnesium ore particles often have irregular shapes due to the crushing process, and are prone to overlap and adhesion when piled. The watershed algorithm simulates the process of water accumulation in terrain and treats image gradients as terrain height. It can effectively identify valleys between particles, or low-gradient areas, and thus segment particles with blurred boundaries or slight overlap. The watershed algorithm is an existing technology and will not be discussed in detail here.
[0035] Specifically, after processing a grayscale image of magnesium ore using the watershed algorithm, multiple segmented regions are obtained. Each segmented region theoretically corresponds to a magnesium ore particle, and the boundaries of the segmented regions correspond to the boundaries of multiple magnesium ore particles, which are recorded as segmentation lines. After processing an image containing multiple magnesium ore particles, an image containing multiple segmented regions and multiple segmentation lines is obtained, which is recorded as the initial segmented image.
[0036] At this point, an initial segmented image containing multiple segmentation regions and multiple segmentation lines is obtained.
[0037] Step S300: setting multiple cleavage directions of the magnesium ore, constructing a two-dimensional directional Gaussian kernel for each cleavage direction, and convolving the initial segmented image using the two-dimensional directional Gaussian kernel to obtain a segmented image after convolution.
[0038] It should be noted that in actual applications, when using the watershed algorithm to process ore images containing cracks or fissures, the grayscale changes at the cracks or fissures may be misinterpreted by the algorithm as object boundaries, leading to over-segmentation. In other words, two adjacent segmented areas obtained by the watershed algorithm may belong to the same magnesium ore particle.
[0039] Based on the above-mentioned over-segmentation problem, the present invention further optimizes the segmented area after watershed processing to obtain the real segmented area, namely the target segmented area.
[0040] Specifically, several cleavage directions are first set, and then the edges corresponding to the cleavage directions are enhanced through two-dimensional directional Gaussian kernel convolution to suppress the noise caused by non-cleavage directions.
[0041] For the setting of cleavage direction, taking magnesite as an example, its crystal belongs to the trigonal system and its shape is rhombohedron. The cracks on magnesite will show regular straight lines or 、 Angle distribution. Based on the characteristics of the above-mentioned magnesite, three cleavage directions are set, and the cleavage directions are 、 、 In actual use, the cleavage directions may be set according to the characteristics of the magnesium ore and are not limited to three.
[0042] It should be noted that for the two-dimensional directional Gaussian kernel, this invention improves the existing directional Gaussian kernel based on the principle of the Gaussian kernel function and combines the requirements of directional sensitivity. The improved formula is designed to match the cleavage direction characteristics of magnesium ore and enhance edges in specific directions.
[0043] Preferably, the two-dimensional directed Gaussian kernel function satisfies the expression:
[0044] ;
[0045] in, It is The Gaussian kernel function of the cleavage direction is calculated at the pixel point The output value at and is the Gaussian kernel in Axis and The standard deviation in the axial direction, It is The angle corresponding to the cleavage direction, is the Gaussian kernel in the The scale parameter in the horizontal direction of the cleavage direction, is the Gaussian kernel in the The scale parameter in the direction perpendicular to the cleavage direction, and is the position value of the pixel point on the coordinate axis, is a natural exponential function.
[0046] In this formula, Represents pixel points In the The projection distance in the cleavage direction is the projection distance of the pixel points. When the pixel points are distributed along the cleavage direction, the smaller the projection distance is, the larger the value of the natural exponential function is, and the stronger the response of the kernel function is, which can enhance the edge in the cleavage direction. Represents pixel points In the The projection distance perpendicular to the cleavage direction is Adjust the vertical width. When , the Gaussian distribution in the vertical direction is wider, which means that the vertical noise is more strongly suppressed, thus highlighting the edge in the cleavage direction. This formula converts the distance in the cleavage direction and the vertical direction into a weight value. Points closer to the cleavage direction have higher weights and stronger responses after convolution. Conversely, points farther from the vertical direction have lower weights and weaker responses.
[0047] It should be noted that in this formula , increase The ratio can enhance the selectivity of the direction. The preset value in the present invention is , so that the present invention can effectively suppress the noise in the vertical direction while maintaining the response in the cleavage direction.
[0048] It's also important to note that the directional Gaussian convolution operation described above requires traversing all pixels in the initial segmented image. The resulting edge image is a single-channel image, with each pixel representing the convolution result in the direction with the strongest response among several cleavage directions. The entire image reflects the enhanced edge information at each location in the image along the cleavage direction. This step effectively highlights the edge features of the cleavage direction of magnesite, laying the foundation for subsequent cleavage line screening using the Hough transform and enabling more accurate identification of crack candidate lines.
[0049] At this point, the segmented image after convolution is obtained.
[0050] Step S400: Perform line detection on the convolved segmented image to obtain a number of crack candidate lines.
[0051] It should be noted that after convolution, multiple straight lines are generated. To identify crack candidate lines, line detection is required on the cleavage lines. This can be achieved using Hough line detection. Hough line detection is an image analysis technique based on a voting mechanism that detects straight line features in an image. Performing Hough line detection on the image after convolution with a directional Gaussian kernel can further improve the accuracy of crack detection. Hough line detection is an existing technology and will not be discussed in detail here.
[0052] After Hough line detection, multiple cleavage lines are detected in the image. Considering that some cleavage lines do not align with the cleavage direction, it is necessary to select lines that match the cleavage angle. These lines are selected as crack candidates, while lines that do not align with the cleavage direction are identified as true interparticle boundaries, enhancing the watershed algorithm's ability to identify cracks.
[0053] Specifically, the Hough line detection method is used on the segmented image after convolution to obtain several cleavage lines of the segmented image after convolution, and the gradient and angle of the cleavage line are calculated. When the gradient is greater than the preset threshold value, that is, 50, and when the angle detected by the Hough line is satisfy , the cleavage line is recorded as the crack candidate line. Regarding the setting of the angle error value, the present invention sets it to , in actual use, it can be set according to needs.
[0054] At this point, multiple crack candidate lines are obtained in the convolved segmented image.
[0055] Step S500: When the crack candidate line is associated with any segmentation line in position, the grayscale feature values of the two segmentation areas adjacent to the segmentation line are calculated. When the grayscale feature values meet the merging condition, the two segmentation areas are marked as areas to be merged.
[0056] It should be noted that the crack candidate lines obtained by the above screening do not necessarily correspond to the segmentation lines after watershed segmentation. Therefore, further screening is required to select several crack candidate lines that are positionally associated with the segmentation lines. After the screening is completed, the area to be merged is determined.
[0057] Specifically, crack candidate lines that partially overlap or completely overlap with the dividing line are screened out, or crack candidate lines that are parallel to the dividing line are screened out.
[0058] It should be noted that for the calculation of grayscale eigenvalues, the present invention considers grayscale variance and histogram similarity as key factors. Grayscale variance usually reflects the degree of discreteness of grayscale value changes in local areas of an image. If two adjacent segmented areas are inside the same piece of ore, the grayscale value changes are small and the variance is also small; while at the boundary of ore particles, the grayscale value changes are large and the variance is also large. Therefore, the grayscale variance can be used to determine whether two adjacent segmented areas belong to the same ore. Regarding the calculation of the similarity of histograms, the Bhattacharyya distance is taken as an example. The smaller the Bhattacharyya distance value, the higher the similarity of the two histograms, which means that the edge direction distributions in the two adjacent segmented areas are more similar; conversely, the larger the Bhattacharyya distance value, the greater the difference in edge direction distributions between the two adjacent segmented areas. In the case of over-segmentation, the center of gravity of two areas that originally belong to the same ore is close, and a high degree of similarity can be maintained.
[0059] Preferably, the grayscale eigenvalue satisfies the relationship:
[0060] ;
[0061] in, It is The grayscale feature values of the two segmentation areas adjacent to the segmentation line, It is Pixels on the dividing line The grayscale variance of the neighborhood window, is the maximum grayscale variance of the segmented image, Indicates the The similarity of the edge direction of the pixels in the two segmentation areas adjacent to the segmentation line, is the standard normalization function.
[0062] In this formula, It is used to distinguish over-segmentation boundaries from real particle boundaries. Over-segmentation boundaries, that is, the grayscale variance within the same piece of ore is small, and the possibility of merging needs to be retained; the variance of the real boundary is large, and merging needs to be suppressed.
[0063] According to the calculation method of the grayscale eigenvalue mentioned above, this value can be used to determine whether two adjacent segmented areas are the same ore, that is, whether they are areas to be merged.
[0064] Preferably, a merging threshold value, such as 0.8, may be set, and the calculated grayscale eigenvalue may be compared with the merging threshold value. When the grayscale eigenvalue is greater than the merging threshold value, the two segmented areas adjacent to the segmentation line are marked as areas to be merged.
[0065] The calculation formula of the grayscale eigenvalue is explained above. Next, the calculation of the similarity and grayscale variance in the grayscale eigenvalue calculation formula is explained respectively.
[0066] The calculation of similarity involves first calculating the gradient direction of pixels within two adjacent segmented regions. The gradient direction of a pixel refers to the direction in the image where the grayscale value around that pixel changes most dramatically. This can be calculated using the Sobel operator, Prewitt operator, or Scharr operator known in the art. The above methods for calculating the gradient direction of pixels are all known techniques and will not be elaborated upon here. Next, the gradient directions of the pixels in the two segmented regions are quantized. Quantizing the gradient direction typically involves discretizing continuous gradient direction angle values into a finite number of direction intervals. This facilitates subsequent statistics and feature extraction. Gradient direction quantization typically includes uniform quantization and non-uniform quantization. In practice, the quantization interval and quantization rule can be selected based on specific needs. Finally, the similarity of the quantized histograms of the two segmented regions is calculated. The histogram similarity can be calculated using Bhattacharyya distance, histogram intersection, and chi-square test.
[0067] Preferably, the calculation of similarity is quantified into four intervals as an example. The four intervals are: 、 、 、 , the specific quantification rules are:
[0068] ;
[0069] in, is the quantized gradient direction, is the gradient direction, It is an absolute value.
[0070] After quantizing the gradient direction according to the above quantization interval and quantization rules, it is necessary to count the histograms corresponding to the quantized gradient directions , .
[0071] The similarity calculation of the histogram is performed using the Bhattacharyya distance as an example. The similarity satisfies the expression:
[0072] ;
[0073] in, Indicates the The similarity of the edge direction of the pixels in the two segmentation areas adjacent to the segmentation line, represents the number of bins in the histogram, express The histogram of the segmented area The value of the interval, that is, within the first segmentation area, is quantized to the The number of pixels in the edge direction, express The histogram of the segmented area The value of the interval, that is, within the second segmentation area, is quantized to the The number of pixels in the edge direction.
[0074] The smaller the Bhattacharyya distance calculated by this formula, the higher the similarity between the two histograms, meaning the more similar the edge direction distributions within the two segmented regions. Conversely, the larger the Bhattacharyya distance, the greater the difference in edge direction distributions between the two segmented regions. If the two sides of the dividing line should belong to the same magnesium ore particle, then the boundary of the real object should have one or more main and consistent edge directions, and the edge direction histograms should have relatively high similarity.
[0075] The calculation of grayscale variance can be achieved as follows: obtain the neighborhood window corresponding to any pixel on the segmentation line, calculate the grayscale variance of all pixels in the neighborhood window, and then take the mean of these grayscale variances to obtain the desired result. The size of the neighborhood window is , Set to greater than or equal to 3.
[0076] So far, several areas to be merged have been obtained.
[0077] Step S600 : Calculate the grayscale difference of each to-be-merged region in the segmented image after convolution one by one. When the grayscales of the to-be-merged region are consistent, merge the two segmented regions contained therein to obtain a target segmented image.
[0078] It should be noted that if the two segmented areas in the area to be merged belong to the same magnesium ore, the outline of the area to be merged should be relatively smooth and continuous, that is, the curvature changes relatively slowly. Therefore, the grayscale difference of the outline of the area to be merged can be calculated to evaluate whether the area to be merged really belongs to the same ore.
[0079] Specifically, for the area to be merged, the Canny edge detection algorithm is used to extract the edge contour, and the pixel point set on its contour is obtained clockwise. ; For three consecutive points on the contour , , , calculate its curvature . Calculate the curvature of all three consecutive points on the contour and calculate the standard deviation of the curvature. is the coordinate of the first pixel on the contour, is the number of pixels on the contour, The coordinates of the last pixel on the contour.
[0080] If the standard deviation is less than the curvature threshold, the contour of the region to be merged is considered complete, closed and smooth, and the region to be merged is merged; otherwise, the merging operation is not performed.
[0081] After all the areas to be merged are processed in the above manner, the optimization of the initial segmented image after watershed processing is completed, and the target segmented image is obtained.
[0082] Step S700: Based on the target segmented image, the particle size data of the magnesium ore is calculated according to the geometric features of the magnesium ore.
[0083] To elaborate, after the over-segmentation problem is solved, the accuracy of the ore particle size data calculated on this basis can be effectively guaranteed. Regarding the calculation of the particle size of the ore particles, the perimeter and projected area of the magnesium ore particles can be obtained first, and then the particle size of the magnesium ore particles can be calculated using Kemeny's empirical formula. The calculation of the perimeter and projected area and Kemeny's empirical formula are all existing technologies and will not be elaborated here.
[0084] Finally, it should be noted that the present invention is not limited to detecting the particle size of magnesium ore, but can also be used to detect other ores.
[0085] The second aspect of this embodiment provides a magnesium ore particle size detection system based on image processing, such as Figure 2 As shown, the magnesium ore particle size detection system includes a memory and a processor. The memory stores computer program instructions. When the computer program instructions are executed by the processor, a magnesium ore particle size detection method based on image processing according to the first aspect of the present invention is implemented.
[0086] The magnesium ore particle size detection system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface. The configuration and functions of these components are known in the art and will not be described in detail here.
[0087] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as resistive random access memory, dynamic random access memory, static random access memory, enhanced dynamic random access memory, high bandwidth memory, hybrid memory cube, etc., or any other medium that can be used to store the required information and can be accessed by an application, module, or both. Any such computer storage medium may be part of, accessible to, or connectable to the device.
[0088] The above are all preferred embodiments of the present invention, and are not intended to limit the scope of protection of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A magnesium ore particle size detection method based on image processing, characterized in that: Including steps: Collecting magnesium ore images and preprocessing them to obtain grayscale images; Processing the grayscale image using a watershed algorithm to obtain an initial segmented image; the initial segmented image includes multiple segmentation lines and multiple segmentation areas; Setting multiple cleavage directions of the magnesium ore, constructing a two-dimensional directional Gaussian kernel for each cleavage direction, and convolving the initial segmented image using the two-dimensional directional Gaussian kernel to obtain a convolved segmented image; The two-dimensional oriented Gaussian kernel satisfies the expression: , It is The two-dimensional directional Gaussian kernel function of the cleavage direction is calculated at the pixel point The output value at and is the Gaussian kernel in Axis and The standard deviation in the axial direction, It is The angle corresponding to the cleavage direction, is the Gaussian kernel in the The scale parameter in the horizontal direction of the cleavage direction, is the Gaussian kernel in the The scale parameter in the direction perpendicular to the cleavage direction, and is the position value of the pixel point on the coordinate axis, is a natural exponential function; Performing line detection on the convolved segmented image to obtain a number of crack candidate lines; When the crack candidate line is associated with any segmentation line in position, grayscale feature values of two segmentation areas adjacent to the segmentation line are calculated, and when the grayscale feature values meet the merging condition, the two segmentation areas are marked as areas to be merged; Calculating the grayscale difference of each of the to-be-merged regions in the convolved segmented image one by one, and merging the two segmented regions contained therein when the grayscales of the to-be-merged regions are consistent to obtain a target segmented image; Based on the target segmented image, the particle size data of the magnesium ore is calculated according to the geometric characteristics of the magnesium ore.
2. The method for detecting magnesium ore particle size based on image processing according to claim 1, characterized in that: The convolved segmented image is subjected to line detection to obtain a plurality of crack candidate lines, including: Processing the convolved segmented image using line detection to obtain a plurality of cleavage lines; The angle and gradient of the cleavage line are calculated, and when the angle of any cleavage line meets the preset error angle of the cleavage direction and its gradient is greater than a preset gradient threshold, the cleavage line is marked as a crack candidate line.
3. The method for detecting magnesium ore particle size based on image processing according to claim 1, characterized in that: The crack candidate line is associated with any dividing line in position, including: the crack candidate line has the same position or direction as any dividing line, the same position means that the crack candidate line partially overlaps or completely overlaps, and the same direction means that the crack candidate line and the dividing line are parallel.
4. The method for detecting magnesium ore particle size based on image processing according to claim 1, characterized in that: The grayscale eigenvalues of the two adjacent segmentation areas of the segmentation line satisfy the expression: ; in, It is The grayscale feature values of the two segmentation areas adjacent to the segmentation line, It is Pixels on the dividing line The grayscale variance of the neighborhood window, is the grayscale variance of all pixels in the segmented image, It is The similarity of the edge direction of the pixels in the two segmentation areas adjacent to the segmentation line, is the standard normalization function.
5. The method for detecting magnesium ore particle size based on image processing according to claim 4, characterized in that: The said The calculation of the similarity of the edge directions of the pixels in two adjacent segmentation areas includes: Calculate the The gradient direction of the pixel points in the two segmentation areas adjacent to the segmentation line; quantizing the gradient directions of the pixel points of the two segmented areas respectively; The similarity of the quantized histograms of the two segmented regions is calculated.
6. The method for detecting magnesium ore particle size based on image processing according to claim 1, characterized in that: The calculating the grayscale difference of each of the to-be-merged regions in the segmented image after the convolution includes: The curvatures of all three consecutive pixel points on the boundary of the region to be merged are calculated one by one, and the standard deviation of the curvatures is calculated and recorded as the grayscale difference of the region to be merged.
7. The method for detecting magnesium ore particle size based on image processing according to claim 1, characterized in that: The calculating the particle size data of the magnesium ore includes: Obtaining the perimeter and projected area of the magnesium ore in the target segmented image; The particle size of the magnesium ore is calculated using Kemeny's empirical formula, which is recorded as the particle size data of the magnesium ore.
8. The method for detecting magnesium ore particle size based on image processing according to claim 1, characterized in that: The straight line detection is achieved by using the Hough straight line detection technology.
9. A magnesium ore particle size detection system based on image processing, characterized in that: The magnesium ore particle size detection system includes a processor and a memory, wherein the memory stores computer program instructions. When the computer program instructions are executed by the processor, the magnesium ore particle size detection method based on image processing according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Welding seam image processing method based on machine vision
CN112529858A
Feed liquid atomization condition detection method based on image segmentation algorithm
CN116773520A