Pellet mixing end point detection method based on machine vision

Through machine vision technology, the image information during the mixing process of micro-pellets is analyzed, the quantity ratio and distribution circle area of ​​micro-pellets are calculated, the possible mixing period is screened, and the end point of micro-pellets is accurately determined, which solves the uneven mixing and waste of resources in the prior art. question.

CN119147545APending Publication Date: 2024-12-17TIANJIN UNIV OF TRADITIONAL CHINESE MEDICINE +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411305084.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The prior art is difficult to accurately detect the end point of the micro-pellet mixing, resulting in uneven mixing or waste of resources.

Method used

Using a machine vision-based method, by collecting image information during the mixing process of micro-pellets, calculating the number ratio and distribution circle area of ​​micro-pellets, screening the possible mixing period, and determining the mixing end point based on the proportion and fluctuation of micro-pellets.

Benefits of technology

Accurate detection of the end point of the micro-pellet mixing is achieved, the quality of the preparation is ensured, production resources are saved, and errors caused by chance are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119147545A_ABST
    Figure CN119147545A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a pellet mixing end point detection method based on machine vision. The pellet mixing end point detection method comprises the following steps: screening a possible uniform mixing time period set by utilizing the quantity proportion of different types of pellets; the pellet ratio of the area sum of pellet distribution circles of each pellet graphic individual to the total area of the image information is utilized; and screening a possible uniform mixing time period in which the difference value between the maximum value and the minimum value of the pellet ratio and the difference value between the maximum value and the minimum value of the total number of all types of pellets simultaneously meet conditions, and determining the earliest time point as a mixing end point. According to the method provided by the embodiment of the invention, multiple pieces of image information of planes with different heights of a sample are collected, data expressed in the multiple pieces of image information are compared with data in initial feeding, and then the time period when the pellets are uniformly mixed is further screened by utilizing the proportion and quantity fluctuation condition of the pellets; and the earliest time point is determined as the pellet mixing end point as a reference for producing the composite pellet preparation, so that the quality of the pellet preparation is ensured, and production resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of micro-pill mixing endpoint detection, and in particular to a micro-pill mixing endpoint detection method based on machine vision. Background Art

[0002] For multi-release pellet preparations containing multiple active ingredients, multiple pellets containing different active ingredients need to be mixed through a mixing process. The mixing uniformity between multiple pellets is an important condition to ensure the quality of the pellet preparation. In the pellet mixing process, multiple pellets and excipients to be mixed are added to the mixing tank for a certain period of mixing and stirring. If the mixing endpoint is advanced, it will lead to uneven mixing between the multiple pellets, resulting in a decrease in the quality of the pellet preparation. If the mixing endpoint is delayed, it will lead to a waste of production resources for the pellet preparation.

[0003] When testing the mixing uniformity of micro-pellets, the image information of materials at different levels in the mixing tank is collected, and the image information is processed by color recognition and contour extraction using machine vision technology to analyze the mixing of materials in the mixing tank. Using color recognition and contour extraction, the micro-pellets in the material can be identified, the micro-pellets and auxiliary materials in the material can be distinguished, and the number of each micro-pellet in the material and the proportion of the micro-pellets in the material can be determined. However, when testing the uniformity of mixing between multiple micro-pellets, the mixing endpoint of the uniform mixing between multiple micro-pellets cannot be determined more accurately. Summary of the invention

[0004] The embodiment of the present invention provides a method for detecting a micro-pellet mixing endpoint based on machine vision to solve the technical problem that the micro-pellet mixing endpoint cannot be accurately detected.

[0005] The embodiment of the present invention provides a method for detecting a pellet mixing endpoint based on machine vision, comprising:

[0006] The number of each type of pellets is identified using the image information collected during the pellet mixing process, and the quantity ratio between different types of pellets is calculated;

[0007] Using the quantity ratio to select a possible mixing time period set;

[0008] The center of gravity of each individual pellet pattern identified by the image information collected during the pellet mixing process is used as the center of the circle to determine the pellet distribution circle of each pellet, and the pellet ratio value of the sum of the areas of all pellet distribution circles in the image information to the total area of ​​the image information is calculated;

[0009] Calculate the difference between the maximum and minimum values ​​of the pellet proportion value in all image information corresponding to each possible mixing time period in the possible mixing time period set as the pellet proportion fluctuation value, and the difference between the maximum and minimum values ​​of the total number of all types of pellets as the pellet number fluctuation value;

[0010] The possible mixing periods are screened and concentrated, and the possible mixing periods satisfying the conditions that the fluctuation value of the pellet proportion is less than the threshold value of the pellet proportion and the fluctuation value of the pellet quantity is less than the threshold value of the pellet quantity are simultaneously screened, and the earliest time point of the earliest mixing period is determined as the mixing endpoint.

[0011] Furthermore, the image information collected during the pellet mixing process includes:

[0012] During the pellet mixing process, samples obtained according to preset rules are imaged at multiple evenly spaced planes of the sample.

[0013] Furthermore, the preset rules include:

[0014] After the pellet mixing process started, sampling was performed at intervals of 1 minute as a sampling point.

[0015] Furthermore, the calculation of the quantity ratio between different types of pellets includes:

[0016] Identify the number of each type of pellets in each image corresponding to each sampling point;

[0017] Calculate the sum of the number of each type of micropellets in all images corresponding to each sampling point as the total number of each type of micropellets at each sampling point;

[0018] The total number of each type of pellets at each sampling point was compared to obtain the quantity ratio between different types of pellets at each sampling point.

[0019] Furthermore, the method of screening possible mixing time period sets by using the quantity ratio includes:

[0020] Compare the quantity ratio in the image information of each sampling point with a preset first ratio value and a preset second ratio value, respectively, and select sampling points whose quantity ratio is greater than the first ratio value and less than the second ratio value;

[0021] The time period included in the continuous sampling points among the screened sampling points is determined as the possible mixing time period.

[0022] Further, determining the pellet distribution circle of each pellet includes:

[0023] Determine the distance between the center of gravity of each micro-pill pattern individual and the center of gravity of its nearest micro-pill pattern individual, use 1 / 2 of the distance as the radius, and draw a circle with the center of gravity of each micro-pill pattern individual as the center.

[0024] Furthermore, the fluctuation value of the pellet ratio includes:

[0025] Calculating the sum of the areas of the pellet distribution circles in each image in all images of each sampling point included in the possible mixing period;

[0026] The sum of the pellet distribution circle areas of all images at each sampling point is added up and compared with the sum of the areas of all images to obtain the pellet ratio value at each sampling point;

[0027] The maximum and minimum values ​​of the pellet proportion values ​​of all sampling points included in the possible mixing period are subtracted to obtain the pellet proportion fluctuation value.

[0028] Furthermore, the pellet quantity fluctuation value includes:

[0029] Calculate the total number of all types of pellets in each image in all images of each sampling point included in the possible mixing period;

[0030] The total number of all types of pellets in all images of each sampling point is accumulated to obtain the total number of all types of pellets at each sampling point;

[0031] The maximum and minimum values ​​of the total number of all types of pellets at all sampling points included in the possible mixing period are subtracted to obtain the pellet number fluctuation value.

[0032] Furthermore, the number of each type of pellets identified includes:

[0033] Color recognition is used to process image information, and the micropellet areas of different colors are distinguished through the RGB chromaticity values ​​of the pixels in the image.

[0034] Furthermore, the center of gravity of each identified individual pellet graphic includes:

[0035] The first pixel point in the lower left corner of the image information is used as the origin to establish a plane rectangular coordinate system, and the image information is processed using contour extraction to identify the contour of each individual micropill graphic and determine the center of gravity of the graphic.

[0036] The embodiment of the present invention provides a method for detecting a pellet mixing endpoint based on machine vision. In the pellet mixing process, a sampler is used to perform multiple sampling at multiple sampling points, and multiple image information of different height planes of the sample is collected by the sampler. The data expressed in the multiple image information are combined for calculation, so that the state of different stages in the pellet mixing process can be expressed more accurately. The obtained pellet quantity ratio is compared with the ratio at the time of initial feeding, and the possible mixing period is preliminarily judged. The distribution uniformity of the pellets is inferred by the independent circle method, and the proportion of the pellets in the material can be obtained more accurately. The pellet proportion and the quantity fluctuation in the possible mixing period are further used to screen the pellets to achieve uniform mixing, and the earliest time point of the earliest period in which the pellets reach a uniform mixing state after screening is determined as the pellet mixing endpoint. The judgment and screening are combined with multiple conditions, and the spatial distribution of the pellets is fully considered. The error caused by accidental situations can be avoided. The determined pellet mixing endpoint is relatively accurate and can be used as a reference for the production of composite pellet preparations, saving production resources while ensuring the quality of the pellet preparations. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0038] Figure 1 This is a flow chart of a method for detecting a pellet mixing endpoint based on machine vision according to Embodiment 1 of the present invention;

[0039] Figure 2 This is a flow chart of a reference method for a micro-pellet mixing endpoint detection method based on machine vision according to Embodiment 1 of the present invention;

[0040] Figure 3 A schematic diagram of micropellet mixing experimental parameters of a reference method for a micropellet mixing endpoint detection method based on machine vision according to Embodiment 1 of the present invention;

[0041] Figure 4 This is a flow chart of a method for detecting a pellet mixing endpoint based on machine vision according to Embodiment 2 of the present invention;

[0042] Figure 5 This is a flow chart of a method for detecting a pellet mixing endpoint based on machine vision according to Embodiment 3 of the present invention;

[0043] Figure 6 This is a flow chart of a method for detecting a pellet mixing endpoint based on machine vision according to Embodiment 4 of the present invention;

[0044] Figure 7This is a flow chart of a method for detecting a pellet mixing endpoint based on machine vision according to Embodiment 5 of the present invention;

[0045] Figure 8 This is a schematic diagram of a pellet distribution circle in a pellet mixing endpoint detection method based on machine vision according to Embodiment 5 of the present invention;

[0046] Fig. 9 This is a schematic diagram of a process for calculating the fluctuation value of the pellet ratio in a pellet mixing endpoint detection method based on machine vision according to Embodiment 6 of the present invention;

[0047] Fig.10 This is a schematic diagram of the process of calculating the micropill quantity fluctuation value in a micropill mixing endpoint detection method based on machine vision described in Example 6 of the present invention. DETAILED DESCRIPTION

[0048] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0049] Embodiment 1

[0050] Figure 1 This is a flow chart of a method for detecting a pellet mixing endpoint based on machine vision according to Embodiment 1 of the present invention. This embodiment is applicable to detecting a pellet mixing endpoint containing a plurality of pellet preparations, and specifically comprises the following steps:

[0051] When preparing microcapsule preparations with multiple active ingredients, it is often necessary to mix multiple microcapsules containing different active ingredients. The mixing uniformity between different types of microcapsules is an important factor affecting the quality of microcapsule preparations. The mixing process of microcapsules is to add multiple microcapsules and excipients in a certain proportion to a mixing tank for mixing. The rotation speed of the mixing tank, the quality of the filler, the quantity ratio between different types of microcapsules, and the ratio of microcapsules to excipients are all parameters that affect the mixing uniformity of microcapsules. In the actual production process, in order to make the materials in the mixing tank have better fluidity and easier to mix evenly, lubricants such as magnesium stearate are also added during the initial feeding. Since multiple parameters will affect the mixing uniformity of microcapsules, it is necessary to detect the mixing end point of microcapsule preparations with different formula ratios. Under the condition of ensuring uniform mixing between different types of microcapsules, the quality of the microcapsule preparation is guaranteed, while saving a lot of production resources.

[0052] When determining the mixing endpoint of micropellets, micropellets with different formula ratios can be mixed separately, and the mixing process can be tested and analyzed during the mixing process to determine the mixing endpoint of each micropellet preparation with each formula ratio. The mixing endpoint can be used for micropellets with the same formula ratio in subsequent production. The method for testing the mixing uniformity between different types of micropellets during the micropellet mixing process is as follows:

[0053] S110, using the image information collected during the pellet mixing process to identify the quantity of each type of pellets, and calculating the quantity ratio between different types of pellets;

[0054] In order to facilitate the use of machine vision to analyze the materials in the mixing tank, it is necessary to dye different types of micro-pills separately, and dye different types of micro-pills into different colors. The selected colors should have the characteristics of high saturation and obvious color difference, so as to facilitate the identification of micro-pills and distinguish different types of micro-pills. At different stages of the mixing process, the collected material image information is color-recognized, and the micro-pill area in the image is identified by the color of the micro-pills, and the number of micro-pill areas of different colors is calculated as the number of each type of micro-pill. Then, the number ratio between different types of micro-pills is calculated to understand the current mixing situation between different types of micro-pills.

[0055] S120, screening a possible mixing time period set using the quantity ratio;

[0056] After obtaining the number ratio between different types of pellets, the number ratio is compared with the number ratio between different types of pellets at the initial feeding. When the number ratio between different types of pellets in the actual mixing is close to the number ratio between different types of pellets at the initial feeding, it can be considered that the pellets of different types may be mixed evenly in the current mixing stage. Connecting multiple consecutive mixing stages that may be mixed evenly can obtain possible mixing time periods. Since the influencing factors in the pellet mixing process are more complex, there may be multiple possible mixing time periods, and all possible mixing time periods constitute a possible mixing time period set.

[0057] S130, using the image information collected during the pellet mixing process to identify the center of gravity of each individual pellet graphic as the center of the circle, determining the pellet distribution circle of each pellet, and calculating the pellet ratio value of the sum of the areas of all pellet distribution circles in the image information to the total area of ​​the image information;

[0058] Due to the randomness in the pellet mixing process, the possible mixing period determined only by the ratio of the number of different types of pellets will have accidental results, that is, the ratio of the number of different types of pellets corresponding to some possible mixing periods is close to that of the initial feeding, but it is formed by chance. The actual number of pellets and the proportion of pellets corresponding to the possible mixing period are quite different from those of the initial feeding, and the number of pellets and the proportion of pellets will change greatly in the subsequent mixing process, which requires further screening. Machine vision can be used to perform contour extraction processing on the image information of the collected materials, determine the individual contour of each pellet graphic, and then determine the center of gravity of each individual pellet graphic. The pellet distribution circle representing each pellet distribution area is made with the center of gravity of the graphic as the center, and the proportion of the sum of the areas of all pellet distribution circles in the image information to the total area of ​​the image information is calculated as the pellet proportion value. Exemplarily, the theoretical basis for using the pellet distribution circle to infer the pellet proportion is the independent circle method, that is, assuming that there are a×a=n uniformly distributed small circles in a square, and the distance between each circle and the nearest neighbor circle is s. Such a pattern is called a two-dimensional completely uniform distribution pattern. At this time, the ratio of the sum of the areas of all circles to the area of ​​the square is π / 4. However, in the actual mixing process, there is almost no completely uniform distribution pattern. Therefore, the closeness of the pellet proportion value to the complete distribution pattern can reflect the uniform distribution of the pellets in the image information.

[0059] S140, respectively calculating the difference between the maximum and minimum values ​​of the pellet proportion value in all image information corresponding to each possible mixing time period in the possible mixing time period set as the pellet proportion fluctuation value, and the difference between the maximum and minimum values ​​of the total number of all types of pellets as the pellet number fluctuation value;

[0060] Since the pellet mixing process is dynamic, the pellet proportion values ​​at different times in the possible mixing period may also fluctuate. Therefore, the fluctuation of the pellet proportion value and the total number of all types of pellets in the possible mixing period can be used to further screen whether the possible mixing period meets the requirements for determining the pellet mixing endpoint. If the fluctuation of the pellet proportion value and the total number of all types of pellets in the possible mixing period is too large, the possible mixing period can be considered to be accidental and excluded. When calculating the pellet proportion fluctuation value, it is necessary to first calculate the pellet proportion value in all image information in the possible mixing period, select the largest pellet proportion value and the smallest pellet proportion value, and calculate the difference between the largest pellet proportion value and the smallest pellet proportion value, that is, the pellet proportion fluctuation value is used as a reference for the fluctuation of the pellet proportion value in the possible mixing period. When calculating the total number of all types of microcapsules, it is necessary to first calculate the total number of all types of microcapsules in all image information within the possible mixing period, select the largest total number of all types of microcapsules and the smallest total number of all types of microcapsules, and calculate the difference between the largest total number of all types of microcapsules and the smallest total number of all types of microcapsules, that is, the microcapsules number fluctuation value as a reference for the fluctuation of the total number of all types of microcapsules within the possible mixing period.

[0061] S150, screening possible mixing time periods, and simultaneously satisfying the conditions that the fluctuation value of the pellet proportion is less than the pellet proportion threshold value and the fluctuation value of the pellet quantity is less than the pellet quantity threshold value, and determining the earliest time point of the earliest mixing time period as the mixing endpoint.

[0062] When different types of pellets are mixed evenly, the pellet ratio and the total number of all types of pellets should be relatively stable with a small fluctuation range. Therefore, the pellet ratio fluctuation value and the pellet number fluctuation value can be used to screen possible mixing periods that meet the conditions. The pellet ratio fluctuation value and the pellet number fluctuation value can be compared with the preset fluctuation range. When the pellet ratio fluctuation value and the pellet number fluctuation value of the possible mixing period meet the corresponding fluctuation range at the same time, the pellet mixing end point can be determined using the possible mixing period. Specifically, when screening, the pellet ratio fluctuation value is compared with the preset pellet ratio threshold value, and the pellet number fluctuation value is compared with the preset pellet number threshold value. The possible mixing period that meets the conditions that the pellet ratio fluctuation value is less than the pellet ratio threshold value and the pellet number fluctuation value is less than the pellet number threshold value can be considered as the period of uniform mixing between multiple pellets. In order to save production resources, the earliest time point in the earliest uniform mixing period is determined as the mixing end point of the pellets. At this time point, the multiple pellets have reached a uniform mixing state.

[0063] This embodiment analyzes the image information collected at different stages of the mixing process and compares it with the initial feeding data, and then uses the fluctuations in the pellet mixing process to determine the earliest time point when the pellets are evenly mixed as the pellet mixing endpoint, which can more accurately reflect the state of the pellet mixing process, combines multiple conditions for screening, and determines a more accurate pellet mixing endpoint, fully considering the spatial distribution of the pellets, and can avoid accidental situations. It can be used as a reference for the production of composite pellet preparations, saving production resources while ensuring the quality of the pellet preparations.

[0064] In order to verify the accuracy of the method provided in this example for pellet mixing endpoint detection, a reference method was designed for comparison. Figure 2 Flow chart of a reference method for a micro-pill mixing endpoint detection method based on machine vision according to Embodiment 1 of the present invention, as shown in FIG. Figure 2 As shown, the reference method includes the following steps:

[0065] S210, after collecting an image of the sampler, taking about 500 mg of sample at the center of three planes of the sampler at a height of 2 cm, 3 cm, and 4 cm from the bottom surface, respectively, and removing auxiliary materials;

[0066] S220, calculating the quantity ratio between each type of micro-pellets, weighing the total mass of the micro-pellets, and calculating the mass proportion of the micro-pellets in the sample;

[0067] S230, using the calculated quantity ratio of each type of micro-pellets to compare with the quantity ratio of each type of micro-pellets at the time of initial feeding, and using the mass proportion of the total mass of the micro-pellets in the sample to compare with the mass proportion of the mass of the micro-pellets in the total material at the time of initial feeding.

[0068] When the data obtained by the reference method is close to the data at the time of initial feeding, the current sampling point can be considered as the end point of pellet mixing. By comparing the reference method with the method provided in this embodiment, pellet mixing experiments with various parameter conditions were designed. In this embodiment, the mixing uniformity detection experiment between ordinary pellets and gastrointestinal pellets was used as an example. Figure 3 As shown, multiple batches with different mixing parameters were designed. After comparison, the pellet mixing endpoints determined by the reference method and the method provided in this embodiment are relatively consistent. Therefore, the method provided in this embodiment can more accurately determine the pellet mixing endpoint. The method provided in this embodiment can provide a reference for the pellet mixing process and confirm the appropriate pellet mixing endpoint.

[0069] Embodiment 2

[0070] Figure 4This is a flow chart of a method for detecting micro-pellet mixing endpoint based on machine vision as described in Example 2 of the present invention. This embodiment is optimized based on the above-mentioned embodiment. In this embodiment, the image information collected during the micro-pellet mixing process is specifically optimized as follows: during the micro-pellet mixing process, samples obtained according to preset rules are imaged at multiple evenly spaced planes of the samples.

[0071] Accordingly, the pellet mixing endpoint detection method provided in this embodiment specifically includes:

[0072] S310, using the sample obtained according to the preset rule in the process of mixing the pellets, the number of each type of pellets is identified by image information obtained by photographing multiple evenly spaced planes of the sample, and calculating the quantity ratio between different types of pellets;

[0073] In order to better understand the state changes at different stages in the micro-pellet mixing process, the sampler is used to sample the materials in the mixing tank at different stages in the micro-pellet mixing process. The sampler is a multi-layer structure arranged in parallel up and down, and the multi-layer structure can be used to collect images of different height planes of the sampler. The specific process is that after sampling from the mixing tank using the sampler, the material image on the top surface of the sampler is first photographed, and then the samples of each layer are slowly removed from top to bottom in sequence. After each layer is removed, the image of the top surface of the next layer of material is collected, and after the image acquisition is completed, all the sampled materials are put back into the mixing tank to avoid the reduction of materials in the mixing tank caused by sampling, which affects the state monitoring of the next mixing process. Exemplarily, the sampler can be a cube with a length of 7.5cm, a width of 7.5cm, and a height of 6cm. The sampler has 6 evenly spaced sampling slots. The images collected using this sampler are images of 6 planes with a height of 1cm, 2cm, 3cm, 4cm, 5cm, and 6cm from the bottom surface of the sampler, respectively.

[0074] S320, screening a possible mixing time period set using the quantity ratio;

[0075] S330, using the image information collected during the pellet mixing process to identify the center of gravity of each individual pellet graphic as the center of the circle, determining the pellet distribution circle of each pellet, and calculating the pellet ratio value of the sum of the areas of all pellet distribution circles in the image information to the total area of ​​the image information;

[0076] S340, respectively calculating the difference between the maximum and minimum values ​​of the pellet proportion value in all image information corresponding to each possible mixing time period in the possible mixing time period set as the pellet proportion fluctuation value, and the difference between the maximum and minimum values ​​of the total number of all types of pellets as the pellet number fluctuation value;

[0077] S350, screening possible mixing time periods, and simultaneously satisfying the conditions that the fluctuation value of the pellet proportion is less than the pellet proportion threshold value and the fluctuation value of the pellet quantity is less than the pellet quantity threshold value, and determining the earliest time point of the earliest mixing time period as the mixing endpoint.

[0078] This embodiment uses a sampler to take samples during the pellet mixing process, uses the sampler's multi-layer evenly spaced plane structure to collect multiple images of the sample at different height planes, and uses the multiple images to analyze the distribution of the pellets at different height planes of the sample, thereby obtaining the spatial distribution of the pellets and avoiding errors caused by accidental results of a single plane.

[0079] An optional implementation of this embodiment is that the preset rule includes:

[0080] After the pellet mixing process begins, sampling is performed at intervals of 1 minute as a sampling point. For example, the mixing methods of pellet preparations with different formula ratios may also be different. In order to more accurately detect and analyze the pellet mixing process, sampling can be performed in the mixing tank using a sampler every 1 minute after the mixing starts until the mixing is completed. In this way, the state changes every minute during the mixing process can be obtained, and the mixing endpoint can be detected using smaller units, and the final determined mixing endpoint is more accurate.

[0081] Embodiment 3

[0082] Figure 5 This is a flow chart of a method for detecting a pellet mixing endpoint based on machine vision according to Embodiment 3 of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, the calculation of the quantity ratio between different types of pellets is specifically optimized as follows:

[0083] Identify the number of each type of pellets in each image corresponding to each sampling point;

[0084] Calculate the sum of the number of each type of micropellets in all images corresponding to each sampling point as the total number of each type of micropellets at each sampling point;

[0085] The total number of each type of pellets at each sampling point was compared to obtain the quantity ratio between different types of pellets at each sampling point.

[0086] Accordingly, the pellet mixing endpoint detection method provided in this embodiment specifically includes:

[0087] S410, using the image information obtained by photographing multiple evenly spaced planes of the sample obtained according to the preset rules during the pellet mixing process, respectively identify the number of each type of pellet in each image corresponding to each sampling point; calculate the sum of the number of each type of pellet in all images corresponding to each sampling point as the total number of each type of pellet at each sampling point; compare the total number of each type of pellet at each sampling point to obtain the quantity ratio between different types of pellets at each sampling point.

[0088] In order to fully consider the spatial distribution of microcapsules, when analyzing the image information of each sampling point and calculating the quantity ratio between different types of microcapsules at the sampling point, the six pictures of each sampling point were identified respectively, and then the number of each type of microcapsules in each picture was calculated respectively, and the number of each type of microcapsules in the six pictures was accumulated. After accumulation, the total number of each type of microcapsules in the six pictures was obtained, that is, the total number of each type of microcapsules at the sampling point, and then the total number of each type of microcapsules was calculated to obtain the quantity ratio between different types of microcapsules at the sampling point.

[0089] S420, screening possible mixing time period sets using the quantity ratio;

[0090] S430, using the image information collected during the pellet mixing process to identify the center of gravity of each individual pellet graphic as the center of the circle, determining the pellet distribution circle of each pellet, and calculating the pellet ratio value of the sum of the areas of all pellet distribution circles in the image information to the total area of ​​the image information;

[0091] S440, respectively calculating the difference between the maximum and minimum values ​​of the pellet proportion value in all image information corresponding to each possible mixing time period in the possible mixing time period set as the pellet proportion fluctuation value, and the difference between the maximum and minimum values ​​of the total number of all types of pellets as the pellet number fluctuation value;

[0092] S450, screening possible mixing time periods, and simultaneously satisfying the conditions that the fluctuation value of the pellet proportion is less than the pellet proportion threshold value and the fluctuation value of the pellet quantity is less than the pellet quantity threshold value, and determining the earliest time point of the earliest mixing time period as the mixing endpoint.

[0093] This embodiment calculates the sum of the number of each type of micropellets in all 6 images of each sampling point, and then uses the total number of each type of micropellets for proportion calculation, which fully considers the spatial distribution of the micropellets. The calculation of the quantity ratio of different types of micropellets at the sampling point is more accurate, and the calculation error caused by coincidence in a single image can be avoided.

[0094] Embodiment 4

[0095] Figure 6This is a flow chart of a method for detecting a microcapsule mixing endpoint based on machine vision as described in Example 4 of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, the use of the quantity ratio to screen the possible mixing time period set is specifically optimized as follows: in the image information of each of the sampling points, the quantity ratio is compared with the preset first ratio value and the second ratio value, respectively, to screen the sampling points whose quantity ratio is greater than the first ratio value and less than the second ratio value; among the screened sampling points, the time period contained in the continuous sampling points is determined as the possible mixing time period.

[0096] Accordingly, the pellet mixing endpoint detection method provided in this embodiment specifically includes:

[0097] S510, using the image information obtained by photographing multiple evenly spaced planes of the sample obtained according to the preset rules during the pellet mixing process, respectively identify the number of each type of pellet in each image corresponding to each sampling point; calculate the sum of the number of each type of pellet in all images corresponding to each sampling point as the total number of each type of pellet at each sampling point; compare the total number of each type of pellet at each sampling point to obtain the quantity ratio between different types of pellets at each sampling point.

[0098] S520, comparing the quantity ratio in the image information of each sampling point with the preset first ratio value and the second ratio value respectively, and screening the sampling points whose quantity ratio is greater than the first ratio value and less than the second ratio value; and determining the time period included in the continuous sampling points among the screened sampling points as the possible mixing time period.

[0099] When analyzing the image information of each sampling point, the number ratio between different types of microcapsules at the sampling point obtained by comparing the total number of each type of microcapsules in the six images is compared with the number ratio between different types of microcapsules at the initial feeding. When the number ratio between different types of microcapsules at the sampling point is close to the number ratio between different types of microcapsules at the initial feeding, it can be considered that the mixing state of the sampling point is a state of possible uniform mixing. Specifically, when the number ratio between different types of microcapsules at the sampling point is within ±20% of the ratio at the initial feeding, that is, the preset first ratio value is 80% of the initial feeding ratio, and the preset second ratio value is 120% of the initial feeding ratio, when the number ratio between different types of microcapsules at the sampling point satisfies both greater than 80% and less than 120% of the initial feeding ratio, it can be considered that the sampling point is in a state of possible uniform mixing, and then the continuous sampling points among the sampling points that meet the possible uniform mixing state are connected into time periods to obtain possible mixing time periods.

[0100] S530, using the image information collected during the pellet mixing process to identify the center of gravity of each individual pellet graphic as the center of the circle, determining the pellet distribution circle of each pellet, and calculating the pellet ratio value of the sum of the areas of all pellet distribution circles in the image information to the total area of ​​the image information;

[0101] S540, respectively calculating the difference between the maximum and minimum values ​​of the pellet proportion value in all image information corresponding to each possible mixing time period in the possible mixing time period set as the pellet proportion fluctuation value, and the difference between the maximum and minimum values ​​of the total number of all types of pellets as the pellet number fluctuation value;

[0102] S550, screening possible mixing time periods, and simultaneously satisfying the conditions that the fluctuation value of the pellet proportion is less than the pellet proportion threshold value and the fluctuation value of the pellet quantity is less than the pellet quantity threshold value, and determining the earliest time point of the earliest mixing time period as the mixing endpoint.

[0103] In this embodiment, by comparing the quantity ratio of different types of micropellets at the sampling point with the quantity ratio of different types of micropellets at the initial feeding, and taking advantage of the fact that the ratio during the mixing process is close to the initial feeding ratio, it can be preliminarily considered that the sampling point is in a possible mixed state, and the samples are preliminarily screened to facilitate subsequent calculations.

[0104] Embodiment 5

[0105] Figure 7 This is a flow chart of a method for detecting a pellet mixing endpoint based on machine vision as described in Example 5 of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, the determination of the pellet distribution circle of each pellet is specifically optimized as follows: determining the distance between the center of gravity of each pellet graphic individual and the center of gravity of its nearest pellet graphic individual, using 1 / 2 of the distance as the radius, and drawing a circle with the center of gravity of each pellet graphic individual as the center.

[0106] Accordingly, the pellet mixing endpoint detection method provided in this embodiment specifically includes:

[0107] S610, using the image information collected during the pellet mixing process to identify the quantity of each type of pellets, and calculating the quantity ratio between different types of pellets.

[0108] S620: Filter a possible mixing time period set using the quantity ratio.

[0109] S630, using the image information collected during the pellet mixing process to identify the center of gravity of each individual pellet graphic as the center of the circle, determine the distance between the center of gravity of each individual pellet graphic and the center of gravity of its nearest individual pellet graphic, use 1 / 2 of the distance as the radius, and draw a circle with the center of gravity of each individual pellet graphic as the center as the pellet distribution circle of each pellet, and calculate the pellet ratio value of the sum of the areas of all the pellet distribution circles in the image information to the total area of ​​the image information;

[0110] Since the shape of micropills is an irregular approximate sphere, and due to the presence of excipients, the micropill graphics identified in the collected images are often not regular circles. The area of ​​the micropill exposed in the image and the area of ​​the nearest micropill exposed in the image can be used to infer the actual plane distribution of the micropills in the excipients, and then the spatial distribution of the micropills can be inferred by combining multiple plane distributions. Specifically, first find the nearest micropill graphics of each micropill graphics individual, and the distance between the center of gravity of the two micropill graphics individuals can be used to infer the spatial distribution relationship of the two micropills. With 1 / 2 of the distance between the center of gravity of the two micropill graphics individuals as the radius, draw a circle with the center of each micropill graphics individual to obtain the micropill distribution circle of each micropill, which can be used as a reference for the plane distribution of the micropills, such as Figure 8 In the subsequent calculation, multiple plane distributions are combined to infer the spatial distribution of micro-pellets. The independent circle method is used as the theoretical basis. The area ratio of the micro-pellet distribution circle in the image can more accurately reflect the uniformity of the micro-pellet distribution in the plane, which can be used as a reference for detecting whether the micro-pellet distribution is uniform.

[0111] S640, respectively calculating the difference between the maximum and minimum values ​​of the pellet proportion value in all image information corresponding to each possible mixing time period in the possible mixing time period set as the pellet proportion fluctuation value, and the difference between the maximum and minimum values ​​of the total number of all types of pellets as the pellet number fluctuation value;

[0112] S650, screening possible mixing time periods, and simultaneously satisfying the conditions that the fluctuation value of the pellet proportion is less than the pellet proportion threshold value and the fluctuation value of the pellet quantity is less than the pellet quantity threshold value, and determining the earliest time point of the earliest mixing time period as the mixing endpoint.

[0113] This embodiment determines the pellet distribution circle by using the individual centroid of the pellet graphic and the distance between the individual centroids of the nearest pellet graphic, which can simulate the distribution state of the pellets, and uses the independent circle method as a theoretical basis to infer the distribution uniformity of the pellets. Combined with the distribution conditions of multiple planes, it can more accurately reflect the spatial distribution of the pellets in the sample.

[0114] Embodiment 6

[0115] Fig. 9This is a flow chart of calculating the micro-pill ratio fluctuation value in a micro-pill mixing endpoint detection method based on machine vision according to Embodiment 6 of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, calculating the micro-pill ratio fluctuation value specifically includes the following steps:

[0116] S710, respectively calculating the sum of the areas of the pellet distribution circles in each image in all images of each sampling point included in the possible mixing period;

[0117] S720, accumulating the sum of the pellet distribution circle areas of all images at each sampling point, and comparing it with the sum of the areas of all images to obtain the pellet proportion value of each sampling point;

[0118] S730, subtract the maximum value from the minimum value of the pellet ratio values ​​of all sampling points included in the possible mixing period to obtain a pellet ratio fluctuation value.

[0119] In order to consider the spatial distribution of microcapsules, the area of ​​the microcapsule distribution circle of each image in all images corresponding to each sampling point is calculated, and then the areas of all microcapsule distribution circles in all images are accumulated, and the ratio of the sum of the accumulated microcapsule distribution circle areas to the sum of the areas of all images is calculated as the microcapsule proportion value of the sampling point, that is, the ratio of the total area of ​​all microcapsule distribution circles at the sampling point to the total area of ​​all images, which can avoid the large error caused by a single image, and the calculation using spatial distribution can more accurately express the mixing state of microcapsules than plane distribution. Subtract the maximum and minimum values ​​of the microcapsule proportion values ​​of all sampling points contained in the possible mixing period, and the difference obtained is the maximum proportion fluctuation of the microcapsules in the possible mixing period, that is, the microcapsule proportion fluctuation value, which can reflect whether the mixing uniformity of the microcapsules in the possible mixing period is stable, and further judge whether the microcapsules are mixed uniformly. For example, if the fluctuation value of the pellet ratio in the possible mixing period is less than 0.025, it can be considered that the fluctuation of the pellet ratio in the possible mixing period is small, which can be used as a reference condition for determining the pellet mixing endpoint. Otherwise, it is considered that the fluctuation of the pellet ratio in the possible mixing period is large and is not suitable as the pellet mixing endpoint.

[0120] This embodiment further screens possible mixing periods by the fluctuation of the proportion of pellets, and determines whether the proportion of pellets in the possible mixing period is stable to determine whether the possible mixing period can be determined as the end point of pellet mixing, so that possible mixing periods formed accidentally can be excluded.

[0121] An optional implementation of this embodiment is: Fig.10 This is a flow chart for calculating the micro-pill ratio fluctuation value in a micro-pill mixing endpoint detection method based on machine vision according to Example 6 of the present invention, as shown in Fig.10 As shown, calculating the pellet quantity fluctuation value specifically includes the following steps:

[0122] S810, respectively calculating the total number of all types of pellets in each image of all images of each sampling point included in the possible mixing period;

[0123] S820, accumulating the total number of all types of pellets in all images of each sampling point to obtain the total number of all types of pellets at each sampling point;

[0124] S830, subtracting the maximum and minimum values ​​of the total number of all types of pellets at all sampling points included in the possible mixing period to obtain a pellet number fluctuation value.

[0125] In order to consider the spatial distribution of microcapsules, the total number of all types of microcapsules in each image of all images corresponding to each sampling point is calculated, and then the total number of all types of microcapsules in all images is accumulated, and the sum of the total number of all types of microcapsules after accumulation is calculated as the total number of all types of microcapsules at the sampling point, which can avoid the large error caused by a single image, and calculate the number of all microcapsules in the space, which can more accurately express the mixing state of the microcapsules. The maximum and minimum values ​​of the total number of all types of microcapsules in all sampling points contained in the possible mixing period are subtracted, and the difference obtained is the maximum number fluctuation of the microcapsules in the possible mixing period, that is, the microcapsules number fluctuation value, which can reflect whether the mixing uniformity of the microcapsules in the possible mixing period is stable, and further judge whether the microcapsules are mixed uniformly. Exemplarily, if the microcapsules number fluctuation value in the possible mixing period is less than 600, it can be considered that the microcapsules number value in the possible mixing period fluctuates less, which can be used as a reference condition for determining the end point of microcapsules mixing. Otherwise, it is considered that the microcapsules number in the possible mixing period fluctuates more, which is not suitable as the mixing end point of microcapsules.

[0126] The possible mixing periods are further screened through the fluctuations in the proportion and number of microcapsules. Whether the proportion and number of microcapsules in the possible mixing period are stable is used to determine whether the possible mixing period can be determined as the microcapsules mixing endpoint. The possible mixing period formed accidentally is excluded to avoid determining an unreasonable microcapsules mixing endpoint.

[0127] Embodiment 7

[0128] This embodiment is optimized based on the above embodiment. In this embodiment, the number of each type of micro-pills identified is specifically optimized as follows: the image information is processed by color recognition, and the micro-pill areas of different colors are distinguished by the RGB chromaticity values ​​of the pixels in the image.

[0129] When performing machine vision processing on the collected image information, the RGB chromaticity values ​​can be used to identify the chromaticity values ​​of different color channels, and then distinguish the areas of different colors in the image, screen the areas corresponding to the colors dyed by the micropills, deduct other areas, distinguish the micropill areas of different colors, and calculate the number of micropill areas of each color as the number of graphic individuals of the dyed color and the corresponding micropill in the image.

[0130] An optional implementation of the present embodiment is that the center of gravity of each identified individual micropill graphic includes: establishing a plane rectangular coordinate system with the first pixel point in the lower left corner of the image information as the origin, processing the image information using contour extraction, identifying the contour of each individual micropill graphic and determining the center of gravity of the graphic.

[0131] The contour extraction technology is used to determine the contour of each individual micropill graphic, and the center of gravity of each individual micropill graphic is determined using the established plane rectangular coordinate system, which is used as a reference for judging the distribution of micropills.

[0132] This embodiment uses the color recognition and contour extraction technology of machine vision to identify the images of the collected samples at different height planes, which can effectively distinguish the dyed microcapsules in the graphics and determine the accurate contours of the microcapsules. It can provide an accurate number of microcapsules for the calculation process of the microcapsules mixing endpoint, and calculate the proportion of microcapsules using the microcapsules distribution circle determined by the center of gravity of the individual microcapsules graphics, which is conducive to the accurate calculation of the microcapsules mixing endpoint.

[0133] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for detecting the endpoint of pellet mixing based on machine vision, characterized in that: include: The number of each type of pellets is identified using the image information collected during the pellet mixing process, and the quantity ratio between different types of pellets is calculated; Using the quantity ratio to select a possible mixing time period set; The center of gravity of each individual pellet pattern identified by the image information collected during the pellet mixing process is used as the center of the circle to determine the pellet distribution circle of each pellet, and the pellet ratio value of the sum of the areas of all pellet distribution circles in the image information to the total area of ​​the image information is calculated; Calculate the difference between the maximum and minimum values ​​of the pellet proportion value in all image information corresponding to each possible mixing time period in the possible mixing time period set as the pellet proportion fluctuation value, and the difference between the maximum and minimum values ​​of the total number of all types of pellets as the pellet number fluctuation value; The possible mixing periods are screened and concentrated, and the possible mixing periods satisfying the conditions that the fluctuation value of the pellet proportion is less than the threshold value of the pellet proportion and the fluctuation value of the pellet quantity is less than the threshold value of the pellet quantity are simultaneously screened, and the earliest time point of the earliest mixing period is determined as the mixing endpoint.

2. The method according to claim 1, characterized in that The image information collected during the pellet mixing process includes: During the pellet mixing process, samples obtained according to preset rules are imaged at multiple evenly spaced planes of the sample.

3. The method according to claim 2, characterized in that The preset rules include: After the pellet mixing process started, sampling was performed at intervals of 1 minute as a sampling point.

4. The method according to claim 3, characterized in that The calculation of the quantity ratio between different types of pellets includes: Identify the number of each type of pellets in each image corresponding to each sampling point; Calculate the sum of the number of each type of micropellets in all images corresponding to each sampling point as the total number of each type of micropellets at each sampling point; The total number of each type of pellets at each sampling point was compared to obtain the quantity ratio between different types of pellets at each sampling point.

5. The method according to claim 3, characterized in that: The method of screening possible mixing time period sets by using the quantity ratio includes: Compare the quantity ratio in the image information of each sampling point with a preset first ratio value and a preset second ratio value, respectively, and select sampling points whose quantity ratio is greater than the first ratio value and less than the second ratio value; The time period included in the continuous sampling points among the screened sampling points is determined as the possible mixing time period.

6. The method according to claim 1, characterized in that Determining the pellet distribution circle of each pellet comprises: Determine the distance between the center of gravity of each micro-pill pattern individual and the center of gravity of its nearest micro-pill pattern individual, use 1 / 2 of the distance as the radius, and draw a circle with the center of gravity of each micro-pill pattern individual as the center.

7. The method according to claim 3, characterized in that The fluctuation value of the pellet ratio includes: Calculating the sum of the areas of the pellet distribution circles in each image in all images of each sampling point included in the possible mixing period; The sum of the pellet distribution circle areas of all images at each sampling point is added up and compared with the sum of the areas of all images to obtain the pellet ratio value at each sampling point; The maximum and minimum values ​​of the pellet proportion values ​​of all sampling points included in the possible mixing period are subtracted to obtain the pellet proportion fluctuation value.

8. The method according to claim 3, characterized in that The pellet quantity fluctuation values ​​include: Calculate the total number of all types of pellets in each image in all images of each sampling point included in the possible mixing period; The total number of all types of pellets in all images of each sampling point is accumulated to obtain the total number of all types of pellets at each sampling point; The maximum and minimum values ​​of the total number of all types of pellets at all sampling points included in the possible mixing period are subtracted to obtain the pellet number fluctuation value.

9. The method according to claim 1, characterized in that: The number of each type of pellets identified includes: Color recognition is used to process image information, and the micropellet areas of different colors are distinguished through the RGB chromaticity values ​​of the pixels in the image.

10. The method according to claim 1, characterized in that The center of gravity of each identified individual pellet graphic includes: The first pixel point in the lower left corner of the image information is used as the origin to establish a plane rectangular coordinate system, and the image information is processed using contour extraction to identify the contour of each individual micropill graphic and determine the center of gravity of the graphic.