Analysis method and apparatus for coffee particles, and device and computer-readable storage medium
The vibration source drives the coffee particles to change their distribution, which solves the problem of analysis deviation caused by sticking particles and improves the accuracy of coffee particle size analysis.
Patent Information
- Application Number
- PCT/CN2023/088295
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-22
- Filing Date
- 2023-04-14
- Publication Date
- 2024-09-26
AI Technical Summary
Existing coffee particle size analysis methods have the problem that adhering particles lead to larger measurement results, making it difficult to ensure analysis accuracy.
The vibration source drives the coffee particles to vibrate at least twice to change the particle distribution, and obtains the final identification information through multiple frames of image identification information with different distributions to improve the identification accuracy of the particles.
Effectively disperses stuck particles and improves the accuracy of particle size analysis and identification of coffee particles.
Smart Images

Figure CN2023088295_26092024_PF_FP
Abstract
Description
Coffee particle analysis method, device, apparatus and computer-readable storage medium Technical Field
[0001] The present application relates to the field of coffee measurement, and in particular to a method, device, equipment and computer-readable storage medium for analyzing coffee particles. Background Art
[0002] When brewing coffee, the grind size—that is, the fineness and uniformity of the ground coffee—determines the contact area between the ground coffee and the brewing water, which in turn affects the extraction rate. Generally speaking, the finer the ground coffee, the higher the extraction rate. Therefore, by adjusting the grind size, the extraction rate can be adjusted. Particle size analysis can determine the particle size distribution of ground coffee, helping to study the fineness and uniformity of ground coffee, determine whether the ground coffee is too coarse or too fine, and then adjust the extraction rate by adjusting the fineness of the ground coffee. One method for analyzing the particle size distribution of ground coffee involves capturing an image of the ground coffee and analyzing the image to determine the particle size of the ground coffee.
[0003] There is still room for improvement in the method of analyzing the particle size of coffee powder by image analysis.
[0004] Summary of the Invention
[0005] The present application provides a coffee particle analysis method, apparatus, device, and computer-readable storage medium, which can improve the analysis accuracy of coffee particles.
[0006] A first aspect of the present application provides a method for analyzing coffee particles, the method comprising:
[0007] Controlling a vibration source to drive the coffee particles to vibrate at least twice, and capturing images of the coffee particles after the at least two vibrations, respectively, to obtain a set of images to be measured having coffee particles with different distributions;
[0008] obtaining initial identification information of coffee particles in the images to be tested in the image set to be tested;
[0009] The final identification information of the coffee particles is determined based on the initial identification information of the coffee particles in at least some frames of the image set to be tested.
[0010] Optionally, the vibration source is controlled to drive the coffee particles to vibrate at least twice, and images are collected for the coffee particles after the at least two vibrations, respectively, to obtain a set of images to be tested of coffee particles with different distributions, including: controlling the vibration source to drive the coffee particles to vibrate in a first driving manner to obtain coffee particles with a first distribution; collecting images of the coffee particles with the first distribution to obtain a first image to be tested; controlling the vibration source to drive the coffee particles with the first distribution to vibrate in a second driving manner to obtain coffee particles with a second distribution; collecting images of the coffee particles with the second distribution to obtain a second image to be tested.
[0011] Optionally, the first driving mode and the second driving mode are different; controlling the vibration source to drive the coffee particles with the first distribution to vibrate in the second driving mode also includes: controlling the vibration source to drive the coffee particles to vibrate in the second driving mode at least once; capturing images of the coffee particles after each driving in the second driving mode to obtain at least one frame of image to be measured.
[0012] Optionally, the first driving mode and the second driving mode are different in at least one of the following: vibration frequency, vibration amplitude, vibration time, and vibration area.
[0013] Optionally, the vibration frequency in the first driving mode is a resonant frequency, and the vibration frequency in the second driving mode is less than or greater than the resonant frequency; and / or the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode.
[0014] Optionally, the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode, and the vibration time in the second driving mode is longer than the vibration time in the first driving mode.
[0015] Optionally, the second driving mode is determined according to the first image to be tested.
[0016] Optionally, the method further includes: determining at least one of the vibration frequency, vibration amplitude, vibration time or vibration area in the second driving mode based on the initial identification information of the coffee particles in the first image to be tested; the initial identification information of the coffee particles in the first image to be tested includes the number and / or area of the coffee particles in the first image to be tested.
[0017] Optionally, the initial identification information of the coffee particles in the image to be tested includes the number of coffee particles; the method further includes: determining a change in the number of coffee particles based on the number of coffee particles in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested; and determining a driving mode of the vibration source after the second image to be tested based on the change in number.
[0018] Optionally, determining the driving mode of the vibration source after the second image to be tested based on the quantity change includes at least one of the following: when the quantity change is a decrease or the change value is less than a threshold value, stopping the vibration source from driving the coffee particles for the next time or continuing to drive the coffee particles for the next time in the second driving mode; or, when the quantity change is an increase and the change value is greater than the threshold value, continuing to drive the coffee particles for the next time in the first driving mode.
[0019] Optionally, the number of coffee particles in at least one frame of image to be tested, the first image to be tested, and the second image to be tested before the first image to be tested is the number of particles whose area is greater than a preset critical value in at least one frame of image to be tested, the first image to be tested, and the second image to be tested before the first image to be tested.
[0020] Optionally, the initial identification information includes at least one of the particle size, quantity, area, volume, mass, and chromaticity of the coffee particles; and / or at least one of the quantity, area, volume, mass, and chromaticity of extremely small coffee particles, wherein the extremely small coffee particles are coffee particles having a particle size smaller than a first preset particle size, or a particle size smaller than the first preset particle size and greater than a preset critical value, wherein the value of the first preset particle size is smaller than the value of the particle size in the multiple particle size intervals.
[0021] Optionally, the initial identification information also includes: at least one of the number distribution, area distribution, volume distribution, mass distribution, and chromaticity distribution of the coffee particles in different particle size ranges; and / or information on the proportion of the extremely small coffee particles in all coffee particles.
[0022] Optionally, the final identification information includes at least one of the final number distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges; the method also includes: displaying at least one of the final number distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges on an interactive interface.
[0023] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles; before determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the image to be tested in the image set to be tested, it also includes: obtaining a distortion function, wherein the distortion function is used to indicate particle size compensation values at multiple pixel positions; performing distortion correction on the particle size of at least some of the coffee particles in the image to be tested in the image set to be tested according to the pixel positions of the coffee particles and the corresponding particle size compensation values to obtain the distortion-corrected particle size of the coffee particles; determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the image to be tested in the image set to be tested includes: determining the final identification information of the coffee particles based on the distortion-corrected particle size of the coffee particles in at least some frames of the image to be tested in the image set to be tested.
[0024] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles; before determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the image to be tested in the image set to be tested, it also includes: obtaining a particle size compensation function, the particle size compensation function is used to indicate the particle size compensation value under multiple brightnesses; respectively obtaining the brightness of the area where the coffee particles are located in at least some frames of the image to be tested in the image set to be tested; for the at least some frames of the image to be tested, the particle size of the coffee particles in the image to be tested is compensated according to the brightness of the area where the coffee particles are located in the image to be tested and the particle size compensation value to obtain the compensated particle size of the coffee particles; determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the image to be tested in the image set to be tested includes: determining the final identification information of the coffee particles based on the compensated particle size of the coffee particles in at least some frames of the image to be tested in the image set to be tested.
[0025] Optionally, the initial identification information of the coffee particles includes a particle size of the coffee particles; the method further comprises: entering a calibration mode, wherein, in the calibration mode: capturing an image of a calibration pattern having a preset area and located at a preset position within a field of view to obtain a calibration image; obtaining a number of pixels corresponding to the calibration pattern; and determining a calibration size corresponding to one pixel based on the preset area and the number of pixels;
[0026] The obtaining of initial identification information of coffee particles in the images to be tested in the image set to be tested includes: obtaining the number of pixels of coffee particles in the images to be tested in the image set to be tested; and determining the particle size of the coffee particles according to the calibrated size and the number of pixels.
[0027] Optionally, the image to be tested is an image captured when the coffee particles are illuminated by an illumination light source; the method further includes: acquiring at least one frame of raw image, the at least one frame of raw image comprising raw pixel values of the image captured when the coffee particles are illuminated by at least one light source different from the illumination light source; acquiring a frame of representative chromaticity diagram based on the at least one frame of raw image; and determining the overall chromaticity value of the coffee particles based on the frame of representative chromaticity diagram.
[0028] A second aspect of the present application provides a device for analyzing coffee particles, comprising:
[0029] A control module, configured to control the vibration source to drive the coffee particles to vibrate at least twice;
[0030] an image acquisition module, configured to acquire images of the coffee particles after the at least two vibrations, respectively, to obtain a set of images to be tested having coffee particles with different distributions;
[0031] a first acquisition module, configured to respectively acquire initial identification information of coffee particles in the images to be tested in the image set to be tested;
[0032] The first determination module is configured to determine final identification information of the coffee particles based on initial identification information of coffee particles in at least some frames of the image set to be tested.
[0033] A third aspect of the present application provides a coffee particle analysis device, comprising a memory and a processor, wherein the memory stores executable code, and when the executable code is processed by the processor, the processor can execute any one of the coffee particle analysis methods described.
[0034] Optionally, the coffee particle analysis equipment also includes: a vibration source, a light source module, a photosensitive area array, and a carrying surface for carrying the coffee particles; the vibration source is located on one side of the carrying surface; the light source module includes an illumination light source located on the side of the carrying surface for carrying the coffee particles; the photosensitive area array is used to capture the image to be measured of the coffee particles on the carrying surface when the illumination light source emits a light beam.
[0035] Optionally, the carrying surface is specifically a first light-uniform film; a second light-uniform film and a light guide plate are further provided between the vibration source and the first light-uniform film, the first light-uniform film, the light guide plate and the second light-uniform film are arranged in parallel in sequence, and the light guide plate is located in an airtight space surrounded by the first light-uniform film and the second light-uniform film; at least one through hole is also provided on the light guide plate; the light source module also includes a backlight light source, which is located at the periphery of the light guide plate; the photosensitive surface array is used to collect the image to be measured of the coffee particles on the carrying surface when the illumination light source and the backlight light source emit light beams.
[0036] Optionally, the vibration source includes a power amplifier, or the vibration source includes at least two linear vibration sources with different directions.
[0037] Optionally, the light source module also includes at least two spectral light sources for emitting different wavelengths between 500nm and 1100nm; the processor is further used to: obtain at least one frame of raw image, the at least one frame of raw image including raw pixel values of the image captured of the coffee particles when the at least two spectral light sources are respectively irradiated on the coffee particles; obtain a frame of representative chromaticity diagram based on the at least one frame of raw image; and determine the overall chromaticity value of the coffee particles based on the one frame of representative chromaticity diagram.
[0038] A fourth aspect of the present application provides a computer-readable storage medium having executable code stored thereon. When the executable code is executed by a coffee particle identification device, the coffee particle identification device is caused to execute any one of the methods described above.
[0039] In the particle size analysis of coffee particles, ensuring the discrete distribution of coffee particles is a prerequisite for improving measurement accuracy. If more coffee particles stick together, the particle size measurement results of the coffee particles will be biased larger. In the embodiment of the present application, the coffee particles are driven to vibrate at least twice by a vibration source to disperse the stuck coffee particles, and the distribution of the coffee particles can be changed. The final identification information is obtained by using the identification information of multiple frames of coffee particles with different distributions, which can improve the recognition accuracy of the coffee particles. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] FIG1 is a schematic diagram of an embodiment of the coffee particle analysis method of the present application; FIG2 is a schematic diagram of an embodiment of the particle size distribution histogram of the coffee particles of the present application; FIG3 is a schematic diagram of another embodiment of the particle size distribution histogram of the coffee particles of the present application; FIG4 is a schematic diagram of a quantity distribution histogram in the final identification information of the coffee particles displayed on the interactive interface; FIG5 and FIG6 are respectively images of coffee particles to be tested in different brightness areas; FIG7 is a schematic diagram of an embodiment of the coffee particle analysis method of the present application; FIG8 is a schematic diagram of an interactive interface of the present application; FIG9 is a schematic diagram of a frame of captured image of coffee particles; FIG10 is a schematic diagram of the present application FIG14 is a schematic diagram of an embodiment of the preset calibration color card of the application; FIG15 is an example diagram of an embodiment of the coffee particle analysis device of the present application; FIG16 is an example diagram of an embodiment of the coffee particle analysis equipment of the present application; FIG17 is a schematic diagram of the structure of the vibration source, the supporting surface and the backlight light source in an embodiment of the coffee particle analysis equipment of the present application; FIG18 is an exploded view of the structure shown in FIG19; FIG19 is a schematic diagram of the image to be measured captured by the photosensitive surface array when only the illumination light source and the backlight light source are turned on; FIG18 is a schematic diagram of the image to be measured captured by the photosensitive surface array when both the illumination light source and the backlight light source are turned on. DETAILED DESCRIPTION
[0041] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. While embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to make this application more thorough and complete and to fully convey the scope of this application to those skilled in the art. The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "the," and "an" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It should be understood that although the terms "first," "second," "third," etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are used solely to distinguish information of the same type from one another. For example, first information could be referred to as second information, and similarly, second information could be referred to as first information without departing from the scope of this application. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly defined.
[0042] As shown in FIG1 , FIG1 is a schematic diagram of an embodiment of a method for analyzing coffee particles of the present application. The method for analyzing coffee particles includes:
[0043] Step S101: Control a vibration source to drive coffee particles to vibrate at least twice, and capture images of the coffee particles after the at least two vibrations, to obtain a set of images to be tested having coffee particles with different distributions.
[0044] Optionally, coffee particles may refer to coffee beans, coffee powder, or coffee particles of other shapes and particle sizes. Optionally, the coffee particle analysis method of the present application is applied to a coffee particle analysis device. In one example, the coffee particle analysis device is provided with a photosensitive area array for capturing images containing coffee particles to obtain images to be measured. The photosensitive area array may include a charge-coupled device (CCD) or a complementary metal oxide semiconductor (CMOS). Optionally, a carrying surface for loading coffee particles is also provided in the coffee particle analysis device. For example, a preset sample tray is also provided in the coffee particle analysis device, and the carrying surface is the bottom surface of the preset sample tray. The photosensitive area array is specifically used to capture coffee particles located in the preset sample tray to obtain multiple frames of images to be measured, and the image set to be measured includes the multiple frames of images to be measured. Optionally, an irradiation light source is also provided in the coffee particle analysis device to irradiate the coffee particles when the photosensitive area array is imaging the coffee particles.
[0045] Optionally, a vibration source is provided on a side of the support surface facing away from the coffee particles. The vibration source can drive the support surface to vibrate, thereby driving the coffee particles on the support surface to vibrate, thereby changing the distribution of the coffee particles. Optionally, before each capture of a frame of coffee particles to be measured, the vibration source is controlled to drive the coffee particles to vibrate.
[0046] Optionally, the supporting surface is a vibrating membrane, on which the coffee particles are supported, and the vibration source drives the coffee particles to vibrate by vibrating the vibrating membrane. Optionally, the vibration source is a power amplifier configured to emit sound waves to drive the vibrating membrane. Alternatively, the vibration source may be a vibration source configured to emit other mechanical waves, such as water waves, rope waves, etc. Alternatively, the vibration source may drive the coffee particles to vibrate by other means (such as mechanical impact) rather than emitting mechanical waves. In one example, the vibration source is an electromagnetic coil, electrode, pneumatic hammer, spring, etc., connected to the supporting surface, which impacts the supporting surface to drive the coffee particles on the supporting surface to vibrate. In one example, the vibration source includes at least two linear vibration sources with different orientations. The direction of the vibration motion and degree of separation of the coffee particles can be controlled by controlling the frequencies of the transverse and longitudinal waves of each linear vibration source. In one example, multiple vibration sources may be disposed on the back of the supporting surface. In a Cartesian coordinate system centered on the center of the supporting surface, the multiple vibration sources may include three vibration sources whose vibration directions are parallel to the X, Y, and Z axes of the Cartesian coordinate system. In one example, voice coil motors with a vibration direction perpendicular to the bearing surface can be arranged at the four corners of the bearing surface. By controlling the amplitude and frequency of the voice coil electrode, control can be achieved by utilizing the interference principle of resonance and coherent waves.
[0047] In one example, a vibration source is controlled to vibrate the coffee particles in a first driving mode to obtain coffee particles having a first distribution; images of the coffee particles having the first distribution are captured to obtain a first image to be measured; the vibration source is controlled to vibrate the coffee particles having the first distribution in a second driving mode to obtain coffee particles having a second distribution; images of the coffee particles having the second distribution are captured to obtain a second image to be measured. The first driving mode and the second driving mode can be the same. For example, the vibration source can be controlled to vibrate the coffee particles multiple times in a fixed manner, and the coffee particles after each vibration stop are captured, thereby obtaining multiple frames of images to be measured with different distributions of coffee particles.
[0048] Alternatively, the first and second driving modes may be different. Optionally, the first and second driving modes differ in at least one of the following: vibration frequency, vibration amplitude, vibration time, and vibration range. Optionally, the vibration frequency in the first driving mode is a resonant frequency, and the vibration frequency in the second driving mode is less than or greater than the resonant frequency; and / or, the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode. Because the vibration source's vibration frequency is the resonant frequency, which can achieve a maximum or near-maximum vibration amplitude, the coffee particles can be initially vibrated to separate using the resonant frequency or a larger vibration amplitude. For example, before capturing the first image of the coffee particles, vibrating the coffee particles at the resonant frequency can better separate the coffee particles, facilitating better particle size measurement in the captured first image. A smaller vibration amplitude can then be used to fine-tune the distribution of the coffee particles before capturing the second image. Using these first and second images can improve the accuracy of particle size analysis.
[0049] Optionally, the vibration amplitude in the first driving mode is larger than the vibration amplitude in the second driving mode, and the vibration time in the second driving mode is longer than the vibration time in the first driving mode. In this way, the coffee particles can be completely shaken apart with a shorter vibration time and a larger vibration amplitude before the first image to be measured is captured. Then, the coffee particles can be further shaken apart with a longer vibration time and a smaller vibration amplitude, and the distribution of the coffee particles can be fine-tuned to facilitate the acquisition of more particle size information of the coffee particles. For example, the vibration time in the first driving mode can be a duration between 0.1s and 0.5s, and the vibration time in the second driving mode can be a duration between 0.1s and 1s, which is longer than the vibration time in the first driving mode. Alternatively, optionally, the vibration time in the second driving mode can be the same as the vibration time in the first driving mode, or the vibration time in the second driving mode can be shorter than the vibration time in the first driving mode.
[0050] Optionally, after controlling the vibration source to vibrate the coffee particles having the first distribution using the second driving mode, the vibration source is further controlled to vibrate the coffee particles using the second driving mode at least once; and images of the coffee particles after each driving using the second driving mode are captured, thereby obtaining at least one frame of image to be measured. Alternatively, while the vibration source is driving the coffee particles using the second driving mode, images of the coffee particles are continuously captured at predetermined intervals without stopping the vibration source from driving the coffee particles, thereby obtaining multiple frames of image to be measured.
[0051] Step S102: obtaining initial recognition information of coffee particles in the images to be tested in the image set to be tested.
[0052] Optionally, the initial identification information includes at least one of the particle size, number, area, volume, and mass of the coffee particles. Optionally, the initial identification information also includes the distribution of at least one of the particle size, number, area, volume, and mass of the coffee particles.
[0053] There are various methods for determining the particle size of coffee particles. For example, the area occupied by coffee powder particles in the image being measured can be measured, and the diameter of a circle with the same area can be calculated as the initial particle size of the coffee powder particles. Existing methods for analyzing coffee powder particle size mostly use sieving or laser scattering. Sieving is low-cost but inefficient, while laser scattering is more efficient but expensive. Compared to these two methods, image analysis offers advantages such as faster recognition speed, higher analysis efficiency, and lower cost.
[0054] When detecting the area of coffee particles, machine learning methods can be used to identify the size of coffee particles in the image to be tested. By marking the adhesion and non-adhesion of coffee particles and / or by marking the silver skin in the coffee particles, the efficiency and accuracy of coffee particle size recognition can be improved. The volume of coffee particles can be calculated based on the particle size and / or area of the coffee particles. The mass of the coffee particles can be calculated based on the volume of the coffee particles and a preset density of the coffee particles.
[0055] Optionally, the initial identification information also includes distribution information of coffee particles in different particle size intervals. The distribution information of coffee particles in different particle size intervals may include the number distribution, area distribution, volume distribution, mass distribution and / or chromaticity distribution of coffee particles in different particle size intervals. For example, 9 particle size intervals are pre-set, namely 200um-300um, 300um-425um, 425um-600um, 600um-850um, 850um-1180um, 1180um-1400um, 1400um-1700um, 1700um-2360um, and 2360um-2500um. Of course, the number of preset particle size intervals and the length of each interval can be set in other ways, which are not limited here. After determining the particle size of each coffee particle in the image to be measured, the number distribution of coffee particles within multiple preset particle size intervals can be the sum of the number of coffee particles within each preset particle size interval, or the ratio of the sum of the number of coffee particles within each preset particle size interval to the sum of the number of coffee particles within all preset particle size intervals. Similarly, the area / volume / mass distribution of coffee particles within multiple preset particle size intervals can be the sum of the area / volume / mass within each preset particle size interval, or the ratio of the sum of the area / volume / mass within each preset particle size interval to the sum of the area / volume / mass within all preset particle size intervals. The chromaticity distribution of coffee particles within multiple preset particle size intervals can be the average or median of the chromaticity values within each preset particle size interval.
[0056] FIG2 is a schematic diagram of an embodiment of a particle size distribution histogram of coffee particles according to the present application. Each square in the histogram corresponds to a predetermined particle size interval. The abscissa of the histogram represents the particle size corresponding to the predetermined particle size interval, and the ordinate represents the ratio of the number of coffee particles in the predetermined particle size interval to the total number of coffee particles in all predetermined particle size intervals.
[0057] FIG3 is a schematic diagram of another embodiment of a particle size distribution histogram of coffee particles according to the present application. Each square in the histogram corresponds to a predetermined particle size interval. The abscissa of the histogram represents the particle size corresponding to the predetermined particle size interval, and the ordinate represents the ratio of the sum of the areas of the coffee particles in the predetermined particle size interval to the total area of all coffee particles in the predetermined particle size interval.
[0058] In one example, the initial identification information also includes at least one of the number, area, volume, and mass of extremely small coffee particles. The extremely small coffee particles are coffee particles having a particle size smaller than a first preset particle size, or coffee particles having a particle size smaller than the first preset particle size and larger than a preset critical value. The value of the first preset particle size is smaller than the value of the particle size in the multiple preset particle size intervals. For example, the extremely small coffee particles are coffee particles having a particle size smaller than 200um. During the coffee grinding process, the difference in particle size depends on the requirements of different brewing methods, but generally, it is desired to obtain coffee particles with higher uniformity, and the extremely small coffee particles are particles generated during the grinding process that are outside the desired particle size range. Obtaining information about the extremely small coffee particles can provide users with a reference to the grinding effect; for example, if the number or area of extremely small coffee particles exceeds a certain value, or the number ratio or area ratio exceeds a certain value, it means that the grinding effect is not good.
[0059] Optionally, the initial identification information further includes information about the proportion of the tiny coffee particles in all coffee particles. The proportion information may be the proportion of the total number, total area, total volume, or total mass of the tiny coffee particles in the total number, total area, total volume, or total mass of all coffee particles.
[0060] Optionally, before obtaining initial identification information of the coffee particles in the image to be tested, it is further determined whether the coffee particles are coffee powder or coffee beans. Specifically, the determination of whether the coffee particles are coffee powder or coffee beans can be made through user input, or by analyzing the image to be tested. For example, the determination of whether the coffee particles are coffee powder or coffee beans can be made by obtaining the gradient of the image to be tested and classifying the gradient based on the gradient.
[0061] Step S103 : determining final identification information of the coffee particles based on initial identification information of coffee particles in at least some frames of the image set to be tested.
[0062] For example, the final particle size information of the coffee particles can be obtained by taking a weighted average of the initial identification information of the coffee particles in all frames of the image to be tested in the image set to be tested. This can reduce measurement errors and improve measurement accuracy. Optionally, it is also determined whether each frame of the image to be tested in the image set to be tested is valid, and the final identification information of the coffee particles can be obtained based only on the initial identification information of the coffee particles in the valid image to be tested. There are multiple ways to determine whether the image to be tested is valid. In one example, when there is serious adhesion of coffee particles in the image to be tested, it is determined to be invalid. For example, the size of the area of the coffee powder particles in the image to be tested is detected. If the area of the coffee particles exceeds a first threshold, or the number of coffee particles whose area exceeds a second threshold or the area ratio exceeds a preset ratio, the frame of the image to be tested is determined to be invalid. The first threshold and the second threshold can be the same or different.
[0063] When performing a weighted average summation of the initial identification information of coffee particles in at least a portion of the frames to be tested in the set of images to be tested, distribution information for each of the at least a portion of the frames to be tested within multiple different particle size ranges is obtained, and the weighted average summation of this distribution information is performed. Specifically, for each particle size range, at least one of the number, area, volume, and mass of the multiple frames to be tested is obtained, and similar items are weighted averaged and summed. Alternatively, for extremely small coffee particles, at least one of the number, area, volume, and mass of the extremely small coffee particles in the multiple frames to be tested is obtained, and similar items are weighted averaged and summed.
[0064] Optionally, each frame of the image to be tested has the same weighted value, and similar items of the multiple frames of the image to be tested are averaged and summed. Optionally, the ratio of the total number in each particle size interval to the total number in all particle size intervals, or the ratio of the total area in each particle size interval to the total area in all particle size intervals, or the ratio of the total volume in each particle size interval to the total volume in all particle size intervals, or the ratio of the total mass in each particle size interval to the total mass in all particle size intervals can also be obtained.
[0065] Optionally, the final identification information of the coffee particles is also displayed through the interactive interface. As shown in Figure 4, Figure 4 is a schematic diagram of the quantity distribution histogram in the final identification information of the coffee particles displayed on the interactive interface. The final identification information includes the proportion of the total number of coffee particles in 9 preset particle size intervals to the total number of all particle size intervals. Among them, the 9 preset particle size intervals are 200um-300um, 300um-425um, 425um-600um, 600um-850um, 850um-1180um, 1180um-1400um, 1400um-1700um, 1700um-2360um, and 2360um-2500um. The x-axis in Figure 4 is the median of the 9 particle size intervals, and the y-axis represents the proportion of the number in each particle size interval to the total number in all particle size intervals.
[0066] Optionally, the interactive interface also displays the particle size range within which the median particle size of the coffee particles falls. The median particle size refers to the particle size at which the cumulative particle size distribution percentage of the coffee particles reaches 50%. Its physical meaning is that 50% of the particles have a size greater than the median particle size, and 50% of the particles have a size less than the median particle size. As shown in Figure 4, for example, if the median particle size falls within the particle size range of 600μm-850μm, the number ratio within this particle size range can be displayed with a different color or pattern than the number ratio displayed for other devices to indicate that the median particle size falls within this particle size range.
[0067] In coffee particle size analysis, ensuring a discrete distribution of coffee particles is a prerequisite for improving measurement accuracy. If many coffee particles cling together, the particle size measurement result will be biased. In the embodiments of the present application, a vibration source is used to drive the coffee particles to vibrate at least twice to disperse the clinging coffee particles and change the distribution of the coffee particles. The final identification information is obtained by deriving identification information from multiple frames of coffee particles with different distributions, thereby improving coffee particle recognition accuracy.
[0068] In some examples, during multiple vibrations of coffee particles driven by a vibration source, the driving mode of at least one of the driving operations is determined based on one or more recently captured images of the driving operation. For example, the second driving mode is determined based on the first image to be measured. For example, the degree of adhesion of coffee particles in the first image to be measured is determined, and at least one of the vibration frequency, vibration amplitude, vibration duration, or vibration range in the second driving mode is determined based on the adhesion degree.
[0069] The degree of sticking is determined based on the number and / or area of coffee particles in the first image to be tested. For example, the number and total area of coffee particles in a portion or all of the first image to be tested are detected, and different degrees of sticking are associated when the ratio of the total area to the number of coffee particles in the region falls within different ranges. Alternatively, the area of each coffee particle in the region is detected, and different degrees of sticking are associated when the area exceeds a preset area or the number of coffee particles exceeding the preset area falls within different ranges. Optionally, different degrees of sticking correspond to different vibration frequencies, amplitudes, or durations. After determining the degree of sticking of coffee particles in the first image to be tested, the corresponding vibration frequency, amplitude, or duration is used as the vibration frequency, amplitude, or duration in the second driving mode based on the degree of sticking. In examples where the vibration source can drive vibration in different regions, the vibration frequency, amplitude, or duration corresponding to each region can also be determined based on the degree of sticking of coffee particles in that region.
[0070] Optionally, for areas with a high degree of adhesion, the second driving mode may have at least one of the following parameters increased compared to the first driving mode: vibration frequency, vibration amplitude, or vibration duration. Alternatively, only one parameter may be increased, while the others may retain default values. For example, when determining the second driving mode based on the first image to be tested, the vibration frequency and vibration amplitude may both retain default values, while the vibration duration may be determined based on the degree of adhesion of the coffee particles in the first image to be tested.
[0071] Optionally, the first image to be measured is fixedly divided into multiple areas in a preset manner, for example, it is evenly divided into four areas. The way of dividing the areas can be coordinated with the control accuracy of the vibration source, so that the vibration source can vibrate different areas separately. For example, different areas can be vibrated by multiple vibration sources, or the vibration of the area can be changed by moving the vibration position of the vibration source. For each area in the first image to be measured, the adhesion degree of the area can be determined in the above manner. The area with an adhesion degree higher than the preset degree can be used as the vibration area in the second driving mode. Alternatively, optionally, the first image to be measured may not be fixedly divided into multiple areas in a preset manner. In the example where the vibration source can control the driving position, after detecting the position where the adhesion degree of coffee particles is higher than the preset degree, the vibration source can be driven with this position as the center of the vibration area.
[0072] In some examples, the degree of adhesion of coffee particles in the first image to be tested is obtained, and the vibration frequency in the second driving mode is determined based on the degree of adhesion. The adhesion level in the first image to be tested can be determined based on the degree of adhesion of coffee particles to determine the corresponding vibration frequency, for example, a higher vibration frequency is used when the degree of adhesion is higher.
[0073] In some examples, the initial identification information of the coffee particles in the image to be tested includes the number of coffee particles. After obtaining the initial identification information of the coffee particles in the image to be tested, information about a change in the number of coffee particles is determined based on the number of coffee particles in at least one image to be tested prior to the first image to be tested, the first image to be tested, and the second image to be tested. Furthermore, a driving mode of the vibration source after the second image to be tested is determined based on the information about the change in number. Optionally, when the information about the change in number indicates that the number of coffee particles in each image to be tested decreases or the absolute value of the change in number is less than a threshold value within consecutive preset frames of images to be tested, the vibration source is stopped from vibrating the coffee particles again or the coffee particles are driven to vibrate with a vibration amplitude less than a preset amplitude, a vibration frequency less than a preset frequency, or a vibration time less than a preset time. Alternatively, when the information about the change in number indicates that the number of coffee particles in each image to be tested increases within consecutive preset frames of images to be tested and the change value is greater than the threshold value, the coffee particles are driven to vibrate with a vibration amplitude greater than the preset amplitude, a vibration frequency greater than the preset frequency, or a vibration time greater than the preset time.
[0074] In a specific embodiment, the vibration source may be configured with only a first drive mode and a second drive mode, wherein the vibration frequency in the first drive mode is a resonant frequency, and the vibration frequency in the second drive mode is less than or greater than the resonant frequency; and / or the vibration amplitude in the first drive mode is greater than the vibration amplitude in the second drive mode. Before capturing the first image to be measured of the coffee particles, the coffee particles are vibrated using the first drive mode to disperse the coffee particles. After capturing the first image to be measured, the coffee particles may continue to be vibrated using the first drive mode before capturing at least two subsequent images to be measured. Alternatively, the coffee particles may be vibrated using the second drive mode before capturing at least two subsequent images to be measured. After capturing at least three frames of images to be measured, a change in the number of coffee particles is determined based on the number of coffee particles in each frame. If the number of coffee particles in each frame decreases or the absolute value of the change in number is less than a threshold within a series of preset frames of images to be measured, the vibration source stops vibrating the coffee particles for the next time or continues vibrating the coffee particles using the second drive mode. Alternatively, when the quantity change is an increase and the change value is greater than the threshold, the next driving of the coffee particles is continued in the first driving mode.
[0075] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles. Furthermore, before step S103, a distortion function is obtained, the distortion function being used to indicate particle size compensation values at multiple pixel locations. The particle sizes of at least a portion of the coffee particles in the image set to be tested are subjected to distortion correction based on the pixel locations of the coffee particles and the corresponding particle size compensation values, thereby obtaining the distortion-corrected particle sizes of the coffee particles. In step S103, the final identification information of the coffee particles is determined based on the distortion-corrected particle sizes of at least a portion of the images to be tested in the image set to be tested. Camera imaging distortion can lead to errors in the particle size measurement of edge coffee particles. Correction using the distortion function can reduce these errors. The distortion function can be obtained and stored by calibrating the equipment before shipment. Optionally, during the calibration process, a photosensitive array in the coffee particle analysis equipment can be used to image a checkerboard pattern, thereby fitting the distortion coefficients at each pixel location, i.e., the distortion function.
[0076] Optionally, the distortion function is a curve representing the relationship between the distance between a pixel location and the image center, and the difference between the actual particle size at that pixel location and the calculated particle size. In particle size analysis, after determining the distance between a coffee particle's pixel location and the image center, the difference between the calculated and actual particle sizes can be calculated using this distance and the distortion function. This difference is then applied to the calculated particle size to correct for distortion and achieve a more accurate particle size result.
[0077] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles; before step S103, a particle size compensation function is also obtained, and the particle size compensation function is used to indicate the particle size compensation value under multiple brightnesses. In addition, the brightness of the area where the coffee particles are located in at least part of the frames of the image to be tested is also obtained respectively. For the at least part of the frames of the image to be tested, the particle size of the coffee particles in the image to be tested is compensated according to the brightness of the area where the coffee particles are located in the image to be tested and the particle size compensation value to obtain the compensated particle size of the coffee particles. In step S103, the final identification information of the coffee particles is determined specifically based on the compensated particle size of the coffee particles in at least part of the frames of the image to be tested in the image to be tested. In particle size analysis, different brightness in different areas may be caused by uneven illumination light sources or different backgrounds of the supporting surface. Different brightness may lead to inconsistent particle size calculation results for the same coffee particles.
[0078] For example, as shown in Figures 5 and 6, Figures 5 and 6 are respectively the images to be tested of coffee particles in different brightness areas. In Figure 5, the coffee particles are located in the area 701 with moderate brightness, and the edges of the coffee particles are relatively clear. In Figure 6, however, the coffee particles are located in the area 601 with excessive brightness, which may cause the edges of the coffee particles to be overexposed, appearing as eroded edges of the coffee particles in the image to be tested, resulting in measurement errors in the particle size analysis. Therefore, by analyzing the particle size of the same coffee particles in different brightness areas during the calibration process before leaving the factory, the effect of different brightness on the particle size calculation of the coffee particles can be obtained and stored. In the actual particle size analysis, the particle size of the coffee particles in different brightness areas is compensated and calibrated to improve the measurement accuracy.
[0079] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles. The coffee particle analysis method of the present application further includes: entering a calibration mode, wherein, in the calibration mode: capturing an image of a calibration pattern with a preset area located at a preset position within the field of view to obtain a calibration image; obtaining the number of pixels corresponding to the calibration pattern; and determining a calibration size corresponding to one pixel based on the preset area and the number of pixels. When determining the particle size of the coffee particles in step S102, the number of pixels of the coffee particles in the image to be tested in the image set to be tested is respectively obtained; and the particle size of the coffee particles is determined based on the calibration size and the number of pixels.
[0080] In actual applications, the calibration mode may be entered upon user triggering, or the calibration mode may be automatically entered at a predetermined interval to obtain the latest calibration size, or the user may set how to trigger the calibration mode.
[0081] In some examples, the coffee particle analysis method of the present application includes not only analyzing the number, particle size, area, volume or mass of coffee particles, but also analyzing the color of coffee particles. As shown in Figure 7, Figure 7 is a schematic diagram of an embodiment of the coffee particle analysis method of the present application. Optionally, the color analysis method of coffee particles in this embodiment includes:
[0082] Step S701: Acquire at least one frame of raw image, wherein the at least one frame of raw image includes raw pixel values of an image of coffee particles captured when at least one light source irradiates the coffee particles.
[0083] Optionally, the at least one light source comprises a light source having an emission spectrum including a wavelength of 850 nm. Optionally, the at least one light source is different from the illumination light source within the coffee particle analysis device described above. To facilitate the distinction between the at least one light source and the illumination light source, the at least one light source is hereinafter referred to as the spectral light source.
[0084] Optionally, coffee particles may refer to coffee beans or coffee powder or coffee particle objects of other shapes and sizes. In one example, the analysis device for the coffee particles is provided with only one spectral light source. In one example, the analysis device for the coffee particles is provided with at least two spectral light sources with different emission spectra. Optionally, the at least two spectral light sources are respectively used to emit light beams of different wavelengths between 500nm and 1100nm. Experiments have found that the reflection of the spectrum within this range by coffee particles is more conducive to calculating the colorimetric value of the coffee particles. For example, the analysis device for the coffee particles is provided with at least some of the spectral light sources among the six spectral light sources whose emission spectra include six wavelengths of 520nm, 600nm, 640nm, 850nm, 940nm and 1100nm respectively. Since coffee particles of the same roasted chromaticity have different reflectivities to light beams of different spectra, different original images are formed by irradiating the coffee particles with reflected light from multiple spectral light sources of different spectra. The chromaticity value of the coffee particles is determined by fusing the original images corresponding to the spectral light sources of different spectra using an algorithm. This can effectively avoid the problem of poor stability of chromaticity value detection results caused by using a single spectrum acquisition.
[0085] In an example where a single spectral light source is provided within the coffee particle analysis device, the photosensitive array within the coffee particle analysis device is configured to capture images of the coffee particles when the spectral light source illuminates the coffee particles, thereby obtaining at least one initial raw image. In an example where the coffee particle analysis device is configured to have n types of spectral light sources, where n is greater than or equal to 2, the n types of spectral light sources are configured to illuminate the coffee particles at different times, and the image capture module is configured to capture images of the coffee particles when each type of spectral light source illuminates the coffee particles, thereby obtaining at least n initial raw images, where each of the n initial raw images corresponds to a single spectral light source.
[0086] Among them, a frame of original image corresponding to each spectral light source can be a frame of initial original image captured by the image acquisition module when the spectral light source irradiates the coffee particles, or it can be a frame of original image obtained by fusing multiple frames of initial original images captured by the image acquisition module when the spectral light source irradiates the coffee particles.
[0087] The initial raw image includes the original pixel values at each pixel position, also known as raw data. This raw data refers to the original record of the voltage levels when the image acquisition module converts the optical signal into an electrical signal for the coffee particle image. It is the unprocessed raw data. Raw data is generally output in a certain order, such as GRBG, RGGB, BGGR, or GBRG, where R represents red, G represents green, and B represents blue. There are three common formats for raw data: raw8, raw10, and raw12, which respectively indicate that a pixel has 8 bits, 10 bits, and 12 bits of data.
[0088] Step S702: Obtain a representative chromaticity map according to the at least one frame of original image.
[0089] Step S102: obtaining a representative chromaticity map according to the at least one frame of original image.
[0090] There may be multiple chromaticity values representing each pixel position in the chromaticity diagram. For example, the chromaticity value may be the roasting degree index "Agtron" of the coffee particles or other values that can reflect the chromaticity of the coffee particles.
[0091] There are multiple methods for obtaining a representative chromaticity diagram based on the at least one original image frame. In an example where a spectral light source has only one emission spectrum, that is, the at least one original image frame is specifically a single original image frame, a basis function is obtained. This basis function may be pre-stored and is a function between the original pixel values collected under the illumination of the spectral light source and the corresponding chromaticity values. The corresponding chromaticity values are obtained based on the original pixel values in the original image and the corresponding basis function, thereby obtaining a chromaticity diagram corresponding to the original image.
[0092] In an example corresponding to n spectral light sources with different emission spectra, where n is greater than or equal to 2, that is, the at least one frame of original image is specifically n frames of original images, a representative chromaticity diagram can be obtained by a linear model method.
[0093] In the linear model method, for example, the n frames of original images can be first fused into one frame of original image, and then the corresponding chromaticity diagram can be obtained based on the fused one frame of original image. Optionally, the weights of the n types of spectral light sources can also be obtained, and the n frames of original images can be the weights of the n types of spectral light sources fused into one frame of original image, for example, fused into one frame of original image by weighted summation. Alternatively, in the linear model method, corresponding chromaticity diagrams can be first generated based on the n frames of original images respectively to obtain n frames of chromaticity diagrams, and then the n frames of chromaticity diagrams can be fused into one frame of representative chromaticity diagram. Optionally, the weights of the n types of spectral light sources can also be obtained, and the one frame of representative chromaticity diagram can be generated based on the weights of the n types of spectral light sources and the n frames of chromaticity diagrams, for example, fused into one frame of representative chromaticity diagram by weighted summation.
[0094] For example, in one example, five spectral light sources with different emission spectra are provided, with corresponding weights a1, a2, a3, a4, and a5, respectively. Five chromaticity diagrams are acquired for these five spectral light sources. For the chromaticity values at the same pixel position on these five chromaticity diagrams, if they are Ag1, Ag2, Ag3, Ag4, and Ag5, respectively, then the representative chromaticity value at that pixel position = a1*Ag1+a2*Ag2+a3*Ag3+a4*Ag4+a5*Ag5.
[0095] There are various methods for generating corresponding n frames of chromaticity diagrams based on the n frames of original images. For example, for the kth spectral light source, a basis function corresponding to the kth spectral light source is obtained. The basis function is a relationship function between the original pixel values collected under the illumination of the kth spectral light source and the corresponding chromaticity values, where k is any integer from 1 to n. The original pixel values in the kth frame of original image are obtained. The kth frame of original image is the original image collected when the coffee particles are illuminated by the kth spectral light source. The corresponding chromaticity values are obtained based on the original pixel values in the kth frame of original image and the basis function corresponding to the kth spectral light source, thereby obtaining a chromaticity diagram corresponding to the kth frame of original image.
[0096] Step S703: determining the overall chromaticity value of the coffee particles according to the one-frame representative chromaticity diagram.
[0097] Optionally, a corresponding representative chromaticity distribution is obtained based on the representative chromaticity diagram of the frame, and the representative chromaticity distribution includes the ratio of the number of pixels of different representative chromaticity values to the total number of pixels. Optionally, the representative chromaticity value with the highest ratio is used as the overall chromaticity value of the coffee particles, or the weighted average of multiple representative chromaticity values whose ratio is greater than a preset threshold is used as the overall chromaticity value of the coffee particles, or the average value or median in the representative chromaticity distribution is used as the overall chromaticity value of the coffee particles. In particular, when weighted averaging is adopted for multiple chromaticity values whose ratio is greater than a preset threshold, the weight of each chromaticity value can be determined according to its ratio. For example, the higher the ratio, the greater the weight of the chromaticity value.
[0098] Compared with the prior art of calculating chromaticity values through the grayscale image output by the photosensitive array, the original image captured by the photosensitive array in the embodiments of the present application is obtained, and the accuracy of the original image is much higher than the accuracy of the grayscale image. Generally, the numerical range of the grayscale image is 0 to 255, but the numerical upper limit of the original image can reach three or four thousand or even higher. Directly calculating the chromaticity value through the original image can greatly improve the accuracy of the chromaticity value, and there is no need to convert it to the grayscale value of the grayscale image, which can improve the accuracy of the chromaticity value.
[0099] In some examples, after obtaining the representative chromaticity diagram of at least one frame of the original image and the overall chromaticity value of the coffee particles, the overall chromaticity value is also displayed on the interactive interface. Optionally, the representative chromaticity distribution is also displayed on the interactive interface. As shown in Figure 8, Figure 8 is a schematic diagram of an interactive interface of the present application. The representative chromaticity distribution is displayed on the interactive interface, specifically in the form of a chromaticity histogram showing the sum of pixel areas in different representative chromaticity value intervals or the ratio of the sum of pixel areas to the total area. In addition, the overall chromaticity value is also displayed on the interactive interface, specifically AG 73.2. Optionally, the interactive interface also highlights the representative chromaticity value interval where the overall chromaticity value is located in the chromaticity histogram to indicate that the overall chromaticity value falls within the representative chromaticity value interval.
[0100] In step S702, the basis functions of spectral light sources of different spectra can be obtained through calibration and pre-stored. During calculation, the pre-stored weights are directly read for calculation. There are many methods for calibration. For example, for the first spectral light source, the first spectral light source can be used to illuminate a plurality of preset color cards with different chromaticity values, and the original pixel values corresponding to each of the preset color cards can be obtained. Since the chromaticity value of each preset color card is known, the basis function corresponding to the first spectral light source can be fitted by the chromaticity values of the plurality of preset color cards and the corresponding original pixel values. The calibration method of the basis functions of other spectral light sources can be similar to the calibration method of the basis function of the first spectral light source.
[0101] Optionally, when obtaining the basis function of each spectral light source, the weight of the spectral light source is also determined based on the degree of linear correlation between the chromaticity values of the multiple preset color cards and the corresponding raw pixel values. Optionally, when setting the weights of spectral light sources of different spectra, the weight corresponding to the spectral light source with a higher degree of linear correlation between the raw data and the chromaticity values can be higher. Optionally, the n spectral light sources include a first spectral light source and a second spectral light source, wherein the output spectrum of the first spectral light source includes a wavelength of 850nm and the dominant wavelength of the output spectrum of the second spectral light source is a wavelength other than 850nm; wherein the weight of the first spectral light source is higher than the weight of the second spectral light source. After multiple experiments by the inventors, it was found that the linear correlation between the raw data and the chromaticity values obtained by irradiating coffee particles with a spectral light source with a wavelength of 850nm is the highest. Setting the highest weight for the first spectral light source is beneficial to improving the accuracy of the calculation.
[0102] Because infrared spectroscopy is particularly sensitive to light-colored objects, even slight changes in the color of these objects can significantly alter the raw data obtained from imaging. This results in low accuracy in chromaticity values obtained from imaging coffee particles using only infrared spectral light sources. In the embodiments of this application, by using spectral light sources with different spectra to image coffee particles and obtain raw images, more dimensional information can be provided for calculating the chromaticity values of the coffee particles, thereby improving the accuracy of chromaticity calculations.
[0103] Optionally, in step S702, other methods can be used to obtain a representative chromaticity diagram based on the at least one frame of the original image. For example, the representative chromaticity diagram is obtained by a Gaussian mixture model method. In the Gaussian mixture model method, the Gaussian mixture model can be pre-stored in the analysis device of the coffee particles, and the Gaussian mixture model is obtained by reading the storage. The mixed Gaussian model contains the probability density functions of m known Gaussian models and the weights of the m unknown Gaussian models. The m Gaussian models are respectively the n-dimensional Gaussian distributions of the original pixel values collected by each of the m preset color cards under the illumination of the n spectral light sources, and m is an integer greater than or equal to 2. For example, m is an integer such as 10, 12, 13, 15, etc.
[0104] For example, the Gaussian mixture model can be
[0105] Among them, π k represents the weight of the k-th Gaussian model, N(x|μ k ,∑ k ) represents the probability density function of the k-th Gaussian model, x represents the original pixel value, and p(x) represents the Gaussian distribution of the original pixel value in the original image. In this model, N(x|μk ,∑ k ) is known. k ,∑ k ) can be obtained by calibration, in which the n spectral light sources are used to illuminate the m preset color cards respectively to collect raw data, and Gaussian distribution is obtained and stored based on the raw data.
[0106] After acquiring n frames of original images, the Gaussian distribution of the original pixel value of the first pixel position is acquired based on the n frames of original images, and the weight values of the m Gaussian models are acquired based on the Gaussian distribution of the original pixel value of the first pixel position and the mixed Gaussian model. For example, for the first pixel position, an n-dimensional vector consisting of the n original pixel values of the first pixel position in the n frames of original images is acquired as x, and the Gaussian distribution of the n original pixel values is substituted into the above Gaussian mixture model as p(x). Since N(x|μ k ,∑ k ) is known, and can be calculated based on the Gaussian distribution p(x) and N(x|μ k ,∑ k ) obtain the value π of the weight of the m Gaussian models corresponding to the first pixel position k .
[0107] The representative chromaticity value at the first pixel position is obtained based on the weight values of the m Gaussian distributions corresponding to the first pixel position and the chromaticity values of the m preset color cards. For example, the representative chromaticity value at the first pixel position can be calculated according to the following formula:
[0108] Among them, A k Represents the chromaticity value of the preset color card corresponding to the k-th Gaussian model, and the chromaticity values of each preset color card are known. k After substituting the above formula, the representative chromaticity value A at the first pixel position can be obtained: k .
[0109] Similarly, the representative chromaticity values at multiple pixel positions are calculated respectively to obtain a representative chromaticity diagram.
[0110] In some examples, the n frames of original images may be sent to a server, which then generates a representative chromaticity map corresponding to the n frames of original images based on the n frames of original images and a preset Gaussian mixture model, and then receives the representative chromaticity map sent by the server. The method for generating a representative chromaticity map corresponding to the n frames of original images based on the n frames of original images and the preset Gaussian mixture model can be referred to above and will not be repeated here. By moving the computation to the server, the computing power cost of the coffee particle analysis equipment can be reduced while maintaining the accuracy of the chromaticity value calculations.
[0111] In actual applications, the inventors found that when the chromaticity value, specifically the AG value, is greater than a preset threshold, the relationship between the chromaticity value and the original pixel value has an obvious nonlinear relationship. In the linear model method, the linear change can be compensated by weighted averaging the chromaticity responses of different wavelengths, thereby improving the accuracy of the chromaticity value calculation. Wherein, the preset threshold is an Ag value between 95 and 105, for example, AG 100. When the chromaticity value, specifically the AG value, is greater than the preset threshold, the distribution coupling degree of the original pixel values of different AG values at different wavelengths is high, and the use of a mixed Gaussian model fitting can better distinguish each distribution. Therefore, optionally, when obtaining a representative chromaticity diagram based on n frames of original images, corresponding n frames of chromaticity diagrams are generated respectively according to the n frames of original images; when the area of the chromaticity value in the n-frame chromaticity diagram greater than the preset threshold is greater than the preset area, or when the proportion of the area of the chromaticity value in the n-frame chromaticity diagram greater than the preset threshold is greater than the preset proportion, the one-frame representative chromaticity diagram is obtained according to the mixed Gaussian model method. Optionally, when the area of the n-frame chromaticity map with chromaticity values greater than a preset threshold is not greater than a preset area, or when the proportion of the area of the n-frame chromaticity map with chromaticity values greater than a preset threshold is not greater than a preset proportion, the one-frame representative chromaticity map is obtained according to the linear model method.
[0112] Optionally, in some examples, the colorimetric analysis method of coffee particles of the present application further includes: entering an automatic calibration mode, in the automatic calibration mode: acquiring at least one frame of original calibration image, the at least one frame of original calibration image comprising original pixel values of an image captured of a preset calibration color card when a preset calibration color card located at a preset position is irradiated by at least one spectral light source; calculating the chromaticity value of the preset calibration color card based on the original pixel values in the at least one frame of original calibration image; and calculating a chromaticity compensation value based on the chromaticity value calculated from the preset calibration color card and the actual chromaticity value of the preset calibration color card.
[0113] The preset calibration color card located at a preset position may be a card that a user places on a supporting surface, then activates the spectral light source and image acquisition module to capture an image of the preset calibration color card. Alternatively, the preset calibration color card may be fixed within the coffee particle analysis device and located within the image acquisition module's field of view, but outside the supporting surface. For example, the preset calibration color card may be fixed to the inner wall of the coffee particle analysis device, so as to be within the image acquisition module's field of view while not obstructing the supporting surface. After entering the automatic calibration mode, a chromaticity compensation value is obtained based on the image region of the captured raw image corresponding to the preset calibration color card. Alternatively, the preset calibration color card may be fixed within the coffee particle analysis device and located outside the image acquisition module's field of view. The coffee particle analysis device may also include a mechanical module for moving the preset calibration color card into the image acquisition module's field of view after entering the automatic calibration mode, so that the image acquisition module can capture a raw image of the preset calibration color card.
[0114] Optionally, the calibration pattern with a preset area described above can be located on the preset calibration color card. As shown in Figure 10, Figure 10 is a schematic diagram of an embodiment of the preset calibration color card of the present application. The preset calibration color card has a known chromaticity value, and a calibration pattern with a preset area is provided on the preset calibration color card (a circle is used as an example in Figure 10). In this way, after acquiring an image of the preset calibration color card, the circle above can also be used to determine the calibration size corresponding to a pixel.
[0115] In actual applications, due to the loss of the product's spectral light source or other reasons, the final calculated chromaticity value and the actual chromaticity value may be different. Therefore, the chromaticity compensation value is obtained through the automatic calibration mode, and the chromaticity compensation value is compensated to the calculated chromaticity value of the coffee particles when calculating the chromaticity value of the coffee particles, thereby improving the calculation accuracy. Specifically, in step S702, a frame of initial representative chromaticity diagram is obtained based on the at least one frame of original image; the method of obtaining the initial representative chromaticity diagram can be the same as the method of obtaining the representative chromaticity diagram described above. The representative chromaticity diagram of the coffee particles is then determined based on the chromaticity value in the initial representative chromaticity diagram of the coffee particles and the chromaticity compensation value. For example, the initial representative chromaticity value of each pixel position in the initial representative chromaticity diagram is added or subtracted from the chromaticity compensation value to obtain the representative chromaticity value of each pixel position, that is, the representative chromaticity diagram.
[0116] In actual applications, since coffee particles may not occupy the entire original image, there are some pixels that do not correspond to coffee particles. If the chromaticity values of coffee particles are also calculated based on the pixels that do not correspond to coffee particles, the calculation accuracy of the chromaticity values of coffee particles will be reduced. As shown in Figure 9, Figure 9 is a schematic diagram of a captured image of a frame of coffee particles. In this captured image, a partial pixel area 91 corresponding to the supporting surface can be seen. Therefore, optionally, when acquiring at least one frame of original image in step S701, at least one initial original image is acquired, and the at least one frame of original image is determined based on the at least one initial original image. Specifically, after acquiring the initial original image, invalid pixel values can be determined from the initial original image, and the invalid pixel values are pixel values in the initial original image corresponding to objects other than the coffee particles; the invalid pixel values in the at least one initial original image are removed to obtain the at least one frame of original image. In this way, the representative chromaticity diagram obtained based on the at least one original image in the subsequent step S702 can more accurately reflect the chromaticity values of coffee particles.
[0117] There are many ways to determine the valid pixel values or ineffective pixel values in the initial raw image. Optionally, in the example where the raw image is an image of coffee particles placed on a supporting surface, the raw image contains ineffective pixel values corresponding to the bottom surface of the supporting surface because the coffee particles fail to cover the entire supporting surface. The presence of these ineffective pixel values will affect the measurement of the colorimetric values of the coffee particles. The supporting surface can be set to have a color that is significantly different from the color of the coffee particles (e.g., white) or a texture that is significantly different from the surface texture of the coffee particles, or a pattern that is easily recognizable. In this way, the ineffective pixel values can be identified by identifying the color, texture, or pattern of the raw image. Alternatively, there is no need to identify the color, texture, or pattern of the raw image. Since the effective pixel values have certain commonalities due to the similarity of the coffee particles and are significantly different from the ineffective pixel values, the effective pixel values or ineffective pixel values can be identified by the difference and / or similarity of the raw data at each pixel position.
[0118] In some examples, when obtaining at least one frame of original image in step S701, specifically obtaining at least one frame of initial original image; obtaining at least one frame of initial original image; obtaining a brightness compensation function; determining the original pixel compensation value of the pixel position based on the brightness compensation function and the pixel position in the initial original image; and compensating the original pixel value of the pixel position in the at least one frame of initial original image based on the original pixel compensation value of the pixel position to obtain the at least one frame of original image.
[0119] In colorimetric analysis, the unevenness of the spectral light source may cause different brightness in different areas, which in turn causes areas with the same chromaticity value in areas with different brightness to have different original pixel values, leading to analysis errors. Therefore, during the calibration process of the colorimetric analysis equipment of coffee particles before leaving the factory, the analysis of a single sample coffee particle with uniform chromaticity distribution in the entire field of view can obtain the original pixel value distribution of different pixel positions (corresponding to different brightness), and then calculate the original pixel compensation value at different pixel positions, that is, the brightness compensation function. For example, the brightness compensation function can be the relationship between the distance between the pixel position and the center position of the image and the original pixel compensation value. In this way, compensating and calibrating the brightness of pixels in different areas in the algorithm can improve the measurement accuracy of colorimetric analysis.
[0120] Optionally, in some examples, the carrying surface is specifically the bottom surface of a preset sample tray, and the depth of the preset sample tray is set to enable the preset sample tray to carry at least two layers of coffee particles, so as to avoid the bottom surface of the preset sample tray appearing in the original image when imaging the coffee particles.
[0121] Optionally, when determining the at least one frame of original image based on the at least one frame of initial original image in step S701, it can also include obtaining the distance distribution between the coffee particles and the image acquisition module, and compensating the pixel values in the at least one frame of initial original image according to the distance distribution to obtain the at least one frame of original image.
[0122] In practical applications, when the image acquisition module images coffee particles, the distance between the image acquisition module and the coffee particles varies, resulting in some differences in the raw data of the resulting original image. These differences can lead to inconsistent measurement benchmarks for the colorimetric values of different coffee particles in the original image, resulting in deviations in the measurement results. By compensating the pixel values in the at least one original image frame based on the distance distribution and performing calculations based on the compensated at least one original image frame, the accuracy of the colorimetric values of the coffee particles can be further improved.
[0123] There are various methods for obtaining the distance distribution between the coffee particles and the image acquisition module. In some examples, a distance measurement module is controlled to emit a light beam toward the coffee particles and receive reflected light from the coffee particles. The distance distribution between the coffee particles and the image acquisition module is obtained based on the emitted light beam and the reflected light. The original image is divided into at least one region, and the distance distribution refers to the distance between the coffee particles and the image acquisition module in each region. It will be appreciated that the more regions are divided, the more detailed the distance distribution.
[0124] Optionally, the distance measurement module is a laser distance measurement module, located adjacent to the image acquisition module, configured to emit a laser beam toward the coffee particles, receive the laser beam reflected by the coffee particles, and measure the distance between the coffee particles and the image acquisition module based on the emitted and received laser beams. The measurement method may include a pulse method, a coherent method, or a triangulation method. Laser triangulation is preferred because it requires less of a laser distance measurement module and therefore offers lower costs.
[0125] In some examples, the supporting surface is specifically the bottom of a preset sample tray. An image of coffee particles located in the preset sample tray is captured by an image acquisition module. The image is divided into at least one region. A target pixel area corresponding to the bottom of the preset sample tray is determined in each region. A distribution of distances between the coffee particles and the image acquisition module is determined based on the percentage of the target pixel area in each region. Specifically, in a divided region, if the ratio of the area of the target pixel area corresponding to the bottom of the preset sample tray to the area of the region is greater than a certain value, it can be determined that the coffee particles in the preset sample tray in that region are only spread out in a single layer. The distance between the coffee particles and the image acquisition module in that region can be estimated based on the pre-calibrated height of the coffee particles and the distance between the preset sample tray and the image acquisition module. If the ratio of the target pixel area corresponding to the bottom of the preset sample tray in that region is less than a certain value, it can be determined that the coffee particles fully cover the preset sample tray in that region, and the pre-calibrated distance between the preset sample tray and the image acquisition module is used as the distance between the coffee particles and the image acquisition module in that region.
[0126] After determining the distance distribution between the coffee particles and the image acquisition module, the pixel values in the at least one frame of the original image are compensated based on the distance distribution to bring the raw pixel values in the original image to the value that would have occurred if all coffee particles were at the same distance from the image acquisition module. For example, based on a pre-calibrated correlation function between distance and raw pixel value, the raw pixel values in at least one region of the at least one frame of the original image can be compensated based on the acquired distance distribution to bring the raw pixel values in the region to the value that would have occurred if the distance between the coffee particles and the image acquisition module was the predetermined distance.
[0127] Optionally, a vibration source is provided on the other side of the bottom surface of the preset sample tray for vibrating the bottom surface of the preset sample tray to uniformly distribute the coffee particles within the preset sample tray. Optionally, before each acquisition of the original image, the vibration source is used to vibrate the bottom surface of the preset sample tray to uniformly distribute the coffee particles. In this way, when obtaining the distance between the coffee particles and the image acquisition module using the distance measurement module, it is not necessary to obtain the distance distribution of different areas in the preset sample tray; only the distance between the coffee particles and the image acquisition module at one location needs to be obtained. When compensating the raw pixel values in the original image, based on the obtained distance between the coffee particles and the image acquisition module at one location, the raw pixel values of all areas in the original image are uniformly compensated to the raw pixel values corresponding to the preset distance between the coffee particles and the image acquisition module.
[0128] Alternatively, in the example of acquiring the distance distribution between coffee particles and the image acquisition module, mechanical waves are emitted to the preset sample tray to vibrate the preset sample tray, thereby changing the distribution of coffee particles within the preset sample tray, only when it is detected that the distance distribution satisfies a preset condition. The preset condition may be that mechanical waves are emitted to the preset sample tray only when the difference between the distances in the distance distribution between coffee particles and the image acquisition module exceeds a preset difference, thereby uniformizing the distribution of coffee particles within the preset sample tray. At least one original image is then acquired of the uniformly distributed coffee particles.
[0129] The vibration frequency, amplitude, or duration of the vibration source can be fixed or adjustable. Optionally, the display interface of the coffee particle analysis device also includes adjustment options for the vibration frequency, amplitude, or duration, allowing the user to select the appropriate vibration frequency, amplitude, or duration based on the size of the coffee particles. Alternatively, the coffee particle analysis device can preliminarily determine the particle size of the coffee particles based on the analysis results of one or several previous image frames captured by the image acquisition module and automatically adjust the vibration amplitude or duration accordingly.
[0130] In practical applications, the higher the temperature of the coffee particles, the higher the energy of the infrared rays radiated outward by the coffee particles, which in turn causes certain interference to the image detection and affects the chromaticity measurement. Optionally, in some examples, in step S702, a frame of initial representative chromaticity diagram is obtained based on the at least one frame of the original image; in addition, the chromaticity analysis device for the coffee particles is provided with a temperature sensor, which is used to obtain the current ambient temperature and determine the chromaticity compensation method corresponding to the current ambient temperature from the chromaticity compensation methods at different temperatures; the representative chromaticity diagram of the coffee particles is determined based on the chromaticity values in the initial representative chromaticity diagram of the coffee particles and the chromaticity compensation method. Specifically, the current ambient temperature can be the temperature of the sensor, the temperature of the light source, or the temperature of the coffee particles.
[0131] Among them, the temperature sensor can be set close to the preset sample tray so that the measured temperature is closer to the temperature of the coffee particles in the preset sample tray. The chromaticity compensation method at different temperatures can be obtained through the calibration before leaving the factory and stored in the analysis equipment of the coffee particles. Specifically, the difference between the chromaticity values calculated at multiple ambient temperatures and the chromaticity value calculated at the reference temperature can be determined in the calibration as the chromaticity compensation value. The representative chromaticity diagram of the coffee particles is determined based on the initial representative chromaticity values in the initial representative chromaticity diagram of the coffee particles and the chromaticity compensation method, specifically, each initial representative chromaticity value in the initial representative chromaticity diagram is added or subtracted with the chromaticity compensation value corresponding to the current ambient temperature as the representative chromaticity value to obtain the representative chromaticity diagram.
[0132] In the prior art, colorimetric analysis is typically performed based on the colorimetric value of the coffee particles when the colorimetric analysis device and the coffee particles reach temperature equilibrium. When the temperature of the coffee particles is higher than the temperature of the device, the temperature difference between the two can cause colorimetric measurement errors. In the embodiments of the present application, temperature compensation is performed by pre-obtaining the colorimetric compensation corresponding to multiple temperatures of the coffee particles and detecting the colorimetric compensation value under non-temperature equilibrium conditions.
[0133] The present application also provides a device for analyzing coffee particles, as shown in FIG11 , which is an exemplary diagram of an embodiment of the device for analyzing coffee particles of the present application. The device for analyzing coffee particles 1100 includes:
[0134] A control module 1101 is configured to control a vibration source to drive the coffee particles to vibrate at least twice;
[0135] An image acquisition module 1102 is configured to acquire images of the coffee particles after the at least two vibrations, respectively, to obtain a set of images to be tested having coffee particles with different distributions;
[0136] A first acquisition module 1103 is configured to respectively acquire initial recognition information of coffee particles in the images to be tested in the image set to be tested;
[0137] The first determining module 1104 is configured to determine final identification information of the coffee particles based on initial identification information of coffee particles in at least some frames of the image set to be tested.
[0138] Optionally, the control module 1101 is used to control the vibration source to drive the coffee particles to vibrate in a first driving manner to obtain coffee particles with a first distribution; the image acquisition module 1102 is used to capture images of the coffee particles with the first distribution to obtain a first image to be tested; the control module 1101 is also used to control the vibration source to drive the coffee particles with the first distribution to vibrate in a second driving manner to obtain coffee particles with a second distribution; the image acquisition module 1102 is also used to capture images of the coffee particles with the second distribution to obtain a second image to be tested.
[0139] Optionally, the first driving mode and the second driving mode are different; the control module 1101 is further used to control the vibration source to drive the coffee particles with the first distribution to vibrate in the second driving mode at least once after controlling the vibration source to drive the coffee particles with the first distribution to vibrate in the second driving mode; the image acquisition module 1102 is also used to capture images of the coffee particles after each driving in the second driving mode, to obtain at least one frame of image to be measured.
[0140] Optionally, the first driving mode and the second driving mode are different in at least one of the following: vibration frequency, vibration amplitude, vibration time, and vibration area.
[0141] Optionally, the vibration frequency in the first driving mode is a resonant frequency, and the vibration frequency in the second driving mode is less than or greater than the resonant frequency; and / or the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode.
[0142] Optionally, the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode, and the vibration time in the second driving mode is longer than the vibration time in the first driving mode.
[0143] Optionally, the second driving mode is determined according to the first image to be tested.
[0144] Optionally, the device 1100 also includes: a second determination module, used to determine at least one of the vibration frequency, vibration amplitude, vibration time or vibration area in the second driving mode based on the initial identification information of the coffee particles in the first image to be tested; the initial identification information of the coffee particles in the first image to be tested includes the number and / or area of the coffee particles in the first image to be tested.
[0145] Optionally, the initial identification information of the coffee particles in the image to be tested includes the number of coffee particles; the device 1100 also includes: a third determination module, used to determine the change in the number of coffee particles based on the number of coffee particles in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested; and a fourth determination module, used to determine the driving mode of the vibration source after the second image to be tested based on the change in number.
[0146] Optionally, determining the driving mode of the vibration source after the second image to be tested based on the quantity change includes at least one of the following: when the quantity change is a decrease or the change value is less than a threshold value, stopping the vibration source from driving the coffee particles for the next time or continuing to drive the coffee particles for the next time in the second driving mode; or, when the quantity change is an increase and the change value is greater than the threshold value, continuing to drive the coffee particles for the next time in the first driving mode.
[0147] Optionally, the number of coffee particles in at least one frame of image to be tested, the first image to be tested, and the second image to be tested before the first image to be tested is the number of particles whose area is greater than a preset critical value in at least one frame of image to be tested, the first image to be tested, and the second image to be tested before the first image to be tested.
[0148] Optionally, the initial identification information includes at least one of the particle size, quantity, area, volume, mass, and chromaticity of the coffee particles; and / or at least one of the quantity, area, volume, mass, and chromaticity of extremely small coffee particles, wherein the extremely small coffee particles are coffee particles having a particle size smaller than a first preset particle size, or a particle size smaller than the first preset particle size and greater than a preset critical value, wherein the value of the first preset particle size is smaller than the value of the particle size in the multiple particle size intervals.
[0149] Optionally, the initial identification information also includes: at least one of the number distribution, area distribution, volume distribution, mass distribution, and chromaticity distribution of the coffee particles in different particle size ranges; and / or information on the proportion of the extremely small coffee particles in all coffee particles.
[0150] Optionally, the final identification information includes at least one of a final number distribution, a final area distribution, a final volume distribution, a final mass distribution, and a final chromaticity distribution of the coffee particles in different particle size ranges; the apparatus 1100 further includes:
[0151] The display module is used to display at least one of the final number distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges on an interactive interface.
[0152] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles;
[0153] The device 1100 also includes: a second acquisition module, which is used to obtain a distortion function before determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the image to be tested in the image set to be tested, wherein the distortion function is used to indicate the particle size compensation values at multiple pixel positions; a distortion correction module, which is used to perform distortion correction on the particle size of at least some of the coffee particles in the image to be tested in the image set to be tested according to the pixel positions of the coffee particles and the corresponding particle size compensation values to obtain the particle size of the coffee particles after distortion correction; the first determination module is specifically used to determine the final identification information of the coffee particles based on the particle size of the coffee particles in at least some frames of the image to be tested in the image set to be tested after distortion correction.
[0154] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles; before determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the image to be tested in the image set to be tested, it also includes: a third acquisition module, used to obtain a particle size compensation function, and the particle size compensation function is used to indicate the particle size compensation value under multiple brightnesses; a fourth acquisition module, used to respectively obtain the brightness of the area where the coffee particles are located in at least some frames of the image to be tested in the image set to be tested; a compensation module, used to compensate the particle size of the coffee particles in the at least some frames of the image to be tested according to the brightness of the area where the coffee particles are located in the image to be tested and the particle size compensation value, to obtain the compensated particle size of the coffee particles; the first determination module is specifically used to determine the final identification information of the coffee particles based on the compensated particle size of the coffee particles in at least some frames of the image to be tested in the image set to be tested.
[0155] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles; the method also includes a calibration module for entering a calibration mode, wherein, in the calibration mode, the calibration module is further used to: capture an image of a calibration pattern with a preset area located at a preset position within the field of view to obtain a calibration image; obtain the number of pixels corresponding to the calibration pattern; determine the calibration size corresponding to one pixel based on the preset area and the number of pixels; the first acquisition module is specifically used to: respectively obtain the number of pixels of the coffee particles in the image to be tested in the image set to be tested; determine the particle size of the coffee particles based on the calibration size and the number of pixels.
[0156] Optionally, the image to be tested is an image captured when the coffee particles are illuminated by an illumination light source; the device also includes: a fifth acquisition module, used to acquire at least one frame of raw image, the at least one frame of raw image containing raw pixel values of the image captured when the coffee particles are illuminated by at least one light source different from the illumination light source; a sixth acquisition module, used to acquire a frame of representative chromaticity diagram based on the at least one frame of raw image; and a fifth determination module, used to determine the overall chromaticity value of the coffee particles based on the one frame of representative chromaticity diagram.
[0157] The present application also provides a coffee particle analysis device, as shown in FIG12 , which is an exemplary diagram of an embodiment of the coffee particle analysis device of the present application. The coffee particle analysis device 1200 includes a memory 1201 and a processor 1202. The memory 1201 stores executable code. When the executable code is processed by the processor 1202, the coffee particle analysis device can perform any of the coffee particle analysis methods described above.
[0158] Optionally, the coffee particle analysis device 1200 further includes a vibration source, a light source module, a photosensitive array, and a support surface for supporting the coffee particles. The light source module includes an illumination light source and a backlight light source, respectively located on either side of the support surface. The photosensitive array is configured to capture images of the coffee particles on the support surface when the illumination light source and the backlight light source emit light beams.
[0159] As shown in Figures 13 and 14, Figure 13 is a schematic structural diagram of the vibration source, supporting surface, and backlight source in one embodiment of the coffee particle analysis device of the present application, and Figure 14 is an exploded view of the structure shown in Figure 13. Optionally, the vibration source 1301 includes a power amplifier, or the vibration source includes at least two linear vibration sources with different directions. The description of the vibration source can refer to the description of the vibration source above and will not be repeated here. In Figures 13 and 14, the vibration source 1301 is schematically illustrated with a power amplifier.
[0160] The supporting surface 1302 is specifically a first light-evening film. A second light-evening film 1303 and a light guide plate 1304 are also disposed between the power amplifier 1301 and the first light-evening film 1302. The first light-evening film 1302, the light guide plate 1304, and the second light-evening film 1303 are arranged in parallel, with the light guide plate 1304 located within the airtight space enclosed by the first light-evening film 1302 and the second light-evening film 1303. The backlight source 1305 is located at the periphery of the light guide plate 1304.
[0161] Optionally, the second light-evening film 1303 and the light guide plate 1304 are each glued to the first light-evening film 1302 to form a sealed air cavity. The second light-evening film 1303 is connected to the power amplifier 1301. When the vibration of the power amplifier 1301 is transmitted to the second light-evening film 1303, the vibration of the second light-evening film 1303 is transmitted through the air cavity to the first light-evening film 1302, thereby driving the vibration of the coffee particles. Optionally, the light guide plate 1304 is also provided with at least one through-hole 13041 to facilitate the transmission of vibration through the air cavity.
[0162] During particle size analysis, if only the illumination light source is turned on, since the illumination light source and the photosensitive array are located on the same side of the support surface, the illumination light source's beam acts as a top light relative to the support surface, resulting in a darker background in the image being measured. This is shown in Figure 15, which is a schematic diagram of an image being measured captured by the photosensitive array when only the illumination light source is turned on. Due to the dark background of the image being measured, errors may occur when distinguishing between the background and coffee particles, reducing the accuracy of the particle size analysis of the coffee particles. By providing a backlight light source on the side of the support surface facing away from the photosensitive array, and turning on both the backlight light source and the illumination light source simultaneously when measuring particle size, the dark background problem can be effectively resolved. Figure 16 is a schematic diagram of an image being measured captured by the photosensitive array when both the illumination light source and the backlight light source are turned on. It can be seen that the backlight light source enables more accurate distinction between the background and coffee particles, improving the accuracy of the particle size analysis of the coffee particles. Furthermore, to solve the problem of uniform backlighting at the bottom, a light guide plate is used in this example, and the light source is illuminated from the side of the light guide plate, which can improve the brightness uniformity of the image to be measured and improve the accuracy of the particle size analysis of the coffee particles.
[0163] Optionally, the light source module further includes at least two spectral light sources configured to emit light of different wavelengths between 500 nm and 1100 nm. When executing the above-described coffee particle analysis method, the processor acquires at least one raw image, specifically a raw image captured by the photosensitive array of the coffee particles when the at least two spectral light sources are respectively irradiated on the coffee particles.
[0164] Optionally, a preset calibration color card is further provided inside the coffee particle analysis device, such as the preset calibration color card described in FIG10 . For example, the coffee particle analysis device further includes a hollow cylindrical structural member with an opening on one side, and a base detachably fixed to the opening of the structural member. The light source module and the photosensitive array are provided on the inner top of the structure, and the base includes a bearing surface and a vibration source. The preset calibration color card is fixed to the inner side surface of the structural member, is located within the field of view of the photosensitive array, and does not block the coffee particles on the bearing surface.
[0165] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), the processor is caused to execute part or all of the steps of the above-mentioned method according to the present application. The various embodiments of the present application have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Without departing from the scope and spirit of the described embodiments, many modifications and changes are obvious to those of ordinary skill in the art. The choice of terms used in this article is intended to best explain the principles of the embodiments, practical applications or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for analyzing coffee particles, It is characterized in that include: Controlling a vibration source to drive coffee particles to vibrate at least twice, respectively capturing images of the coffee particles after the at least two vibrations, to obtain a set of images to be tested having coffee particles with different distributions; respectively obtaining initial identification information of coffee particles in the images to be tested in the image set to be tested; The final identification information of the coffee particles is determined according to the initial identification information of the coffee particles in at least some frames of the images to be tested in the image set to be tested.
2. The method according to claim 1, It is characterized in that The controlling vibration source drives the coffee particles to vibrate at least twice, and respectively collects images of the coffee particles after the at least two vibrations, to obtain a set of images to be tested having coffee particles with different distributions, including: Controlling a vibration source to drive the coffee particles to vibrate in a first driving mode to obtain coffee particles having a first distribution; Capturing an image of the coffee particles having the first distribution to obtain a first image to be measured; Controlling the vibration source to drive the coffee particles with the first distribution to vibrate in a second driving mode to obtain coffee particles with a second distribution; An image of the coffee particles having the second distribution is captured to obtain a second image to be tested.
3. The method according to claim 2, It is characterized in that The first driving mode and the second driving mode are different; The step of controlling the vibration source to drive the coffee particles having the first distribution to vibrate in a second driving manner further comprises: Controlling the vibration source to drive the coffee particles to vibrate at least once in the second driving mode; respectively collecting images of the coffee particles after each driving in the second driving mode, At least one frame of image to be tested is obtained.
4. The method according to claim 2, It is characterized in that At least one of the following is different between the first driving mode and the second driving mode: Vibration frequency, vibration amplitude, vibration time, vibration area.
5. The method according to claim 4, It is characterized in that The vibration frequency in the first driving mode is a resonance frequency, and the vibration frequency in the second driving mode is less than or greater than the resonance frequency; and / or, The vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode.
6. The method according to claim 5, It is characterized in that The vibration amplitude in the first driving mode is larger than the vibration amplitude in the second driving mode, and the vibration time in the second driving mode is longer than the vibration time in the first driving mode.
7. The method according to any one of claims 2 to 6, It is characterized in that The second driving mode is determined according to the first image to be tested.
8. The method according to claim 7, It is characterized in that The method further comprises: Determining at least one of the vibration frequency, vibration amplitude, vibration time or vibration area in the second driving mode according to the initial recognition information of the coffee particles in the first image to be tested; The initial identification information of the coffee particles in the first image to be detected includes the number and / or area of the coffee particles in the first image to be detected.
9. The method according to claim 7, It is characterized in that The initial identification information of the coffee particles in the image to be tested includes the number of coffee particles; The method further comprises: Determine the change in the quantity of the coffee particles according to the quantity of the coffee particles in at least one frame of the image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested; The driving mode of the vibration source after the second image to be measured is determined according to the change in quantity.
10. The method according to claim 9, It is characterized in that The step of determining the driving mode of the vibration source after the second image to be measured according to the change in quantity includes at least one of the following: When the quantity changes to a decrease or the change value is less than a threshold, stopping the vibration source from driving the coffee particles for the next time or continuing to drive the coffee particles for the next time in the second driving mode; or, When the quantity change is an increase and the change value is greater than the threshold, the next driving of the coffee particles is continued in the first driving mode.
11. The method according to claim 10, It is characterized in that The number of coffee particles in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested is the number of particles with an area greater than a preset critical value in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested.
12. The method according to any one of claims 1 to 6, It is characterized in that The initial identification information includes at least one of the particle size, quantity, area, volume, mass, and chromaticity of the coffee particles; and / or at least one of the quantity, area, volume, mass, and chromaticity of extremely small coffee particles, wherein the extremely small coffee particles are coffee particles having a particle size smaller than a first preset particle size, or a particle size smaller than the first preset particle size and greater than a preset critical value, wherein the value of the first preset particle size is smaller than the value of the particle size in the multiple particle size ranges.
13. The method according to claim 12, It is characterized in that The initial identification information also includes: At least one of the number distribution, area distribution, volume distribution, mass distribution and chromaticity distribution of the coffee particles in different particle size intervals; and / or, The proportion of the extremely small coffee particles in all coffee particles.
14. The method according to claim 13, It is characterized in that The final identification information includes at least one of the final number distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges; The method further comprises: At least one of the final number distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges is displayed on the interactive interface.
15. The method according to any one of claims 1 to 6, It is characterized in that The initial identification information of the coffee particles includes the particle size of the coffee particles; Before determining the final identification information of the coffee particles according to the initial identification information of the coffee particles in at least some frames of the images to be tested in the image set to be tested, the method further includes: Obtaining a distortion function, where the distortion function is used to indicate particle size compensation values at a plurality of pixel positions; Performing distortion correction on the particle sizes of at least part of the coffee particles in the image to be tested in the image set to be tested according to the pixel positions of the coffee particles and the corresponding particle size compensation values to obtain the particle sizes of the coffee particles after the distortion correction; The determining the final identification information of the coffee particles according to the initial identification information of the coffee particles in at least some frames of the images to be tested in the image set to be tested comprises: Final identification information of the coffee particles is determined based on the distortion-corrected particle sizes of the coffee particles in at least some frames of the images to be tested in the image set to be tested.
16. The method according to any one of claims 1 to 6, It is characterized in that The initial identification information of the coffee particles includes the particle size of the coffee particles; Before determining the final identification information of the coffee particles according to the initial identification information of the coffee particles in at least some frames of the images to be tested in the image set to be tested, the method further includes: Acquire a particle size compensation function, where the particle size compensation function is used to indicate particle size compensation values at multiple brightness levels; Respectively obtaining the brightness of the area where the coffee particles are located in at least some frames of the image to be tested in the image set to be tested; For at least part of the frame of the image to be tested, the particle size of the coffee particles in the image to be tested is compensated according to the brightness of the area where the coffee particles in the image to be tested are located and the particle size compensation value to obtain the compensated particle size of the coffee particles; The determining the final identification information of the coffee particles according to the initial identification information of the coffee particles in at least some frames of the images to be tested in the image set to be tested comprises: The final identification information of the coffee particles is determined according to the compensated particle sizes of the coffee particles in at least some frames of the images to be tested in the image set to be tested.
17. The method according to any one of claims 1 to 6, It is characterized in that The initial identification information of the coffee particles includes the particle size of the coffee particles; The method further comprises: Entering a calibration mode, wherein in the calibration mode: Capturing an image of a calibration pattern with a preset area and located at a preset position within the field of view to obtain a calibration image; Obtaining the number of pixels corresponding to the calibration pattern; Determining a calibration size corresponding to one pixel according to the preset area and the number of pixels; The step of respectively obtaining initial identification information of coffee particles of the images to be tested in the image set to be tested includes: respectively obtaining the number of pixels of coffee particles in the images to be tested in the image set to be tested; The particle size of the coffee particles is determined according to the calibrated size and the number of pixels.
18. The method according to any one of claims 1 to 6, It is characterized in that The image to be measured is an image captured when the coffee particles are illuminated by a light source; The method further comprises: Acquire at least one frame of raw image, wherein the at least one frame of raw image comprises raw pixel values of an image of the coffee particles captured when at least one light source different from the irradiation light source irradiates the coffee particles; Acquire a frame of representative chromaticity diagram according to the at least one frame of original image; The overall chromaticity value of the coffee particles is determined based on the one frame representative chromaticity diagram.
19. An analysis device for coffee particles, It is characterized in that include: A control module, used for controlling the vibration source to drive the coffee particles to vibrate at least twice; An image acquisition module, used to respectively acquire images of the coffee particles after the at least two vibrations, to obtain a set of images to be tested having coffee particles with different distributions; A first acquisition module, used for respectively acquiring initial recognition information of coffee particles in the images to be tested in the image set to be tested; The first determination module is used to determine the final identification information of the coffee particles according to the initial identification information of the coffee particles in at least part of the frames of the image set to be tested.
20. An analytical device for coffee particles, It is characterized in that It comprises a memory and a processor, wherein the memory stores executable codes, and when the executable codes are processed by the processor, the processor can execute the coffee particle analysis method according to any one of claims 1 to 18.
21. The device according to claim 20, It is characterized in that Also includes: A vibration source, a light source module, a photosensitive array, and a bearing surface for bearing the coffee particles; The vibration source is located on one side of the bearing surface; The light source module includes an irradiation light source located on a side of the carrying surface for carrying the coffee particles; The photosensitive array is used to capture the image to be measured of the coffee particles on the carrying surface when the irradiation light source emits a light beam.
22. The device according to claim 21, It is characterized in that The bearing surface is specifically a first light uniforming film; A second light-evening film and a light guide plate are further provided between the vibration source and the first light-evening film, the first light-evening film, the light guide plate and the second light-evening film are arranged in parallel in sequence, and the light guide plate is located in an airtight space surrounded by the first light-evening film and the second light-evening film; at least one through hole is further provided on the light guide plate; The light source module further comprises a backlight source, which is located at the periphery of the light guide plate; The photosensitive array is used to capture the image to be measured of the coffee particles on the carrying surface when the illumination light source and the backlight light source emit light beams.
23. The device according to claim 21, It is characterized in that The vibration source includes a power amplifier, or the vibration source includes at least two linear vibration sources with different directions.
24. The device according to claim 21, It is characterized in that The light source module also includes at least two spectral light sources for respectively emitting light of different wavelengths between 500nm and 1100nm; The processor is further configured to: Acquire at least one frame of raw image, wherein the at least one frame of raw image includes raw pixel values of images of the coffee particles collected when the at least two spectral light sources are respectively irradiated on the coffee particles; Acquire a frame of representative chromaticity diagram according to the at least one frame of original image; The overall chromaticity value of the coffee particles is determined based on the one frame representative chromaticity diagram.
25. A computer-readable storage medium, It is characterized in that An executable code is stored thereon, and when the executable code is executed by a coffee particle identification device, the coffee particle identification device is caused to perform the method as claimed in any one of claims 1 to 18.
Citation Information
Patent Citations
Method and apparatus for particle size determination
CN105247342A
Online particle size monitoring method and system
CN108489872A
Method and system for analyzing particle size of aggregate after multi-stage separation of muck
CN112945808A
Particle size identification method, device, equipment and medium
CN114324078A
Instrument for measuring average particle size of ceramic
JP2003042935A
