Online particle size analysis method based on image measurement
Through the online particle size analysis method based on image measurement, real-time image acquisition and analysis is performed using industrial cameras and OpenCV libraries, the problems of particle size detection in the prior art requiring manual participation, high sampling requirements, contact materials and non-online detection are solved, real-time particle size detection without manual participation, sampling, and contact materials are achieved, and the accuracy and efficiency of detection are improved.
Patent Information
- Application Number
- CN202510258893.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-06
AI Technical Summary
The existing particle size distribution analysis methods have the problems of manual participation, resulting in errors, high sampling requirements, needing contact with materials, and non-online detection, and unable to achieve automated judgment.
Using an online particle size analysis method based on image measurement, images are collected in real time through industrial cameras, and contour extraction and screening are used to calculate the particle size and particle size distribution, real-time detection without artificial participation, sampling, and contactless.
Real-time particle size detection without manual participation, no sampling, and no contact with materials is achieved, the accuracy and efficiency of detection are improved, and the automation and real-time problems of detection in the prior art are solved.
Smart Images

Figure CN120195065A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image measurement, and particularly relates to an online particle size analysis method based on image measurement. Background Art
[0002] Continuous pharmaceutical manufacturing is a new pharmaceutical technology that can produce high-quality drugs at a certain speed without interrupting the production process. In the future, continuous pharmaceutical manufacturing technology will continue to develop and become the mainstream technology in the pharmaceutical industry. It can improve production efficiency, reduce production costs, improve product quality, reduce environmental pollution, and make the pharmaceutical industry more competitive. One of the key links in realizing continuous pharmaceutical manufacturing is to automatically judge whether the drug meets the particle size distribution requirements.
[0003] Common particle size distribution analysis methods include microscopy, sieving method, laser particle size measurement method, etc. Microscopy can simultaneously observe the morphology of particles and directly measure the geometric size of particles. It is often used as a calibration or verification for other methods. The disadvantage is that in order to ensure the accuracy of statistical results, a large number of samples are required, and the labor cost is huge. The sieving method is suitable for loose samples. A set of sieves with different particle sizes is used to classify the particles. The weight of the sample is preferably 30 - 100 grams. The disadvantage is that the sieving of non-spherical particles is often inaccurate and there is a certain error. The laser particle size measurement method measures the light scattering effect caused by particles passing through a laser beam by a group of detectors. Using the principle that the diffraction angle of light is inversely proportional to the particle size, the size distribution of particles can be calculated. Although this method has high accuracy, the current technology is limited by the quality of available spatial filters, resulting in poor repeatability of results between different devices. Similar to sieving analysis, when the particle shape deviates from spherical, the results of this method will also be affected. In addition to the above-mentioned disadvantages of these methods, compared with the online particle size analysis method based on image measurement, they also have the following disadvantages: manual participation is required, which is prone to introducing errors; there are requirements for sampling, and the sampling effect will greatly affect the measurement results; contact with the material is required, and destructive testing of the material is carried out; non-online detection means cannot achieve automatic judgment. Summary of the Invention
[0004] Aiming at the deficiencies of the prior art, the present invention provides an online particle size analysis method based on image measurement. By analyzing the data of the images collected in real time without contact by an industrial camera through the equipment window, the information on the changes in the morphology and size of particles throughout the manufacturing process can be covered. This method does not require manual participation and sampling, avoiding the introduction of errors. The technical solution is as follows:
[0005] An online particle size analysis method based on image measurement, the specific steps are as follows:
[0006] 1) Data acquisition: Fix an industrial camera, lens, and light source in front of the transparent window of the drug production equipment, acquire pictures of the drug production process, and transmit them to the algorithm processor via cables for real-time display on the user interface after processing;
[0007] 2) Contour extraction: Use the function cv2.findContours() in the OpenCV library for contour extraction;
[0008] 3) Contour screening;
[0009] 4) Calculate the particle size of a single particle;
[0010] 5) Statistically analyze the particle size distribution results.
[0011] Preferably, the specific steps of the contour screening in step 3) are as follows:
[0012] (a) Calculate the fitting ellipse points of the contour points using the least squares principle:
[0013] The general equation of the ellipse is Ax 2 + Bxy + Cy 2 + Dx + Ey + 1 = 0. To make the ellipse equation the most accurate, all contour points P i (x i , y i ), i ∈ [1, N], where N is the number of contour points, should satisfy the ellipse equation as much as possible. Therefore, the function F = ∑(Ax i 2 + Bx i y i + Cy i 2 + Dx i + Ey i + 1) 2 should be 0. However, in actual fitting, the function F cannot be 0. Solve its minimum value according to the least squares method. Take the derivative of the function F to get:
[0014]
[0015]
[0016] When the above derivative is 0, the value of the function F is the smallest. For convenience of solution, write the above formula in matrix function form:
[0017]
[0018] Solve to obtain the parameters A, B, C, D, E of the general equation of the ellipse, and then convert the general equation of the ellipse into the standard equation of the ellipse for convenient subsequent calculation, a 2 , b2 The calculation formula is as follows:
[0019]
[0020] where a and b are the parameters of the standard equation of the fitted ellipse;
[0021] (b) Calculate the distance from the contour points inside the fitted ellipse points to the fitted ellipse points:
[0022] The fitted ellipse point P j (x j , y j ), j ∈ [1, M], where M is the number of fitted ellipse points. First, screen the contour points located inside the fitted ellipse. By judging whether the line segment connecting the contour point P i (x i , y i ) and the center of the fitted ellipse P o (x o , y o ) has an intersection with the fitted ellipse to determine whether the contour point is inside the fitted ellipse. Solve by simultaneously establishing the equations of the line segment and the fitted ellipse. If there is no solution, there is no intersection, and the contour point is inside the fitted ellipse. The simultaneous equations are as follows:
[0023]
[0024] Let the contour point located inside the fitted ellipse be P k (x k , y k ), k ∈ [1, P], where P is the number of contour points located inside the fitted ellipse. Calculate its shortest distance to the fitted ellipse points, and select the point with the largest distance. The calculation formula for the maximum distance is as follows:
[0025]
[0026] (c) Calculate the distance from this point to the symmetric contour point:
[0027] Let the contour point with the largest distance to the fitted ellipse point located inside the fitted ellipse be P d , with the subscript d. Then the calculation method for the subscript of the symmetric contour point of P d is as follows:
[0028] idx = d + int(0.4 × N), d + int(0.4 × N) + 1,..., d + int(0.6 × N)
[0029]
[0030] Where N is the number of contour points, and int(x) represents rounding x downwards.
[0031] Let the symmetric contour point be P l (x l , y l ), where l ∈ [1, Q], Q is the number of symmetric contour points, and the contour point P that is the farthest from the fitting ellipse among the contour points located inside the fitting ellipse d (x d , y d ) and the shortest distance between it and its symmetric contour point are calculated as follows:
[0032]
[0033] If the value of D2 is less than the set threshold, then the contour is determined to be the contour of an agglomerated particle and is removed.
[0034] Preferably, the method for calculating the particle size of a single particle in step 4) is as follows:
[0035] The calculation formula for the particle size d of the particle
[0036]
[0037] where a and b are the parameters of the standard equation of the fitting ellipse.
[0038] Preferably, the method for statistically analyzing the particle size distribution result in step 5) is:
[0039] The particle size distribution result uses D10, D50, and D90 as indicators. D10, D50, and D90 respectively represent the corresponding particle sizes when the cumulative volume ratio of the particles reaches 10%, 50%, and 90%. Before calculating D10, D50, and D90, calculate the volume of a single particle. The calculation formula for the volume of a single particle is as follows:
[0040]
[0041] where a and b are the parameters of the standard equation of the fitting ellipse of the contour points of the particle,
[0042] Collect N particle images within a certain time period. The number of particle contours recognized in the N images are m1, m 2, …, m N , then the total number of particle contours recognized in the N images is M = m1 + m2 + … + m N . Calculate the equivalent spherical volumes of the M particles and arrange them in ascending order as v1, v2, …, v M , and the total volume of the M particles is V = v1 + v2 + … + v M, The pseudocode for calculating D10, D50, and D90 based on volume is as follows:
[0043]
[0044] D90 = (v k *6 / π) 1 / 3 / / D90 is the particle size corresponding to the volume of the particle
[0045] Break / / Jump out of the loop.
[0046] Compared with the prior art, the present invention has the following advantages:
[0047] The method of the present invention is a real-time and rapid particle size detection method that does not require manual participation, sampling, or contact with materials, and solves the problem that the particle size detection method cannot be detected online. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is the contour extraction effect diagram of the method of the present invention;
[0049] Figure 2 It is the comparison diagram of the fitting degree between non-adhesive particles and adhesive particles and the fitting ellipse of the method of the present invention;
[0050] Figure 3 It is the schematic diagram of extracting contour points of the method of the present invention;
[0051] Figure 4 It is the comparison diagram of the particle size change result and the particle size change result of the laser method in the embodiment of the present invention;
[0052] Figure 5 It is the particle size cumulative distribution curve diagram in the coating process in the embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0053] The technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0054] An online particle size analysis method based on image measurement, the specific steps are as follows:
[0055] 1) Data acquisition: Fix the device for obtaining pictures of the drug production process in front of the transparent window of the drug production equipment to obtain pictures of the drug production process. The data is transmitted to the algorithm processor through a cable and is displayed in real time on the user interface after processing.
[0056] 2) Contour extraction: Use the function cv2.findContours() of the OpenCV library for contour extraction. The contour extraction effect is asFigure 1 As shown, Figure 1 (a) is the original image, Figure 1 (b) is the contour recognition result and its fitting ellipse, Figure 1 It can be seen that the quality of the contours recognized by this function varies. Some contours recognize two adjacent particles as one particle, which will cause the particle size calculation result to be too large. The contours need to be further screened to remove the adhering particles.
[0057] 3) Contour screening: by observation Figure 1 (b) It can be found that the common feature of the contours of the adhered particles is that they fit less closely to their fitted ellipses, which is specifically manifested in that the distance from their fitted ellipses is greater than that of the non-adhesive particles. Figure 2 Adhering and non-adhering particles and their fitted ellipses are shown.
[0058] from Figure 2 As can be seen in (b), the contours of the two adhering particles are gourd-shaped, where the contours are concave inward and the distance between the two points in the concave part is relatively close. Based on this feature, when the distance between the symmetrical contour points located inside the fitting ellipse is relatively close, it is determined to be an adhering particle and its contour is removed. Figure 3 It is a schematic diagram of the image contour points. The orange points represent the contour points identified by the cv2.findContours() function, the blue points represent the fitted ellipse points of the contour points, the red points represent the contour points located inside the fitted ellipse points and closest to the fitted ellipse points, and the green points represent the points symmetrical to the red points. That is, when the minimum distance between the red point and the green point is less than the set threshold, it is judged as an adhesion particle.
[0059] The specific steps of contour screening are as follows:
[0060] (a) Use the principle of least squares to calculate the fitting ellipse points of the contour points:
[0061] The general equation of an ellipse is Ax 2 +Bxy+Cy 2 +Dx+Ey+1=0, to make the ellipse equation most accurate, it is necessary to make all the contour points P i (x i ,y i ), i∈[1,N], N is the number of contour points, and the ellipse equation should be satisfied as much as possible, so the function F=∑(Ax i 2 +Bx i y i +Cy i 2 +Dx i +Ey i +1) 2is 0, but in actual fitting, the function F cannot be 0. According to the least squares method to solve its minimum value, taking the derivative of the function F gives:
[0062]
[0063]
[0064] When the above derivative is 0, the value of the function F is the smallest. For the convenience of solving, the above formula is written in the form of a matrix function:
[0065]
[0066] Solving gives the parameters A, B, C, D, E of the general equation of the ellipse, and then converting the general equation of the ellipse into the standard equation of the ellipse For the convenience of subsequent calculations, a 2 , b 2 The calculation formulas are as follows.
[0067]
[0068] Among them, a and b are the parameters of the standard equation of the fitted ellipse;
[0069] (b) Calculate the distance from the contour points inside the fitted ellipse points to the fitted ellipse points:
[0070] The fitted ellipse points P j (x j , y j ), j ∈ [1, M], where M is the number of fitted ellipse points. First, screen the contour points located inside the fitted ellipse. By judging whether the line segment connecting the contour point P i (x i , y i ) and the center of the fitted ellipse P o (x o , y o ) of the fitted ellipse has an intersection with the fitted ellipse to judge whether the contour point is located inside the fitted ellipse. Solve by simultaneously establishing the equations of the line segment and the fitted ellipse. If there is no solution, there is no intersection, then the contour point is located inside the fitted ellipse. The simultaneous equations are as follows:
[0071]
[0072] Let the contour points located inside the fitted ellipse be P k (x k , y k ), k ∈ [1, P], where P is the number of contour points located inside the fitted ellipse. Calculate the shortest distance from them to the fitted ellipse points, and select the point with the largest distance among them, as shown by Figure 3 the red dot. The calculation formula for the maximum distance value is as follows:
[0073]
[0074] (c) Calculate the distance from this point to the symmetric contour point:
[0075] Let the contour point with the maximum distance from the fitting ellipse among the points located inside the fitting ellipse be P d , with the subscript d, then for P d , the calculation method of the subscript of its symmetric contour point is as follows:
[0076] idx = d + int(0.4×N), d + int(0.4×N)+1,..., d + int(0.6×N)
[0077]
[0078] where N is the number of contour points, and int(x) represents rounding down x.
[0079] Let the symmetric contour point be P l (x l , y l ), l ∈ [1, Q], Q is the number of symmetric contour points, then as Figure 3 shown, the contour point P d (x d , y d ) with the maximum distance from the fitting ellipse among the points located inside the fitting ellipse in the figure and its symmetric contour point, the calculation method of the shortest distance between them is as follows:
[0080]
[0081] If the value of D2 is less than the set threshold, then determine that the contour is the contour of an adhered particle and remove it.
[0082] 4) Calculate the particle size of a single particle: The calculation formula for the particle size d of a particle is as follows:
[0083]
[0084] where a, b are the parameters of the standard equation of the fitting ellipse.
[0085] 5) Statistically analyze the particle size distribution results: The particle size distribution results use D10, D50, D90 as indicators. D10, D50, D90 respectively represent the corresponding particle sizes when the cumulative volume ratio of the particles reaches 10%, 50%, 90%. Before calculating D10, D50, D90, it is necessary to first calculate the volume of a single particle. The calculation formula for the volume of a single particle is as follows:
[0086]
[0087] where a and b are parameters of the standard equation of the fitted ellipse of the contour points of the particle.
[0088] Collect N particle images within a certain time period. The number of particle contours recognized in the N images are m1, m 2, …, m N , then the total number of particle contours recognized in the N images is M = m1 + m2 + … + m N . Calculate the equivalent spherical volumes of the M particles, and arrange them in ascending order as v1, v2, …, v M , and the total volume of the M particles is V = v1 + v2 + … + v M, The pseudo-code for calculating D10, D50, and D90 based on volume is as follows:
[0089]
[0090] Break / / Jump out of the loop.
[0091] Example 1
[0092] Install the integrated tooling of the industrial camera, lens, and light source as the data acquisition medium of the method of the present invention outside the window of the experimental fluidized bed, and take particle images of the bottom spray coating process at a speed of 1 frame / s. Count the contours in the particle images taken in the 300s time interval to obtain the particle size results. At the same time, take small samples of the coated pellets at intervals during the coating process, and compare the results of the laser particle size analyzer with the results of the method of the present invention to check for consistency.
[0093] Figure 4 Shows the curve of the particle size obtained by the method of the present invention changing with the coating duration. The red, blue, and yellow curves represent the curves of D10, D50, and D90 calculated by the method changing with the coating duration. The dots of the same color as the curves represent the measurement results of the laser particle size analyzer sampled at that time point. The breaks in the curves are due to the shutdown of the fluidized bed and there are no measurement data.
[0094] Since the principles of different particle size measurement methods are different, there are also differences in their particle size measurement results. Therefore, instead of pursuing absolute consistency of the data, we focus on the correlation of the particle size change trends. From Figure 4 it can be seen that the curve of the particle size obtained by the method in this article changing with time has a high similarity with the curve of the particle size measured by the laser method changing with time, which proves the feasibility of the method of the present invention as an on-line particle size detection tool.
[0095] Calculate the cumulative distribution curves for the four time periods of 10:03 - 10:13, 13:35 - 13:45, 16:00 - 16:10, and 16:30 - 16:40 during the coating process, as Figure 5 shown.
[0096] From Figure 5 It can be seen that as the coating process progresses, the cumulative particle size distribution curve moves to the right, which is in line with the trend of film thickness growth during the coating process, verifying the sensitivity of the method of the present invention to film thickness growth from another perspective.
[0097] The above are only the embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, various changes, modifications, substitutions, and variations can be made to these embodiments, and these changes, modifications, substitutions, and variations should also be regarded as the protection scope of the present invention.
Claims
1. An online particle size analysis method based on image measurement, characterized in that: The specific steps are as follows: 1) Data acquisition: Fix the industrial camera, lens, and light source in front of the transparent window of the drug production equipment to obtain pictures of the drug production process, transmit them to the algorithm processor through cables, and display them in real time on the user interface after processing; 2) Contour extraction: Use the OpenCV library function cv2.findContours() to extract contours; 3) Contour screening; 4) Calculate the particle size of a single particle; 5) Statistical particle size distribution results.
2. The online particle size analysis method based on image measurement according to claim 1, characterized in that: The specific steps of step 3) contour screening are as follows: (a) Use the principle of least squares to calculate the fitting ellipse points of the contour points: The general equation of an ellipse is To make the ellipse equation most accurate, it is necessary to make all the contour points is the number of contour points, which satisfies the ellipse equation as much as possible, so it is necessary to make the function is 0, but in actual fitting, the function It is impossible to be 0. The minimum value is solved by the least squares method. The derivative is: ; ; ; ; ; When the above derivative is 0, the function The value of is the smallest. To facilitate the solution, the above formula is written in the form of a matrix function: ; Solve to get the parameters of the general equation of the ellipse , and then convert the general equation of the ellipse into the standard equation of the ellipse To facilitate subsequent calculations, The calculation formula is as follows: ; ; ; ; in are the parameters of the standard equation for fitting the ellipse; (b) Calculate the distance from the contour point inside the fitted ellipse point to the fitted ellipse point: The fitting ellipse points are obtained by step (a) To find the number of points in the fitted ellipse, first filter the contour points inside the fitted ellipse, and then determine the contour points. and the center of the fitted ellipse Whether the line segment and the fitted ellipse intersect is used to determine whether the contour point is inside the fitted ellipse. The simultaneous equations of the line segment and the fitted ellipse are solved. If there is no solution, there is no intersection, and the contour point is inside the fitted ellipse. The simultaneous equations are as follows: ; Let the contour point inside the fitted ellipse be is the number of contour points located inside the fitted ellipse, calculate the shortest distance from it to the fitted ellipse point, and select the point with the largest distance. The maximum distance calculation formula is as follows: ; (c) Calculate the distance from this point to the symmetric contour point: Let the contour point inside the fitted ellipse with the largest distance from the fitted ellipse point be , the subscript is ,but The subscript calculation method of the symmetric contour points is as follows: ; ; in is the number of contour points, int(x) means rounding x down; Let the symmetric contour point be is the number of symmetrical contour points, the contour point located inside the fitted ellipse with the largest distance from the fitted ellipse point The shortest distance between the points of its symmetrical contour is calculated as follows: ; like If the value of is less than the set threshold, the contour is judged as the contour of the adhesion particle and is removed.
3. The online particle size analysis method based on image measurement according to claim 1, characterized in that: The method for calculating the particle size of a single particle in step 4) is as follows: The calculation formula ; in are the parameters of the standard equation for the fitted ellipse.
4. The online particle size analysis method based on image measurement according to claim 1, characterized in that: The method for statistically analyzing the particle size distribution results in step 5 is as follows: The particle size distribution results are based on D10, D50, and D90 as indicators. D10, D50, and D90 represent the corresponding particle sizes when the cumulative volume of the particles reaches 10%, 50%, and 90%, respectively. Before calculating D10, D50, and D90, the volume of a single particle is calculated. The volume calculation formula for a single particle is as follows: ; in are the parameters of the standard equation of the fitted ellipse of the particle's contour points, N particle images are collected within a certain period of time. The number of particle contours identified in the N images is m1, m2, ..., mN respectively. The total number of particle contours identified in the N images is M=m1+m2+...+mN. The equivalent spherical volume of the M particles is calculated and arranged in ascending order as v1, v2, ..., vM. The total volume of the M particles is V=v1+v2+...+vM. The pseudo code for calculating D10, D50, and D90 based on volume is as follows: SUM = 0 / / Volume cumulative sum; For i =1 TO M DO; SUM = SUM + vi; IF SUM ≥ V * 0.1 / / When the cumulative volume exceeds 10% of the total volume V; D10 = (vi*6 / π)1 / 3 / / D10 is the particle size corresponding to the particle volume; Break / / Jump out of the loop; For j =i TO M DO; SUM = SUM + vj; IF SUM ≥ V * 0.5 / / When the cumulative volume exceeds 50% of the total volume V; D50 = (vj*6 / π)1 / 3 / / D50 is the particle size corresponding to the particle volume; Break / / Jump out of the loop; For k = j TO M DO; SUM = SUM + vk; IF SUM ≥ V * 0.9 / / When the cumulative volume exceeds 90% of the total volume V; D90 = (vk*6 / π)1 / 3 / / D90 is the particle size corresponding to the particle volume; Break / / Jump out of the loop.
Citation Information
Patent Citations
Precise morphology detection system and detection method
CN109540745A
Target colony growth characteristic identification method
CN111178173A
Concave spot detection and segmentation algorithm for adhered grains
CN115330686A
Motion feature extraction method and device for molten pool in powder laying additive manufacturing process
CN117392178A
Grain size distribution measuring method for ground material and grain size distribution measuring system for ground material
JP2024110522A