Rapid detection method for particle size distribution of matcha powder based on hyperspectral imaging
Patent Information
- Application Number
- CN202611225806.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]本发明旨在至少在一定程度上解决现有技术中的技术问题之一,通过激光粒度仪提取用于高光谱测试的抹茶粉的粒度分布曲线,然后通过高光谱相机检测测试粉堆的数据立方体,提取数据立方体中每个像素点的光谱曲线,基于光谱曲线对数据立方体中的像素点进行分组,构成粒度组,再对处于同一粒度组中的光谱曲线进行融合,得到粒度组的光谱融合曲线,然后提取粒度组的光谱融合曲线的光谱特征,得到粒度组的粒度光谱特征,再基于测试粉堆的粒度分布曲线计算各粒度组对应的抹茶粉粒度,最后分析粒度光谱特征与抹茶粉粒度之间粒度映照关系并基于粒度映照关系对抹茶粉粒度的分布进行快速检测,以解决现有的抹茶粉粒度分布检测技术难以对大量的抹茶粉进行实时粒度检测,常采用抽样法检测抹茶粉的粒度分布,导致无法对抹茶粉的实际生产品质进行精确把控的问题
[0015]本发明的有益效果:本发明通过激光粒度仪提取用于高光谱测试的抹茶粉的粒度分布曲线,然后通过高光谱相机检测测试粉堆的数据立方体,提取数据立方体中每个像素点的光谱曲线,基于光谱曲线对数据立方体中的像素点进行分组,构成粒度组,再对处于同一粒度组中的光谱曲线进行融合,得到粒度组的光谱融合曲线,然后提取粒度组的光谱融合曲线的光谱特征,得到粒度组的粒度光谱特征,优势在于,采用高光谱成像技术实时提取并分析视觉图像中每个像素点在不同波长处的特性,而抹茶粉不同的粒度存在不同的特性,且在生存过程中同一幅图像中的抹茶粉的粒度一定是不均匀的,为分析每种粒度在高光谱成像中的特征,需要为像素点分组,即划分粒度组,同一粒度组中的像素点处的抹茶粉的粒度高度相似,将它们的光谱曲线融合后即可得到代表该粒度水平的光谱融合曲线,然后提取光谱融合曲线的特征,用于后续分析粒度光谱特征与抹茶粉粒度之间的关系,提高了抹茶粉粒度分布检测的实时性以及全面性;
Smart Images

Figure CN122961860A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of matcha powder particle size distribution detection technology, specifically a rapid detection method for matcha powder particle size distribution based on hyperspectral imaging. Background Technology
[0002] Matcha powder particle size distribution detection technology refers to a set of analytical methods that measure the mass or volume percentage of different sized particles in matcha powder through specific physical or optical methods, thereby quantifying its overall coarseness and uniformity in the form of data and charts.
[0003] In actual manufacturing, to ensure that matcha powder performs well in terms of color, suspension, and flavor release, it is usually necessary to ensure that the particle size of the matcha powder meets certain conditions. However, existing matcha powder particle size distribution detection technologies are generally insufficient to detect the particle size distribution of large quantities of matcha powder on the production line. Instead, they can only detect a small amount of matcha powder, generalizing from a small sample to a large sample. This method cannot accurately control the actual production quality of matcha powder, and there is a certain time lag in the detection process, making real-time detection of matcha powder impossible. Without real-time detection, quality problems in matcha powder cannot be dealt with in a timely manner. Existing matcha powder particle size distribution detection technologies are unable to perform real-time particle size detection on large quantities of matcha powder, and often use sampling methods to detect the particle size distribution of matcha powder, resulting in the inability to accurately control the actual production quality of matcha powder. Summary of the Invention
[0004] This invention aims to at least partially solve one of the technical problems in the prior art. It extracts the particle size distribution curve of matcha powder for hyperspectral testing using a laser particle size analyzer. Then, it detects the data cube of the test powder pile using a hyperspectral camera, extracting the spectral curve of each pixel in the data cube. Based on the spectral curves, the pixels in the data cube are grouped to form particle size groups. The spectral curves within the same particle size group are then fused to obtain the spectral fusion curve of the particle size group. The spectral characteristics of the spectral fusion curve of the particle size group are then extracted to obtain the particle size spectral characteristics of the particle size group. Based on the particle size distribution curve of the test powder pile, the particle size of the matcha powder corresponding to each particle size group is calculated. Finally, the particle size mapping relationship between the particle size spectral characteristics and the matcha powder particle size is analyzed, and the particle size distribution of the matcha powder is rapidly detected based on this mapping relationship. This addresses the problem that existing matcha powder particle size distribution detection technologies struggle to perform real-time particle size detection on large quantities of matcha powder, often relying on sampling methods, which prevents precise control over the actual production quality of the matcha powder.
[0005] To achieve the above objectives, this application provides a rapid detection method for the particle size distribution of matcha powder based on hyperspectral imaging, comprising the following steps: The particle size distribution curve of matcha powder for hyperspectral testing was extracted using a laser particle size analyzer. Data cubes of test powder piles were detected using a hyperspectral camera; Extract the spectral curve of each pixel in the data cube, and group the pixels in the data cube based on the spectral curve to form granularity groups; The spectral curves in the particle size group are fused to obtain the spectral fusion curve. Then, the spectral features of the spectral fusion curve are extracted and named particle size spectral features. The relationship between particle size spectral characteristics and matcha powder particle size was analyzed and named the particle size mapping relationship. At the same time, the particle size distribution of matcha powder was rapidly detected based on the particle size mapping relationship.
[0006] Furthermore, the particle size distribution curve of the matcha powder used for hyperspectral testing was extracted using a laser particle size analyzer. Specifically, a batch of matcha powder was prepared as a test powder pile, and the test powder pile was tested using a laser particle size analyzer to extract the particle size distribution curve of the matcha powder.
[0007] Furthermore, the data cube of the test powder pile is detected by a hyperspectral camera by spreading and spreading the matcha powder in the test powder pile evenly in the shooting area, taking pictures of the shooting area with a hyperspectral camera, and outputting the data cube of the test powder pile.
[0008] Further, the spectral curve of each pixel in the data cube is extracted, and the pixels in the data cube are grouped based on the spectral curves to form granularity groups, including the following sub-steps: The grayscale images in the data cube are labeled according to wavelength from low to high, using the symbol G. h It means that the G h In this context, h is the subscript of G and h is a positive integer, represented by the symbol WT. h G represents h The corresponding wavelength; Let i be the row number of the pixel, j be the column number of the pixel, and P be the symbol. i,j This represents the pixel in the i-th row and j-th column of the data cube, and is also represented by the symbol GP. h,i,j G represents h China P i,j grayscale value; Extract P i,j The spectral curve, wherein the X-axis of the spectral curve is the wavelength, i.e., WT. h The Y-axis represents the grayscale value, i.e., GP. h,i,j And the spectral curve is determined by coordinate points (WT) h ,GP h,i,j (This is obtained by connecting with a smooth curve.) Get coordinates (WT) h ,GP h,i,j ) and (WT h+1 ,GPh+1,i,j The slope between the two waves is named the interwave characteristic and denoted by the symbol KP. h This indicates that P is extracted. i,j The spectral curves of all KP h The eigenvectors are composed of max(h)-1 dimensions, with E as the symbol. i,j P represents i,j eigenvectors; Calculate E i,j With E i,j+1 KP with the same h h The absolute value of the difference is named the one-dimensional bias. The sum of the one-dimensional biases for all values of h is calculated and named the total characteristic bias. Analyze all P... i,j Total characteristic deviation; The total feature deviation is analyzed by clustering algorithm, and the deviation cluster is output. The deviation cluster with the smallest total feature deviation is named the same-granularity cluster, and the maximum value of the total feature deviation in the same-granularity cluster is named the same-group threshold. Calculate any two P i,j The total feature deviation between two P values that are less than or equal to the threshold of the same group is considered. i,j They are divided into the same granularity group, and if there is any overlap between different granularity groups, they can be merged.
[0009] Furthermore, the spectral curves in the particle size groups are fused to obtain a fused spectral curve. The spectral features of the fused spectral curve are then extracted and named as particle size spectral features. This process includes the following sub-steps: By fusing spectral curves within the same particle size group, a spectral fusion curve for the particle size group is obtained. The spectral characteristics of the spectral fusion curves of the particle size groups are extracted to obtain the particle size spectral characteristics of the particle size groups.
[0010] Furthermore, fusing spectral curves within the same particle size group to obtain a fused spectral curve for that particle size group includes the following sub-steps: Spectral curves belonging to the same particle size group are named as curves of the same group. Extracting GP from the same set of curves h,i,j The average value is calculated to obtain the average gray value of the particle size group; The Y-axis in the spectral curve is changed from GP h+1,i,j Replace with the group average gray level and reconstruct the spectral curve to obtain the spectral fusion curve of the particle size group.
[0011] Further, the spectral features of the spectral fusion curves of the particle size groups are extracted to obtain the particle size spectral features of the particle size groups, including the following sub-steps: Extracting interwavelength features (KP) from spectral fusion curves h With wavelength WT h The horizontal axis represents the interwave characteristic KP.h Establish a coordinate system for the vertical axis, named the particle size characteristic analysis chart, and set KP... h According to the WT corresponding to h h Enter the particle size feature analysis chart; Perform a multinomial regression on the particle size characteristic analysis diagram and name the regression curve the spectral characteristic curve. Connect the two ends of the spectral characteristic curve with a straight line and name the connecting line the characteristic auxiliary line. The spectral characteristic curve and the characteristic auxiliary line form a closed region, which is named the spectral characteristic region. Obtain the area of the spectral characteristic region and name it the particle size spectral characteristic.
[0012] Furthermore, the relationship between particle size spectral characteristics and matcha powder particle size was analyzed and named the particle size mapping relationship. Based on this relationship, a rapid detection of matcha powder particle size distribution was performed, including the following sub-steps: The particle size of matcha powder for each particle size group was calculated based on the particle size distribution curve of the test powder pile. The particle size mapping relationship between particle size spectral characteristics and matcha powder particle size was analyzed, and the particle size distribution of matcha powder was rapidly detected based on the particle size mapping relationship.
[0013] Furthermore, calculating the matcha powder particle size corresponding to each particle size group based on the particle size distribution curve of the test powder pile includes the following sub-steps: The number of granularity groups is counted and named as the number of granularity groups. Simultaneously, the P value within each granularity group is counted. i,j The number of these numbers is named the group number. The particle size distribution curve has the matcha powder particle size on the X-axis and the frequency on the Y-axis. The particle size distribution curve of the test powder pile is evenly divided into several particle groups on the X-axis dimension, and the resulting curve is named the evenly divided curve. Obtain the median of the equal distribution curve on the X-axis and name it the equal distribution reference granularity. At the same time, name the frequency of the equal distribution curve at the equal distribution reference granularity the equal distribution reference distribution. The particle size groups are sorted and numbered in ascending order of the number within the same group, using the symbol Q1. t This indicates that the average curves are sorted and numbered in ascending order according to the average reference distribution, denoted by the symbol Q2. t This indicates that Q1 t and Q2 t In this context, t represents the indices of Q1 and Q2, and t is a positive integer; With the symbol L t Indicates Q2 t The average reference particle size, particle size group Q1 t The particle size of matcha powder is L. t .
[0014] Furthermore, the analysis of the particle size mapping relationship between particle size spectral characteristics and matcha powder particle size, and the rapid detection of matcha powder particle size distribution based on the particle size mapping relationship, includes the following sub-steps: A coordinate system was established with the particle size spectral characteristics of the particle size group as the horizontal axis and the matcha powder particle size as the vertical axis, named the Particle Size Comparison Analysis Chart. t According to Q1 t The corresponding particle size spectral characteristics are entered into the particle size comparison analysis chart; Regression analysis was performed on the particle size comparison chart, and the regression function was named the particle size mapping relationship. A hyperspectral camera was added after the matcha powder production line to detect the particle size groups of matcha powder in real time, which were named real-time groups. At the same time, the particle size spectral features of the real-time groups were extracted and named real-time spectral features. The real-time spectral features were substituted into the particle size mapping relationship to solve for the group particle size. The number of pixels in the real-time group is counted and named the group pixel count. At the same time, the total number of pixels in a grayscale image in the data cube is counted and named the total pixel count. The proportion of the real-time group in the data cube is calculated by dividing the group pixel count by the total pixel count and named the granularity proportion. A coordinate system was established with the group particle size as the X-axis and the particle size percentage as the Y-axis, named the Particle Size Quick Detection Distribution Chart. The particle size percentage was entered into the Particle Size Quick Detection Distribution Chart according to the group particle size. At the same time, the coordinate points in the Particle Size Quick Detection Distribution Chart were connected by a smooth curve to obtain the particle size distribution curve of the matcha powder in this test.
[0015] The beneficial effects of this invention are as follows: This invention extracts the particle size distribution curve of matcha powder for hyperspectral testing using a laser particle size analyzer. Then, it detects the data cube of the test powder pile using a hyperspectral camera, extracts the spectral curve of each pixel in the data cube, groups the pixels in the data cube based on the spectral curves to form particle size groups, and then fuses the spectral curves within the same particle size group to obtain the spectral fusion curve of the particle size group. Finally, it extracts the spectral features of the spectral fusion curve of the particle size group to obtain the particle size spectral features of the particle size group. The advantage lies in using hyperspectral imaging technology to extract and analyze each pixel in the visual image in real time. The characteristics of pixels at different wavelengths are different from those of matcha powder at different particle sizes. Furthermore, the particle size of matcha powder in the same image is bound to be non-uniform during the survival process. To analyze the characteristics of each particle size in hyperspectral imaging, it is necessary to group the pixels, i.e., divide them into particle size groups. The particle size of matcha powder at the pixels in the same particle size group is highly similar. By fusing their spectral curves, a spectral fusion curve representing the particle size level can be obtained. Then, the features of the spectral fusion curve are extracted for subsequent analysis of the relationship between particle size spectral features and matcha powder particle size, which improves the real-time performance and comprehensiveness of matcha powder particle size distribution detection. This invention calculates the particle size of matcha powder corresponding to each particle size group based on the particle size distribution curve of the test powder pile. Finally, it analyzes the particle size mapping relationship between the particle size spectral characteristics and the matcha powder particle size, and performs rapid detection of the matcha powder particle size distribution based on the particle size mapping relationship. The advantage is that the difference in the number of pixels in the particle size group corresponds to the particle size distribution of matcha powder to a certain extent. This allows the particle size group to correspond to the matcha powder particle size on the particle size distribution curve. Then, the particle size mapping relationship between the particle size spectral characteristics and the matcha powder particle size is analyzed, and the matcha powder particle size at the pixel is determined by the particle size spectral characteristics. Then, the particle size distribution is analyzed, thereby realizing real-time detection of the matcha powder particle size distribution and improving the real-time performance and effectiveness of matcha powder particle size distribution detection.
[0016] Advantages of additional aspects of the invention will be set forth in part in the detailed description of the invention below, and in part will be obvious from the description or may be learned by practice of the invention. Attached Figure Description
[0017] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart illustrating the steps of the method of the present invention; Figure 2 This is a schematic diagram of the particle size distribution curve of the present invention; Figure 3 This is a schematic diagram of the spectral curve of the present invention; Figure 4 This is a schematic diagram of the particle size characteristic analysis diagram of the present invention; Figure 5 This is a schematic diagram of the feature auxiliary lines of the present invention; Figure 6 This is a schematic diagram of the equal distribution curve of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Example 1, please refer to Figure 1 As shown, this application provides a rapid detection method for the particle size distribution of matcha powder based on hyperspectral imaging, including the following steps: Please see Figure 2As shown, in step S1, the particle size distribution curve of the matcha powder used for hyperspectral testing is extracted using a laser particle size analyzer; specifically, a batch of matcha powder is prepared as a test powder pile, and the test powder pile is tested using a laser particle size analyzer to extract the particle size distribution curve of the matcha powder. In practice, laser particle size analyzers require cumbersome pre-processing steps and time to wait for test results. Since matcha powder production is real-time, laser particle size analyzers are not suitable for real-time detection of matcha powder particle size distribution. This embodiment uses the test results of a portion of matcha powder obtained by laser particle size analyzer as a reference to extract the relationship between the characteristics of matcha powder and particle size in hyperspectral imaging. Since laser particle size analyzers are existing testing instruments, they will not be described in detail in this embodiment. The X-axis of the particle size distribution curve represents the matcha powder particle size, and the Y-axis represents the frequency. The higher the frequency, the greater the proportion of matcha powder particle size corresponding to that frequency. For example, the particle size distribution curve of a certain batch of matcha powder is as follows: Figure 2 As shown, during the testing process, multiple batches of matcha powder need to be prepared as test powder piles to provide sufficient basic data.
[0020] Step S2: Detect the data cube of the test powder pile using a hyperspectral camera; specifically, spread and spread the matcha powder in the test powder pile evenly in the shooting area, take pictures of the shooting area using a hyperspectral camera, and output the data cube of the test powder pile. In practice, the data cube captured by the hyperspectral camera is actually composed of images of the captured area at different wavelengths. When processed by a computer, these images are usually converted into grayscale images. Therefore, the data cube contains grayscale images of different wavelengths. For example, the hyperspectral camera used in this embodiment acquires spectral images of 150 bands in the range of 600nm to 1200nm. That is, the data cube contains 150 grayscale images of the captured area at different wavelengths, and the wavelength difference between any two adjacent grayscale images is 4nm.
[0021] Step S3: Extract the spectral curve of each pixel in the data cube, and group the pixels in the data cube based on the spectral curves to form granularity groups; Step S3 includes the following sub-steps: Step S301: Label the grayscale images in the data cube according to wavelength from low to high, using the symbol G. h It is said that G h In this context, h is the subscript of G and h is a positive integer, represented by the symbol WT. h G represents h The corresponding wavelength; Step S302, using i as the row number of the pixel and j as the column number of the pixel, and using the symbol P i,j This represents the pixel in the i-th row and j-th column of the data cube, and is also represented by the symbol GP. h,i,j G represents h China Pi,j grayscale value; In practice, G is obtained through labeling. h And 1≤h≤150, and WT is obtained at the same time. h And WT h Compared to WT h+1 For example, the resolution of the hyperspectral camera in this embodiment is 200×300, i.e., 1≤i≤200, 1≤j≤300, and P is labeled as 4nm. i,j At the same time, you can also get GP h,i,j The ranges of h, i, and j remain the same as those mentioned above.
[0022] Please see Figure 3 As shown, in step S303, extract P i,j The spectral curve, with the X-axis representing the wavelength, i.e., WT. h The Y-axis represents the grayscale value, i.e., GP. h,i,j And the spectral curve is derived from the coordinate point (WT) h ,GP h,i,j (This is obtained by connecting with a smooth curve.) Step S304, obtain coordinate points (WT) h ,GP h,i,j ) and (WT h+1 ,GP h+1,i,j The slope between the two waves is named the interwave characteristic and denoted by the symbol KP. h This indicates that P is extracted. i,j The spectral curves of all KP h The eigenvectors are composed of max(h)-1 dimensions, with E as the symbol. i,j P represents i,j eigenvectors; In practice, conventional data cubes contain too many dimensions and a large number of invalid wavelengths, leading to low analysis efficiency. Therefore, to improve analysis efficiency, a successive projection algorithm is used to reduce the dimensionality of the data cube during actual detection. In this embodiment, after reducing the dimensionality of a 150-dimensional data cube using the successive projection algorithm, five key wavelengths are finally obtained: 432nm, 520nm, 652nm, 748nm, and 980nm, corresponding to WT9 and WT200nm, respectively. 31 WT 64 WT 88 and WT 146 At this point, the possible values of h are only 9, 31, 64, 88, and 146. For ease of subsequent calculation and analysis, 9, 31, 64, 88, and 146 are reset to 1, 2, 3, 4, and 5, respectively. After the reset, 1 ≤ h ≤ 5. The original WT9 and WT... 31 WT 64 WT88 and WT 146 The corresponding nm wavelengths are 432nm, 520nm, 652nm, 748nm, and 980nm. These correspond to the reset WT1, WT2, WT3, WT4, and WT5 as 432nm, 520nm, 652nm, 748nm, and 980nm, respectively. All other values are discarded. (The last part, "P," appears to be a typo and can be omitted.) 1,1 For example, to obtain P 1,1 The spectral curve is as follows Figure 3 As shown, the coordinates of the point (WT) h ,GP h,1,1 Following the order of h from 1 to 5, we get (432, 145), (520, 133), (652, 128), (748, 164), and (980, 185), respectively. This yields KP1 to KP5 values of -0.1364, -0.0379, 0.375, and 0.0905, respectively. At this point, we obtain E. 1,1 The values are (-0.1364 -0.0379 0.375 0.0905).
[0023] Step S305, calculate E i,j With E i,j+1 KP with the same h h The absolute value of the difference is named the one-dimensional bias. The sum of the one-dimensional biases for all values of h is calculated and named the total characteristic bias. Analyze all P... i,j Total characteristic deviation; Step S306: Analyze the total feature deviation using a clustering algorithm, output the deviation clusters, name the deviation cluster with the smallest total feature deviation as the same-granularity cluster, and name the maximum value of the total feature deviation in the same-granularity cluster as the same-group threshold. In practice, the particle size distribution of a batch of matcha powder is uneven, but there will always be two adjacent pixels with the same particle size, while there will also be two adjacent pixels with significantly different particle sizes. Therefore, cluster analysis is used to divide them. Objects in the same cluster are highly similar, while objects in different clusters are significantly dissimilar. If two objects have highly similar particle sizes, then their grayscale values at different wavelengths should also be similar, i.e., their KP (Knowledge, Price, and Quantity) ratios should be similar. h They are very close, by calculating the KP between them. hThe sum of the differences can reveal their dissimilarity. Then, by classifying this dissimilarity through cluster analysis, we can obtain the bias cluster. The total feature deviation between highly similar pixels should be the smallest. Therefore, the bias cluster with the smallest total feature deviation is taken as the same-granularity cluster, which means that the granularity of the pixels in the cluster is highly similar and can be approximately considered to be equal. Then, the maximum value of the total feature deviation is taken as the same-group threshold to determine whether the granularity between two pixels is highly similar. The calculation process of the total feature deviation is relatively simple and clear, and will not be described in detail in this embodiment. The same-group threshold is only calculated in the testing phase and does not need to be calculated again after actual use.
[0024] Step S307, calculate any two P i,j The total feature deviation between two P values is defined as follows: the total feature deviation is less than or equal to the threshold of the same group. i,j They are divided into the same granularity group, and if there is any overlap between different granularity groups, they can be merged. In practice, for example, the final calculated threshold for the same group during the testing phase is 0.1066. However, after actual implementation, the threshold is calculated by assigning values to P in ascending order of i and j. i,j Make a judgment, using P 1,1 For example, if P 1,1 With P 1,2 If the total deviation of the features is less than or equal to the threshold of the same group, then P will be... 1,1 With P 1,2 Divided into a granularity group, at this time due to P 1,2 The particle size groups have been defined, so the analysis can be skipped and P can be analyzed directly. 1,3 Now let's analyze P. 1,3 With P 1,1 Are they in the same particle size group? If so, then set P... 1,1 P 1,2 and P 1,3 Divide into a granularity group; if not, re-evaluate in the direction of increasing j, but due to P 1,1 With P 1,2 Being in the same particle size group, and P 1,3 P has been included in it 1,1 The analysis is complete, so P can be skipped. 1,3 With P 1,2 This analysis reduces the number of iterations and improves efficiency. Similarly, for all P... i,j Perform analysis and classify the particle size groups.
[0025] Step S4 involves fusing the spectral curves in the particle size group to obtain a fused spectral curve, and then extracting the spectral features of the fused spectral curve, which are named particle size spectral features. Step S4 includes the following sub-steps: Step S401: Merge the spectral curves in the same particle size group to obtain the spectral fusion curve of the particle size group; Step S401 includes the following sub-steps: Step S401.a: Name the spectral curves that are in the same particle size group as the same group curves; Step S401.b: Extract the GP of the same group of curves. h,i,j The average value is calculated to obtain the average gray value of the particle size group; Step S401.c, change the Y-axis in the spectral curve from GP h+1,i,j Replace with the group average gray level and reconstruct the spectral curve to obtain the spectral fusion curve of the particle size group; In practice, the spectral curves of pixels within the same granularity group are highly similar, so they can be fused. The fused spectral curve is then used as the representative spectral curve for that granularity group, and the GP (spectral density) of the curves in the same group is extracted. h,i,j And calculate the average value to obtain the group average gray level of the granularity group. In fact, it is to calculate the average gray level of the pixels in the same granularity group in WT. h Average the gray values along the wavelength dimension, then reposition the Y-axis of the spectral curve from GP. h+1,i,j Replacing it with the group average gray level and reconstructing the spectral curve is essentially... Figure 3 The Y-axis of the coordinate points shown is replaced with WT. h The corresponding group average gray level is determined, and then the coordinate points are connected by a smooth curve to obtain a similar result. Figure 3 The spectral fusion curve.
[0026] Step S402: Extract the spectral features of the spectral fusion curve of the particle size group to obtain the particle size spectral features of the particle size group; Step S402 includes the following sub-steps: Please see Figure 4 As shown, in step S402.a, the interwavelength feature KP in the spectral fusion curve is extracted. h With wavelength WT h The horizontal axis represents the interwave characteristic KP. h Establish a coordinate system for the vertical axis, named the particle size characteristic analysis chart, and set KP... h According to the WT corresponding to h h Enter the particle size feature analysis chart; Step S402.b: Perform multinomial regression on the particle size characteristic analysis diagram and name the regression curve the spectral characteristic curve; Please see Figure 5 As shown in step S402.c, the two ends of the spectral feature curve are connected by a straight line, and the connecting line is named the feature auxiliary line. The spectral feature curve and the feature auxiliary line form a closed region, which is named the spectral feature region. The area of the spectral feature region is obtained and named the particle size spectral feature.
[0027] In specific implementation, the granularity feature analysis diagram is constructed as follows: Figure 4 As shown, at the same time, Figure 4 The curve shown is the spectral characteristic curve, which reveals the key points (KP) of pixels within a grain size group. h The curvature of the curve is closely related to the changing trend of the spectral characteristic curve, while the horizontal axis range of the spectral characteristic curve is fixed. Therefore, the area of the spectral characteristic region is only related to the curvature of the spectral characteristic curve and the KP value within it. h The changing trend is related to this, and this is used as the particle size spectral characteristic of the particle size group. Connecting these features yields auxiliary characteristic lines, such as... Figure 5 As shown, Figure 5 The black straight line in the diagram is the feature auxiliary line, and Figure 5 The closed region in the image is the spectral feature region. The particle size spectral feature can be obtained by obtaining the area of the spectral feature region.
[0028] Step S5 involves analyzing the relationship between particle size spectral characteristics and matcha powder particle size, termed the particle size mapping relationship. Simultaneously, based on this relationship, a rapid detection of matcha powder particle size distribution is performed. Step S5 includes the following sub-steps: Step S501: Calculate the matcha powder particle size corresponding to each particle size group based on the particle size distribution curve of the test powder pile. Step S501 includes the following sub-steps: Step S501.a: Count the number of particle size groups and name them as the number of particle size groups. At the same time, count the P in the particle size group. i,j The number of these numbers is named the group number. Please see Figure 6 As shown in step S501.b, the X-axis of the particle size distribution curve represents the particle size of matcha powder, and the Y-axis represents the frequency. The particle size distribution curve of the test powder pile is evenly divided into several particle groups on the X-axis dimension, and the resulting curve is named the evenly divided curve. Step S501.c: Obtain the median of the equal distribution curve on the X-axis and name it the equal distribution reference granularity. At the same time, name the frequency of the equal distribution curve at the equal distribution reference granularity as the equal distribution reference distribution. In specific implementation, for example, after analyzing a certain test powder pile in this embodiment, the number of particle groups extracted is 8, which are represented by the symbols U1, U2, U3, U4, U5, U6, U7, and U8. The corresponding numbers of the same group are 2693, 4259, 5488, 6596, 7892, 9056, 10684, and 13332, respectively. The particle size distribution curve extracted by the laser particle size analyzer is... Figure 2 The particle size distribution curve shown is as follows: Figure 2 The particle size distribution curve in the image ranges from 0 to 40 on the X-axis. Dividing this range [0, 40] into 8 particle groups, we obtain the average distribution curve as shown below. Figure 6 As shown, Figure 6 The curved portion between each two vertical straight lines is a uniformly divided curve, which in this embodiment is represented by symbols V1 to V8 in order from left to right. Figure 6 Taking the average distribution curve in the range of 15 to 20 as an example, its average reference particle size is 17.5. That is, the frequency of the coordinate point with X equal to 17.5 on the average distribution curve of matcha powder particle size between 15 and 20 is obtained, and the average reference distribution is 0.252. Similarly, the average reference particle size and average reference distribution of all average distribution curves are obtained.
[0029] Step S501.d: Sort and number the particle size groups in ascending order of the number within the same group, using the symbol Q1. t This indicates that the average curves are sorted and numbered in ascending order according to the average reference distribution, denoted by the symbol Q2. t It indicates that Q1 t and Q2 t In this context, t represents the indices of Q1 and Q2, and t is a positive integer; Step S501.e, using the symbol L t Indicates Q2 t The average reference particle size, particle size group Q1 t The particle size of matcha powder is L. t ; In practice, in the particle size distribution map, a higher frequency represents a larger proportion of the corresponding particle size. A larger proportion of a particle size corresponds to a larger proportion of the same particle group in the image. This leads to the following correspondence: Q11 to Q18 are U1, U2, U3, U4, U5, U6, U7, and U8, respectively. Then, the average distribution curves are sorted and numbered according to the ascending order of the average distribution reference distribution, resulting in Q21 to Q28 being V8, V1, V2, V7, V3, V6, V4, and V5, respectively. The average reference particle sizes L1 to L8 are 37.5μm, 2.5μm, 7.5μm, 32.5μm, 12.5μm, 27.5μm, 17.5μm and 22.5μm respectively. Thus, the matcha powder particle sizes of U1, U2, U3, U4, U5, U6, U7 and U8 are 37.5μm, 2.5μm, 7.5μm, 32.5μm, 12.5μm, 27.5μm, 17.5μm and 22.5μm respectively.
[0030] Step S502: Analyze the particle size mapping relationship between particle size spectral characteristics and matcha powder particle size, and quickly detect the distribution of matcha powder particle size based on the particle size mapping relationship; Step S502 includes the following sub-steps: Step S502.a: Establish a coordinate system with the particle size spectral characteristics of the particle size group as the horizontal axis and the matcha powder particle size as the vertical axis, and name it the Particle Size Comparison Analysis Chart. (The text then abruptly shifts to a different topic: "L...") tAccording to Q1 t The corresponding particle size spectral characteristics are entered into the particle size comparison analysis chart; Step S502.b: Perform regression analysis on the particle size comparison chart and name the regression function as particle size mapping relationship; In practice, the particle size spectral characteristics of the particle size group reveal the variation characteristics of the gray values of pixels in different wavelength dimensions, which are highly correlated with the particle size of matcha powder within the pixel. The particle size of matcha powder corresponding to the particle size group is obtained through the analysis in step S501. Then, the relationship between matcha powder particle size and particle size spectral characteristics can be obtained through regression model analysis. Due to the large amount of data, it is inconvenient to list the detailed data in this embodiment. Only a part of the data is given as an example. The correspondence between some particle size spectral characteristics and matcha powder particle size obtained in this embodiment is shown in Table 1 below: Table 1. Correspondence between some particle size spectral characteristics and matcha powder particle size Analysis revealed the particle size mapping relationship as Y = 0.5251 × X - 13.624, where Y represents the particle size of the matcha powder and X represents the particle size spectral characteristics.
[0031] Step S502.c: Add a hyperspectral camera to the production line of matcha powder and detect the particle size group of matcha powder in real time, named real-time grouping. At the same time, extract the particle size spectral features of the real-time grouping, named real-time spectral features. Substitute the real-time spectral features into the particle size mapping relationship to solve for the grouping particle size. Step S502.d: Count the number of pixels in the real-time group and name it the group pixel count. At the same time, count the total number of pixels in a grayscale image in the data cube and name it the total pixel count. Calculate the group pixel count divided by the total pixel count to get the proportion of the real-time group in the data cube and name it the granularity proportion. Step S502.e: Establish a coordinate system with the group particle size as the X-axis and the particle size ratio as the Y-axis, and name it Particle Size Quick Detection Distribution Chart. Enter the particle size ratio into the Particle Size Quick Detection Distribution Chart according to the group particle size. At the same time, connect the coordinate points in the Particle Size Quick Detection Distribution Chart with a smooth curve to obtain the particle size distribution curve of matcha powder in this test. In practice, matcha powder is fed at a constant speed through a hyperspectral camera on the production line. The camera captures real-time images of the data cube on the surface of the matcha powder and analyzes its real-time spectral characteristics. Substituting these characteristics into the particle size mapping relationship allows for the calculation of the particle size groups within the matcha powder. A rapid particle size distribution map is then established with the grouped particle size as the X-axis and the particle size percentage as the Y-axis. The particle size percentage is recorded in the rapid particle size distribution map according to the grouped particle size. Simultaneously, a smooth curve is used to connect the coordinate points in the rapid particle size distribution map, resulting in a graph similar to... Figure 5The particle size distribution curve reveals the real-time distribution of matcha powder particles. This eliminates the need for complex processing steps and excessive time for sampling and testing matcha powder. This embodiment achieves high precision and real-time detection, significantly improving the production line's control over matcha powder quality.
[0032] Example 2: This application provides an electronic device, which may include a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores computer-readable instructions, and the processor can call these instructions. When the processor executes a computer-readable instruction, it performs steps such as those in the rapid detection method for matcha powder particle size distribution based on hyperspectral imaging to achieve the following functions: extracting the particle size distribution curve of the matcha powder for hyperspectral testing; detecting the data cube of the test powder pile; extracting the spectral curve of each pixel in the data cube and dividing the pixels in the data cube into particle size groups; fusing the spectral curves in the particle size groups to obtain a spectral fusion curve, and then extracting the particle size spectral features of the spectral fusion curve; analyzing the particle size mapping relationship between the particle size spectral features and the matcha powder particle size, and rapidly detecting the particle size distribution of the matcha powder based on the particle size mapping relationship.
[0033] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0034] Example 3: This application also provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the rapid detection method for matcha powder particle size distribution based on hyperspectral imaging provided by the above methods. The method includes: extracting the particle size distribution curve of matcha powder for hyperspectral testing; detecting a data cube of the test powder pile; extracting the spectral curve of each pixel in the data cube and dividing the pixels in the data cube into particle size groups; fusing the spectral curves in the particle size groups to obtain a spectral fusion curve, and then extracting the particle size spectral features of the spectral fusion curve; analyzing the particle size mapping relationship between the particle size spectral features and the particle size of the matcha powder, and rapidly detecting the particle size distribution of the matcha powder based on the particle size mapping relationship.
[0035] Example 4: This application may also provide a computer-readable storage medium, which, when executed by the processor of a server, enables the server to perform and implement the following functions: extracting the particle size distribution curve of matcha powder for hyperspectral testing; detecting the data cube of the test powder pile; extracting the spectral curve of each pixel in the data cube and dividing the pixels in the data cube into particle size groups; fusing the spectral curves in the particle size groups to obtain a spectral fusion curve, and then extracting the particle size spectral features of the spectral fusion curve; analyzing the particle size mapping relationship between the particle size spectral features and the particle size of the matcha powder, and rapidly detecting the particle size distribution of the matcha powder based on the particle size mapping relationship.
[0036] Furthermore, the computer-readable storage medium provided in this application may be: read-only memory (ROM), random access memory (RAM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD. ROM, CD R, CD+R, CD RW, CD+RW, DVD ROM, DVD R, DVD+R, DVD RW, DVD+RW, DVD RAM, BD ROM, BD R, BD RLTH, BD RE, Blu-ray or optical disc storage, hard disk drive (HDD), solid-state drive (SSD), card storage (such as multimedia cards, secure digital (SD) cards, or ultra-fast digital (XD) cards), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and to provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the aforementioned computer-readable storage medium can run in an environment deployed in computer devices such as clients, hosts, agent devices, servers, etc. Furthermore, in one example, the computer program and any associated data, data files, and data structures are distributed across a networked computer system, such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner through one or more processors or computers.
[0037] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media containing computer-usable program code. These computer program instructions can also be stored in a computer-readable storage medium capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means implemented in a process. Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0038] The above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and are not intended to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the scope of the technology disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the claims.
Claims
1. A rapid detection method for matcha powder particle size distribution based on hyperspectral imaging, characterized in that, Includes the following steps: The particle size distribution curve of matcha powder for hyperspectral testing was extracted using a laser particle size analyzer. Data cubes of test powder piles were detected using a hyperspectral camera; Extract the spectral curve of each pixel in the data cube, and group the pixels in the data cube based on the spectral curve to form granularity groups; The spectral curves in the particle size group are fused to obtain the spectral fusion curve. Then, the spectral features of the spectral fusion curve are extracted and named particle size spectral features. The relationship between particle size spectral characteristics and matcha powder particle size was analyzed and named the particle size mapping relationship. At the same time, the particle size distribution of matcha powder was rapidly detected based on the particle size mapping relationship.
2. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 1, characterized in that, The particle size distribution curve of matcha powder for hyperspectral testing was extracted using a laser particle size analyzer. Specifically, a batch of matcha powder was prepared as a test powder pile, and the test powder pile was tested using a laser particle size analyzer to extract the particle size distribution curve of the matcha powder.
3. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 2, characterized in that, The data cube of the test powder pile is detected by a hyperspectral camera by spreading and spreading the matcha powder in the test powder pile evenly in the shooting area, taking pictures of the shooting area with a hyperspectral camera, and outputting the data cube of the test powder pile.
4. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 3, characterized in that, Extracting the spectral curve of each pixel in the data cube, and grouping the pixels in the data cube into granularity groups based on the spectral curves, includes the following sub-steps: The grayscale images in the data cube are labeled according to wavelength from low to high, using the symbol G. h It means that the G h In this context, h is the subscript of G and h is a positive integer, represented by the symbol WT. h G represents h The corresponding wavelength; Let i be the row number of the pixel, j be the column number of the pixel, and P be the symbol. i,j This represents the pixel in the i-th row and j-th column of the data cube, and is also represented by the symbol GP. h,i,j G represents h China P i,j grayscale value; Extract P i,j The spectral curve, wherein the X-axis of the spectral curve is the wavelength, i.e., WT. h The Y-axis represents the grayscale value, i.e., GP. h,i,j And the spectral curve is determined by coordinate points (WT) h ,GP h,i,j (This is obtained by connecting with a smooth curve.) Get coordinates (WT) h ,GP h,i,j ) and (WT h+1 ,GP h+1,i,j The slope between the two waves is named the interwave characteristic and denoted by the symbol KP. h This indicates that P is extracted. i,j The spectral curves of all KP h The eigenvectors are composed of max(h)-1 dimensions, with E as the symbol. i,j P represents i,j eigenvectors; Calculate E i,j With E i,j+1 KP with the same h h The absolute value of the difference is named the one-dimensional bias. The sum of the one-dimensional biases for all values of h is calculated and named the total characteristic bias. Analyze all P... i,j Total characteristic deviation; The total feature deviation is analyzed by clustering algorithm, and the deviation cluster is output. The deviation cluster with the smallest total feature deviation is named the same-granularity cluster, and the maximum value of the total feature deviation in the same-granularity cluster is named the same-group threshold. Calculate any two P i,j The total feature deviation between two P values is defined as follows: the total feature deviation is less than or equal to the threshold of the same group. i,j They are divided into the same granularity group, and if there is any overlap between different granularity groups, they can be merged.
5. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 4, characterized in that, The spectral curves in the particle size group are fused to obtain a fused spectral curve. The spectral features of the fused spectral curve are then extracted and named as particle size spectral features. The process includes the following sub-steps: By fusing spectral curves within the same particle size group, a spectral fusion curve for the particle size group is obtained. The spectral characteristics of the spectral fusion curves of the particle size groups are extracted to obtain the particle size spectral characteristics of the particle size groups.
6. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 5, characterized in that, The process of fusing spectral curves within the same particle size group to obtain a fused spectral curve for that particle size group includes the following sub-steps: Spectral curves belonging to the same particle size group are named as curves of the same group. Extracting GP from the same set of curves h,i,j The average value is calculated to obtain the average gray value of the particle size group; The Y-axis in the spectral curve is changed from GP h+1,i,j Replace with the group average gray level and reconstruct the spectral curve to obtain the spectral fusion curve of the particle size group.
7. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 6, characterized in that, Extracting the spectral features of the spectral fusion curves of particle size groups to obtain the particle size spectral features of the particle size groups includes the following sub-steps: Extracting interwavelength features (KP) from spectral fusion curves h With wavelength WT h The horizontal axis represents the interwave characteristic KP. h Establish a coordinate system for the vertical axis, named the particle size characteristic analysis chart, and set KP... h According to the WT corresponding to h h Enter the particle size feature analysis chart; Perform a multinomial regression on the particle size characteristic analysis diagram and name the regression curve the spectral characteristic curve. Connect the two ends of the spectral characteristic curve with a straight line and name the connecting line the characteristic auxiliary line. The spectral characteristic curve and the characteristic auxiliary line form a closed region, which is named the spectral characteristic region. Obtain the area of the spectral characteristic region and name it the particle size spectral characteristic.
8. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 7, characterized in that, The relationship between particle size spectral characteristics and matcha powder particle size was analyzed and named the particle size mapping relationship. Based on this relationship, a rapid detection of matcha powder particle size distribution was performed, including the following sub-steps: The particle size of matcha powder for each particle size group was calculated based on the particle size distribution curve of the test powder pile. The particle size mapping relationship between particle size spectral characteristics and matcha powder particle size was analyzed, and the particle size distribution of matcha powder was rapidly detected based on the particle size mapping relationship.
9. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 8, characterized in that, The calculation of the matcha powder particle size corresponding to each particle size group based on the particle size distribution curve of the test powder pile includes the following sub-steps: The number of granularity groups is counted and named as the number of granularity groups. Simultaneously, the number of P granularity groups is counted. i,j The number of these numbers is named the group number. The particle size distribution curve has the matcha powder particle size on the X-axis and the frequency on the Y-axis. The particle size distribution curve of the test powder pile is evenly divided into several particle groups on the X-axis dimension, and the resulting curve is named the evenly divided curve. Obtain the median of the equal distribution curve on the X-axis and name it the equal distribution reference granularity. At the same time, name the frequency of the equal distribution curve at the equal distribution reference granularity the equal distribution reference distribution. The particle size groups are sorted and numbered in ascending order of the number within the same group, using the symbol Q1. t This indicates that the average curves are sorted and numbered in ascending order according to the average reference distribution, using the symbol Q2. t This indicates that Q1 t and Q2 t In this context, t represents the indices of Q1 and Q2, and t is a positive integer; With the symbol L t Indicates Q2 t The average reference particle size, particle size group Q1 t The particle size of matcha powder is L. t .
10. The rapid detection method for matcha powder particle size distribution based on hyperspectral imaging according to claim 9, characterized in that, The analysis of the particle size mapping relationship between particle size spectral characteristics and matcha powder particle size, and the rapid detection of matcha powder particle size distribution based on the particle size mapping relationship, includes the following sub-steps: A coordinate system was established with the particle size spectral characteristics of the particle size group as the horizontal axis and the matcha powder particle size as the vertical axis, named the Particle Size Comparison Analysis Chart. t According to Q1 t The corresponding particle size spectral characteristics are entered into the particle size comparison analysis chart; Regression analysis was performed on the particle size comparison chart, and the regression function was named the particle size mapping relationship. A hyperspectral camera was added after the matcha powder production line to detect the particle size groups of matcha powder in real time, which were named real-time groups. At the same time, the particle size spectral features of the real-time groups were extracted and named real-time spectral features. The real-time spectral features were substituted into the particle size mapping relationship to solve for the group particle size. The number of pixels in the real-time group is counted and named the group pixel count. At the same time, the total number of pixels in a grayscale image in the data cube is counted and named the total pixel count. The proportion of the real-time group in the data cube is calculated by dividing the group pixel count by the total pixel count and named the granularity proportion. A coordinate system was established with the group particle size as the X-axis and the particle size percentage as the Y-axis, named the Particle Size Quick Detection Distribution Chart. The particle size percentage was entered into the Particle Size Quick Detection Distribution Chart according to the group particle size. At the same time, the coordinate points in the Particle Size Quick Detection Distribution Chart were connected by a smooth curve to obtain the particle size distribution curve of the matcha powder in this test.