Method, apparatus, device and computer-readable storage medium for analyzing coffee particles

By vibrating coffee particles to achieve multiple distributions and analyzing the resulting images, the method addresses the inaccuracies in existing coffee particle size analysis, enhancing measurement precision and accuracy.

JP2026511131APending Publication Date: 2026-04-10SHENZHEN DIGITIZING FLUID TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
SHENZHEN DIGITIZING FLUID TECH CO LTD
Filing Date
2023-04-14
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing methods for analyzing coffee particle size distribution, particularly through image analysis, lack accuracy due to issues with particle adhesion and non-uniform distribution.

Method used

A method involving controlled vibration of coffee particles to achieve multiple distributions, followed by image collection and analysis of these distributions to determine accurate particle size and distribution information, utilizing a vibration source to disperse adhered particles and improve measurement accuracy.

Benefits of technology

Enhances the accuracy of coffee particle size analysis by ensuring discrete particle distribution and reducing measurement errors caused by adhesion, thereby improving the precision of particle size determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026511131000001_ABST
    Figure 2026511131000001_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device and computer-readable storage medium for analyzing coffee particles. The method includes: controlling a vibration source to drive coffee particles to vibrate at least twice, collecting images of the coffee particles after at least two vibrations to obtain a set of test images of coffee particles having different distributions; obtaining initial identification information of coffee particles in each test image in the set of test images; and determining final identification information of the coffee particles based on the initial identification information of coffee particles in at least some of the frames of the test images in the set of test images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0004] , , , , , , , , ,

[0005] , ,

[0001] This application relates to the field of coffee measurement, and in particular, to a method, apparatus, device, and computer-readable storage medium for analyzing coffee particles.

Background Art

[0002] In coffee extraction, the grinding degree of coffee powder, that is, the coarseness and uniformity of the particle size of coffee powder, determine the contact area between coffee powder and extracted water and affect the extraction rate of coffee powder. Generally, the finer the coffee powder, the higher the extraction rate. Therefore, the extraction rate of coffee can be adjusted by adjusting the grinding degree of coffee powder. Particle size analysis can determine the particle size distribution of coffee powder, analyze the coarseness and uniformity of coffee powder, and help determine whether the coffee powder is too coarse or too fine. And the extraction rate of coffee can be adjusted by adjusting the coarseness of coffee powder. One method of analyzing the particle size distribution of coffee powder is to collect an image of the coffee powder and obtain the particle size of the coffee powder by analyzing the image.

[0003] There is still room for improvement in the method of analyzing the particle size of coffee powder by image analysis.

Summary of the Invention

Problems to be Solved by the Invention

[0004] This application provides a method, apparatus, device, and computer-readable storage medium for analyzing coffee particle size that can improve the accuracy of coffee particles.

Means for Solving the Problems

[0005] In a first embodiment of the present application, a coffee particle analysis method is provided, the coffee particle analysis method comprising: controlling a vibration source to drive coffee particles to vibrate at least twice, collecting images of the coffee particles after at least two vibrations, and obtaining a set of test images of coffee particles having different distributions; obtaining initial identification information of coffee particles in each test image in the set of test images; and determining final identification information of the coffee particles based on the initial identification information of coffee particles in at least some of the frames of the test images in the set of test images.

[0006] The step of selectively controlling the vibration source to drive coffee particles to vibrate at least twice, collecting images of the coffee particles after at least two vibrations, and obtaining a set of test images of coffee particles having different distributions includes: controlling the vibration source to drive the coffee particles to vibrate using a first drive mode to obtain coffee particles having a first distribution; collecting images of the coffee particles having the first distribution to obtain a first test image; controlling the vibration source to drive the coffee particles having the first distribution to vibrate using a second drive mode to obtain coffee particles having a second distribution; and collecting images of the coffee particles having the second distribution to obtain a second test image.

[0007] Selectively, the first drive mode and the second drive mode are different, and controlling the vibration source to drive coffee particles having a first distribution to vibrate using the second drive mode further includes controlling the vibration source to drive the coffee particles to vibrate at least once using the second drive mode, collecting an image of the coffee particles after each drive using the second drive mode, and acquiring at least one test image.

[0008] Selectively, the first drive mode and the second drive mode differ in at least one of the vibration frequency, vibration amplitude, vibration time, and vibration region.

[0009] Selectively, the vibration frequency of the first drive mode is the resonant frequency, the vibration frequency of the second drive mode is less than the resonant frequency, or the vibration frequency of the second drive mode is greater than the resonant frequency, and / or the vibration amplitude of the first drive mode is greater than the vibration amplitude of the second drive mode.

[0010] Selectively, the vibration amplitude in the first drive mode is greater than the vibration amplitude in the second drive mode, and the vibration time in the second drive mode is longer than the vibration time in the first drive mode.

[0011] Selectively, the second drive mode is determined based on the first test image.

[0012] Selectively, the method further includes determining at least one of the vibration frequency, vibration amplitude, vibration time, or vibration region in the second drive mode based on initial identification information of coffee particles in the first test image, wherein the initial identification information of coffee particles in the first test image includes the number and / or area of ​​coffee particles in the first test image.

[0013] Selectively, the initial identification information of coffee particles in the first test image includes the number of coffee particles.

[0014] Selectively, the method further includes determining a change in the number of coffee particles based on a test image of at least one frame preceding the first test image, the number of coffee particles in the first test image and the second test image, and determining a drive mode of the vibration source after the second test image based on the change in the number.

[0015] Selectively determining the drive mode of the vibration source after the second test image based on the change in the number means stopping the next drive of the coffee particles by the vibration source or continuing the next drive of the coffee particles using the second drive mode if the change in the number is a decrease in quantity or the change value is less than a threshold, or continuing the next drive of the coffee particles using the first drive mode if the change in the number is an increase in quantity and the change value is greater than a threshold. of include.

[0016] Selectively, the number of coffee particles in the test image of at least one frame preceding the first test image, the first test image, and the second test image is the number of particles in the test image of at least one frame preceding the first test image, the first test image, and the second test image whose area is greater than a preset threshold.

[0017] Selectively, 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 the minute coffee particles, wherein the minute 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 larger than a preset threshold, where the value of the first preset particle size is smaller than the particle size values ​​in a plurality of particle size ranges.

[0018] Selectively, the initial identification information includes at least one of the quantity 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 minute coffee particles among all coffee particles.

[0019] Selectively, the final identification information includes at least one of the final quantity distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges.

[0020] The method further includes displaying at least one of the final quantity 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.

[0021] Selectively, the initial identification information of the coffee particles includes the particle size of the coffee particles, and prior to the step of 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 test images in the set of test images, the method further includes obtaining a distortion function, the distortion function indicating particle size correction values ​​at a plurality of pixel positions, and performing distortion correction on the coffee particles in at least some frames of the test images in the set of test images based on the pixel positions of the coffee particles and the corresponding particle size correction values ​​to obtain the distortion-corrected particle size of the coffee particles, and the step of 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 test images in the set of test images 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 test images in the set of test images.

[0022] Selectively, the initial identification information of the coffee particles includes the particle size of the coffee particles, and prior to the step of 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 test images in the test image set, the method obtains a particle size correction function, the particle size correction function is used to indicate particle size correction values ​​at multiple brightness levels, and obtains the brightness of the region where the coffee particles are located in at least some frames of the test images in the test image set. The step of determining the final identification information of the coffee particles based on the brightness of the region where the coffee particles are located in the test image and the particle size correction value, for at least a portion of the test image, and obtaining the corrected particle size of the coffee particles, further comprising determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least a portion of the frames of the test image set, and determining the final identification information of the coffee particles based on the corrected particle size of the coffee particles in at least a portion of the frames of the test image set.

[0023] Selectively, the initial identification information of the coffee particles includes the particle size of the coffee particles, and the method further includes entering a calibration mode, where in the calibration mode, collecting images of a calibration pattern having a preset area and positioned at a preset location in 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, and obtaining initial identification information of coffee particles in the test images in the set of images includes obtaining the number of pixels of each coffee particle in the test images in the set of images, and determining the particle size of the coffee particles based on the calibration size and the number of pixels.

[0024] Selectively, the test image is an image collected when the coffee particles are irradiated by an illumination light source, and the method further includes: acquiring at least one frame of raw image, the at least one frame of raw image including raw pixel values ​​of the collected image of the coffee particles when the coffee particles are irradiated by at least one light source different from the illumination light source; acquiring a representative chromaticity diagram of one frame based on the at least one frame of raw image; and determining the overall chromaticity value of the coffee particles based on the representative chromaticity diagram of one frame.

[0025] A second aspect of the present application provides an analyzer for coffee particles, the analyzer including a control module, an image acquisition module, a first acquisition module, and a first determination module, wherein the control module is used to drive and control a vibration source to vibrate the coffee particles at least twice, the image acquisition module is used to collect images of the coffee particles after being vibrated at least twice respectively to obtain a set of test images of coffee particles having different distributions, the first acquisition module is used to respectively obtain initial identification information of the coffee particles in the test images in the set of test images, and the first determination module is used to determine final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the test images in the set of test images.

[0026] A third aspect of the present application provides an analysis device for coffee particles, the analysis device for coffee particles including a memory and a processor, wherein an execution code is stored in the memory, and when the execution code is processed by the processor, the processor can execute any one of the above-mentioned coffee particle analysis methods.

[0027] Optionally, the analysis device for coffee particles further includes a vibration source, a light source module, a photosensitive array, and a support surface for supporting the coffee particles, the vibration source is located on one side of the support surface, the light source module includes an irradiation light source located on the side of the support surface for supporting the coffee particles, and the photosensitive array is used to collect an image of the coffee particles on the support surface when the irradiation light source emits light rays.

[0028] Optionally, the support surface is specifically a first light homogenization film, and a second light homogenization film and a light guide plate are further disposed between the vibration source and the first light homogenization film. The first light homogenization film, the light guide plate, and the second light homogenization film are arranged in parallel in sequence. The light guide plate is disposed in an airtight space surrounded by the first light homogenization film and the second light homogenization film. At least one through hole is further provided in the light guide plate. The light source module further includes a backlight source disposed at the peripheral portion of the light guide plate. The photosensitive array is used to collect a test image of coffee particles on the support surface when the irradiation light source and the backlight source emit light rays.

[0029] Optionally, the vibration source includes a power amplifier, or the vibration source includes at least two linear vibration sources having different directions.

[0030] Optionally, the light source module further includes at least two spectral light sources used to emit lights of different wavelengths from 500 nm to 1100 nm respectively. The processor acquires at least one frame of raw image. The at least one frame of raw image includes raw pixel values of an image collected from the coffee particles when the at least two spectral light sources irradiate the coffee particles respectively, acquires a representative chromaticity diagram of one frame based on the at least one frame of raw image, and is used to determine the overall chromaticity value of the coffee particles based on the representative chromaticity diagram of the one frame.

[0031] The fourth aspect of the present application provides a computer-readable storage medium, in which executable code is stored, and when the executable code is executed by a coffee particle identification device, the coffee particle identification device executes any of the above methods.

[0032] In coffee particle size analysis, ensuring a discrete distribution of coffee particles is a prerequisite for improving measurement accuracy. When multiple coffee particles adhere to each other, the measurement results for coffee particle size become significantly biased. In the embodiments of this application, the adhered coffee particles can be dispersed and their distribution altered by vibrating them at least twice using a vibration source. By obtaining final identification information using identification information from multiple frames of coffee particles with different distributions, the accuracy of coffee particle identification can be improved. [Brief explanation of the drawing]

[0033] [Figure 1] This is a schematic diagram showing one embodiment of the coffee particle analysis method of this application. [Figure 2] This is a schematic diagram showing one embodiment of the coffee particle size distribution histogram of the present application. [Figure 3] This is a schematic diagram showing another embodiment of the coffee particle size distribution histogram of the present application. [Figure 4] This is a schematic diagram of the quantitative distribution histogram of the final identification information of coffee particles displayed in the interactive interface. [Figure 5-6] These are test images of coffee particles at different brightness levels. [Figure 7] This is a schematic diagram showing one embodiment of the coffee particle analysis method of this application. [Figure 8] This is a schematic diagram of the interactive interface of this application. [Figure 9] This is a schematic diagram of one frame of a coffee particle collection image. [Figure 10] This is a schematic diagram showing one embodiment of the pre-configured calibration color card of this application. [Figure 11] This is a schematic diagram of one embodiment of the coffee particle analyzer of this application. [Figure 12] This is a schematic diagram of one embodiment of the coffee particle analysis device of this application. [Figure 13]This is a schematic diagram showing the structure of a vibration source, support surface, and backlight source in one embodiment of the coffee particle analysis device of this application. [Figure 14] This is a schematic diagram of the test image collected by the photosensitive array when only the illumination light source is lit, compared to the backlight light source. [Figure 15] This is a schematic diagram of the test image collected by the photosensitive array when both the illumination light source and the backlight light source are illuminated. [Modes for carrying out the invention]

[0034] The embodiments of this application will be described in more detail below with reference to the attached drawings. Although the embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make this application thorough and complete and to fully convey the scope of this application to those skilled in the art.

[0035] The terminology used in this application is for the sole purpose of describing specific embodiments and is not intended to limit this application. The singular forms “one,” “the said,” and “the said” as used in this application and the attached claims include the plural form unless explicitly stated otherwise in the context. Furthermore, the term “and / or” as used herein refers to and encompasses any possible combination of one or more related enumerated items.

[0036] In this application, terms such as “first,” “second,” and “third” may be used to describe various types of information, but it should be understood that such information is not limited to these terms. These terms are used simply to distinguish the same type of information from one another. For example, first information may also be called second information, and similarly, second information may also be called first information, but this does not exceed the scope of this application. Therefore, features defined as “first” or “second” may explicitly or implicitly include one or more such features. In this application, “multiple” means two or more unless otherwise specifically defined.

[0037] As shown in Figure 1, Figure 1 is a schematic diagram of one embodiment of the coffee particle analysis method of this application. The coffee particle analysis method includes the following steps.

[0038] Step (S101): Control the vibration source to drive the coffee particles to vibrate at least twice, collect images of the coffee particles after they have been vibrated at least twice, and obtain a test image set of coffee particles with different distributions.

[0039] Selectively, coffee particles can refer to coffee beans, coffee powder, or coffee particles of other shapes and sizes. The method for analyzing coffee particles of this application is applied to a coffee particle analysis device. In one example, the coffee particle analysis device comprises a photosensitive array used to collect images containing coffee particles to obtain a test image. The photosensitive array may include a charge-coupled device (CCD) or a complementary metal oxide semiconductor (CMOS). Selectively, the coffee particle analysis device may also include a support surface for holding the coffee particles. For example, the coffee particle analysis device may also include a pre-configured sample tray, the support surface being the bottom surface of the pre-configured sample tray. The photosensitive array is used, in particular, to collect coffee particles in the pre-configured sample tray to obtain a multi-frame test image. The test image set includes a multi-frame test image. Selectively, the coffee particle analysis device also includes an illumination light source, which is used to illuminate the coffee particles when the photosensitive array is imaging the coffee particles.

[0040] Optionally, a vibration source is provided on the support surface opposite to the coffee particles. The vibration source can be driven to vibrate the support surface, thereby driving the coffee particles on the support surface to vibrate and changing the distribution of the coffee particles. Optionally, the vibration source is controlled to vibrate the coffee particles before each test image of the coffee particles is collected.

[0041] Optionally, the support surface is a vibrating membrane, on which coffee particles are supported, and a vibration source vibrates the coffee particles by vibrating the vibrating membrane. Optionally, the vibration source is a power amplifier used to radiate sound waves to drive the vibrating membrane. Alternatively, the vibration source may be a vibration source used to radiate other mechanical waves, such as water waves or rope waves. Alternatively, the vibration source may vibrate the coffee particles by other means (e.g., mechanical impact) rather than radiating mechanical waves. In one example, the vibration source is an electromagnetic coil, electrode, pneumatic hammer, spring, etc., connected to the support surface, which is driven to vibrate the coffee particles on the support surface by impacting the support surface. In one example, the vibration source includes at least two linear vibration sources having different directions. The direction and separation of vibration of the coffee particles can be controlled by controlling the transverse and longitudinal wave frequencies of each linear vibration source. In one example, multiple vibration sources can be placed on the back side of the support surface. In a Cartesian coordinate system centered on the center of the support 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 vibration directions perpendicular to the support surface can be placed at the four corners of the support surface. motor By controlling the amplitude and frequency, control is achieved using the principles of resonance and coherent wave interference.

[0042] In one example, a vibration source is controlled to drive the coffee particles to vibrate in a first drive mode to obtain coffee particles having a first distribution. Images of the coffee particles having the first distribution are collected to obtain a first test image. The vibration source is controlled to drive the coffee particles having the first distribution to vibrate in a second drive mode to obtain coffee particles having a second distribution. Images of the coffee particles having the second distribution are collected to obtain a second test image. The first and second drive modes may be the same. For example, the vibration source can be controlled to drive the coffee particles to vibrate multiple times in a certain manner, and after each vibration stops, the coffee particles after the vibration can be collected to obtain multiple frames of test images of coffee particles having different distributions.

[0043] Alternatively, the first drive mode and the second drive mode may be different. Optionally, the first drive mode and the second drive mode differ in at least one of the vibration frequency, vibration amplitude, vibration time, and vibration area. Optionally, the vibration frequency of the first drive mode is the resonant frequency, the vibration frequency of the second drive mode is less than or greater than the resonant frequency, and / or the vibration amplitude of the first drive mode is greater than the vibration amplitude of the second drive mode. Since the vibration frequency of the vibration source is the resonant frequency at which the maximum or near-maximum vibration amplitude can be achieved, the vibration is first performed using the resonant frequency or a larger vibration amplitude until the coffee particles are separated. For example, before collecting an image of the coffee particles in the first test, the coffee particles can be driven to vibrate at the resonant frequency to better separate them, and the collected first test image is useful for more accurately measuring the particle size of the coffee particles. Subsequently, the distribution of coffee particles can be fine-tuned using a smaller vibration amplitude before collecting a second test image. By using these first and second test images, the accuracy of the coffee particle size analysis can be improved.

[0044] Selectively, the vibration amplitude of the first drive mode is greater than that of the second drive mode, and the vibration duration of the second drive mode is longer than that of the first drive mode. This allows for the first complete separation of coffee particles by vibration using a shorter vibration duration and larger vibration amplitude, after which a first test image is collected. Subsequently, the coffee particles are further separated by vibration using a longer vibration duration and smaller vibration amplitude, allowing for fine-tuning of the coffee particle distribution and easier acquisition of more particle size information regarding the size of the coffee particles. For example, the vibration duration of the first drive mode is any time between 0.1 seconds and 0.5 seconds, and the vibration duration of the second drive mode is any time between 0.1 seconds and 1 second that is longer than the vibration duration of the first drive mode. Alternatively, selectively, the vibration duration of the second drive mode may be the same as that of the first drive mode, or the vibration duration of the second drive mode may be shorter than that of the first drive mode.

[0045] The vibration source is optionally controlled to vibrate coffee particles having the first distribution using a second drive mode, and then the vibration source is further controlled to drive the coffee particles to vibrate at least once using the second drive mode, and an image of the coffee particles after each drive using the second drive mode is collected to obtain at least one test image frame. Alternatively, during the process in which the vibration source drives the coffee particles in the second drive mode, images of the coffee particles are continuously collected at a predetermined time interval without stopping the vibration source from driving the coffee particles, and multiple test images frame.

[0046] Step (S102): Obtain initial identification information for each coffee particle in the test image within the set of test images.

[0047] Selectively, the initial identification information includes at least one of the particle size, quantity, area, volume, and mass of the coffee particles. Selectively, the initial identification information includes at least one of the distributions of the particle size, quantity, area, volume, and mass of the coffee particles.

[0048] Here, there are various methods for determining the particle size of coffee grounds. For example, the area occupied by coffee grounds particles in a test image is measured, and the diameter of a circle with the same area is calculated from that area, and this diameter is used for coffee. grain This is the initial particle size of the coffee. grain Conventional methods for analyzing particle size primarily utilize sieving or laser scattering. Sieving is low-cost but inefficient, while laser scattering is highly efficient but expensive. Compared to these two methods, image analysis offers advantages such as faster identification speed, higher analytical efficiency, and lower cost.

[0049] Here, when detecting the area of ​​coffee particles, machine learning techniques can be used to identify the size of coffee particles in the test image, and by marking the attached and non-attached states of the coffee particles, and / or by marking the silvery film within the coffee particles, the efficiency and accuracy of identifying the size of the coffee particles can be improved.

[0050] Here, the volume of the coffee particles can be calculated based on the particle size and / or area. The mass of the coffee particles can be calculated based on the volume of the coffee particles and a predetermined density.

[0051] Selectively, the initial identification information includes distribution information of coffee particles within different particle size ranges. This distribution information includes the quantity distribution, area distribution, volume distribution, mass distribution, and / or chromaticity distribution of coffee particles within those ranges. For example, nine particle size ranges are pre-set: 200μm-300μm, 300μm-425μm, 425μm-600μm, 600μm-850μm, 850μm-1180μm, 1180μm-1400μm, 1400μm-1700μm, 1700μm-2360μm, and 2360μm-2600μm. Of course, the number of pre-set particle size ranges and the length of each particle size range are not limited to those specified herein and can be set in other ways. After determining the particle size of each coffee particle in the test image, the quantity distribution of coffee particles across multiple pre-defined particle size ranges may be the sum of the quantities of coffee particles in each pre-defined particle size range, or the ratio of the sum of the quantities of coffee particles in each pre-defined particle size range to the sum of the quantities of coffee particles across all pre-defined particle size ranges. Similarly, the area / volume / mass distribution of coffee particles across multiple pre-defined particle size ranges may be the sum of the area / volume / mass in each pre-defined particle size range, or the ratio of the sum of the area / volume / mass in each pre-defined particle size range to the sum of the area / volume / mass across all pre-defined particle size ranges. The chromaticity distribution of coffee particles across multiple pre-defined particle size ranges may be the average or median chromaticity value in each pre-defined particle size range.

[0052] As shown in Figure 2, Figure 2 is a schematic diagram illustrating one embodiment of a coffee particle size distribution histogram according to the present application. Each box in the histogram corresponds to a preset particle size range. The horizontal axis of the histogram represents the particle size corresponding to the preset particle size range, and the vertical axis represents the ratio of the number of coffee particles in the preset particle size range to the total number of coffee particles in all preset particle size ranges.

[0053] As shown in Figure 3, Figure 3 is a schematic diagram illustrating another embodiment of the coffee particle size range histogram according to the present application. Each box in the histogram corresponds to a single preset particle size range. The horizontal axis of the histogram represents the particle size corresponding to the preset particle size range, and the vertical axis represents the ratio of the total area of ​​coffee particles in the preset particle size range to the total area of ​​coffee particles in all preset particle size ranges.

[0054] In one example, the initial identification information includes at least one of the quantity, area, volume, and mass of the very small coffee particles. The very 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 threshold. Here, the first preset particle size is smaller than the particle size values ​​in a plurality of preset particle size ranges. For example, the very small coffee particles are coffee particles having a particle size of less than 200 μm. In the coffee grinding process, particle size varies depending on the requirements of various extraction methods, but generally, it is desirable to obtain coffee particles with high uniformity. The very small coffee particles are particles produced in the grinding process that are outside the desired particle size range. Obtaining information about the very small coffee particles allows the user to obtain reference information on the grinding effect. For example, if the quantity or area of ​​the very small coffee particles exceeds a certain value, or if the quantity ratio or area ratio exceeds a certain value, it means that the grinding quality is poor.

[0055] Optionally, the initial identification information further includes information on the proportion of the minute coffee particles among all coffee particles. This proportion information may be the ratio of the total quantity, total area, total volume, or total mass of the minute coffee particles to the total quantity, total area, total volume, or total mass of all coffee particles.

[0056] Optionally, before obtaining initial identification information for coffee particles in a test image, it is further determined whether the coffee particles are coffee powder or coffee beans. Specifically, it is possible to determine whether the coffee particles are coffee powder or coffee beans by analyzing user input or the test image. For example, it is possible to determine whether the coffee particles are coffee powder or coffee beans by obtaining the gradient of the test image and using the classification result of that gradient.

[0057] Step (S103): Based on the initial identification information of the coffee particles in at least some of the frames of the test images in the test image set, the final identification information of the coffee particles is determined.

[0058] For example, the final particle size information of coffee particles can be obtained by summing the initial identification information of coffee particles in all frames of the test image set using a weighted average. This can reduce measurement errors and improve measurement accuracy. Alternatively, the validity of each test image in the test image set can be determined selectively, and the final identification information of coffee particles can be obtained based only on the initial identification information of coffee particles in the valid test images. There are various methods for determining whether a test image is valid. For example, if a significant amount of coffee particles adhere to the test image, the test image is determined to be invalid. For example, the area of ​​coffee particles in the test image can be detected, and if the area of ​​the coffee particles exceeds a first threshold, or if the proportion of coffee particles whose area exceeds a second threshold, or if the area exceeds a preset proportion, the test image for that frame is determined to be invalid. The first and second thresholds may be the same or different.

[0059] When summing the initial identification information of coffee particles in at least some frames of test images within a test image set using a weighted average, distribution information for each frame of at least some frames of test images within multiple different particle size ranges is obtained, and this distribution information is summed using a weighted average. Specifically, for each particle size range, at least one of the quantity, area, volume, or mass of test images in multiple frames is obtained, and these are summed using a weighted average for the same type of item. Alternatively, for very small coffee particles, at least one of the quantity, area, volume, or mass of very small coffee particles in test images in multiple frames is obtained, and these are summed using a weighted average for the same type of item.

[0060] Optionally, the same weighting values ​​are assigned to the test images in each frame, and the same type of item in the test images across multiple frames is averaged and summed. Optionally, the ratio of the total quantity in each particle size range to the total quantity across the entire particle size range, the ratio of the total area in each particle size range to the total area across the entire particle size range, the ratio of the total volume in each particle size range to the total volume across the entire particle size range, or the ratio of the total mass in each particle size range to the total mass across the entire particle size range can be obtained.

[0061] Optionally, the final identification information for coffee particles is displayed via an interactive interface. As shown in Figure 4, Figure 4 is a schematic diagram of the quantity distribution histogram of the final identification information for coffee particles displayed in the interactive interface. This final identification information includes the total quantity of coffee particles within nine predefined particle size ranges and the ratio of the total quantity of coffee particles within all particle size ranges. The nine predefined particle size ranges are 200μm~300μm, 300μm~425μm, 425μm~600μm, 600μm~850μm, 850μm~1180μm, 1180μm~1400μm, 1400μm~1700μm, 1700μm~2360μm, and 2360μm~2600μm. In Figure 4, the x-axis represents the median of each of the nine particle size ranges, and the y-axis represents the ratio of the quantity of coffee particles within each particle size range to the total quantity of coffee particles within all particle size ranges.

[0062] Optionally, the interactive interface displays the particle size range in which the median particle size of the coffee particles lies. The median particle size refers to the particle size at which the cumulative particle size distribution ratio of the coffee particles reaches 50%, and its physical meaning is that 50% of the particles are larger than the median particle size, and 50% are smaller than the median particle size. As shown in Figure 4, for example, if the median particle size is within the particle size range of 600 μm to 850 μm, the quantity ratio within that particle size range is indicated by displaying it in a different color or pattern than the quantity ratio displayed on other devices.

[0063] In coffee particle size analysis, ensuring a discrete distribution of coffee particles is a prerequisite for improving measurement accuracy. If many coffee particles adhere to each other, the measured particle size becomes too large. In the embodiments of this application, by driving the coffee particles to vibrate at least twice using a vibration source, the adhered coffee particles can be vibrated and dispersed, thereby changing the distribution of the coffee particles. The identification information in multiple frames of coffee particles with different distributions provides the final identification information, thereby improving the accuracy of coffee particle identification.

[0064] In some examples, during multiple vibrations of coffee particles driven by the control of a vibration source, at least one driving mode of the driving operation is determined based on one or more images collected around that driving operation. For example, the earlier second driving mode is determined based on the first test image. For example, the degree of adhesion of the coffee particles in the first test image is obtained, and at least one of the vibration frequency, vibration amplitude, vibration time, or vibration region in the second driving mode is determined based on the degree of adhesion.

[0065] Here, the degree of adhesion is determined based on the number and / or area of ​​coffee particles in the first test image. For example, the number and total area of ​​coffee particles in part or all of the region of the first test image are detected, and if the ratio of the total area to the number in that region falls within a different range... If Different degrees of adhesion are associated with each other. Alternatively, the area of ​​each coffee particle within the region is detected, and if the area is larger than a preset area, or if the number of coffee particles larger than a preset area falls within a different range, different degrees of adhesion are associated. Optionally, different degrees of adhesion correspond to different vibration frequencies, vibration amplitudes, or vibration times. After determining the degree of adhesion of the coffee particles in the first test image, the corresponding vibration frequency, vibration amplitude, or vibration time is used as the vibration frequency, vibration amplitude, or vibration time in the second drive mode based on the degree of adhesion. In examples where the vibration source can drive vibrations in different regions, the vibration frequency, vibration amplitude, or vibration time corresponding to each region can be determined based on the degree of adhesion of the coffee particles in that region.

[0066] Selectively, for regions with high adhesion, the second drive mode has at least one of the following: a higher vibration frequency, a higher vibration amplitude, and a longer vibration time than the first drive mode. Selectively, only one of the vibration frequency, vibration amplitude, and vibration time may be increased, while the other parameters remain at their default values. For example, when determining the second drive mode based on the first test image, both the vibration frequency and vibration amplitude may remain at their default values, and the vibration time may be determined based on the degree of adhesion of coffee particles in the first test image.

[0067] Optionally, the first test image is fixedly divided into multiple regions according to a predetermined method, for example, evenly divided into four regions. The method of dividing the regions can be combined with the control accuracy of the vibration source, and the vibration source can vibrate different regions. For example, different regions can be vibrated using multiple vibration sources, or the vibration of a region can be changed by moving the vibration position of the vibration source. For each region of the first test image, the degree of adhesion of that region can be determined by the method described above. Regions where the degree of adhesion exceeds a predetermined level can be made into vibration regions for the second drive mode. Alternatively, selectively, the first test image can be fixedly divided into multiple regions without being based on a predetermined method. In an example where the drive position of the vibration source can be controlled, after detecting a position where the degree of adhesion of coffee particles exceeds a predetermined level, the vibration source can drive that position as the center of the vibration region.

[0068] In some examples, the degree of adhesion of coffee particles in the first test image is obtained, and the vibration frequency in the second drive mode is determined based on the degree of adhesion. The degree of adhesion of coffee particles in the first test image can be determined based on the degree of adhesion of coffee particles, and thereby the corresponding vibration frequency can be determined. For example, the higher the degree of adhesion, the higher the vibration frequency used.

[0069] In some examples, the initial identification information for coffee particles in the test image includes the quantity of coffee particles. After obtaining the initial identification information for coffee particles in the test image, the change in the quantity of coffee particles is determined based on the quantity of coffee particles in at least one frame before the first test image, the first test image, and the second test image. Furthermore, the drive mode of the vibration source from the second test image onward is determined based on the change in quantity information. Optionally, if the change in quantity information indicates that the quantity of coffee particles in each test image has decreased or the absolute value of the change in quantity is less than a threshold within a series of pre-set test images, the next drive of the coffee particles by the vibration source is stopped, or the coffee particles are driven to vibrate using a drive mode in which the vibration amplitude is smaller than a pre-set amplitude, the vibration frequency is smaller than a pre-set frequency, or the vibration time is smaller than a pre-set time. Alternatively, if the quantity change information indicates that the quantity of coffee particles in each test image increases within a series of preset test images, and the change is greater than a threshold, the coffee particles are driven to vibrate using a drive mode in which the vibration amplitude is greater than a preset amplitude, the vibration frequency is greater than a preset frequency, or the vibration time is greater than a preset time.

[0070] In a specific embodiment, the vibration source may be equipped with only two different drive modes: a first drive mode and a second drive mode. Here, the vibration frequency of the first drive mode is the resonant frequency, the vibration frequency of the second drive mode is either less than or greater than the resonant frequency, and / or the vibration amplitude of the first drive mode is greater than the vibration amplitude of the second drive mode. Before first collecting a test image of the coffee particles, the first drive mode is used to drive the coffee particles to vibrate and disperse them. After first collecting the test image, the first drive mode can be used to continue driving the coffee particles to vibrate before collecting at least two subsequent test images. Alternatively, the second drive mode may be used to drive the coffee particles to vibrate before collecting at least two subsequent test images. After collecting at least three frames of test images, the change in the number of coffee particles is determined based on the number of coffee particles in the test image of each frame. In a series of pre-set test images, if the quantity of coffee particles decreases in each test image, or if the absolute value of the change in quantity is less than a threshold, the next drive of the coffee particles by the vibration source is stopped, or the next drive of the coffee particles is continued using the second drive mode. Alternatively, if the change in quantity increases and the value of the change is greater than a threshold, the next drive of the coffee particles is continued again using the first drive mode.

[0071] Selectively, the initial identification information of the coffee particles includes the particle size of the coffee particles. Furthermore, a distortion function is obtained before step (S103). The distortion function is used to indicate particle size correction values ​​at multiple pixel positions. The particle size of at least some of the coffee particles in the test images within the test image set is distortion-corrected based on the pixel position of the coffee particles and the corresponding particle size correction value, thereby obtaining the distortion-corrected particle size of the coffee particles. In step (S103), the final identification information of the coffee particles is determined specifically based on the distortion-corrected particle size in at least some of the frames of the test images within the test image set. Camera imaging distortion can introduce errors into the measurement of coffee particle size at the edges. These errors can be reduced by correcting the distortion function. Here, the distortion function can be obtained and stored by calibrating the device before shipment. Selectively, during the calibration process, a checkerboard pattern can be imaged using a photosensitive array in the coffee particle analysis device, and the distortion coefficient, i.e., the distortion function, can be fitted to each pixel position.

[0072] Optionally, the distortion function is a curve representing the relationship between the distance between the pixel position and the image center position, and the difference between the actual particle size and the calculated particle size at the pixel position. During particle size analysis, after obtaining the distance between the pixel position and the image center position of the coffee particles, the difference between the calculated particle size and the actual particle size can be obtained based on this distance and the distortion function. This difference can be corrected to the calculated particle size, correcting the distortion and obtaining a more accurate particle size result.

[0073] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles. Before step (S103), a particle size correction function is obtained. The particle size correction function represents particle size correction values ​​at multiple brightness levels. Furthermore, the brightness of the region where the coffee particles are located in at least some frames of the test images in the test image set is obtained. For at least some frames of the test images, the particle size of the coffee particles in the test images is corrected based on the brightness of the region where the coffee particles are located in the test images and the particle size correction values ​​to obtain the corrected particle size of the coffee particles. In step (S103), specifically, the final identification information of the coffee particles is determined based on the corrected particle size of the coffee particles in at least some frames of the test images in the test image set. In particle size analysis, non-uniformity of the illumination light source or different backgrounds of the support surface may result in different brightness levels in different regions. Different brightness levels may lead to inconsistent calculation results for the particle size of the same coffee particles.

[0074] For example, as shown in Figures 5 and 6, these are test images of coffee particles in different brightness regions. In Figure 5, the coffee particles are located in the medium brightness region 701, and the edges of the coffee particles are relatively clear. However, in Figure 6, the coffee particles are located in the excessively bright region 601, causing the edges of the coffee particles to be overexposed, resulting in erosion of the edges in the test image and measurement errors in particle size analysis. Therefore, in the pre-factory calibration process, the particle size of the same coffee particles in different brightness regions can be analyzed to obtain and save the effect of different brightness levels on the calculation of coffee particle size. In actual particle size analysis, the particle size of coffee particles in different brightness regions is corrected and calibrated to improve measurement accuracy.

[0075] Optionally, the initial identification information of the coffee particles includes the particle size of the coffee particles. The coffee particle analysis method of this application further includes entering a calibration mode. In the calibration mode, a calibration image is obtained by collecting an image of a calibration pattern having a preset area and positioned at a preset location in the field of view, the number of pixels corresponding to the calibration pattern is obtained, and the calibration size corresponding to one pixel is determined 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 coffee particles in the test images in the test image set is obtained, and the particle size of the coffee particles is determined based on the calibration size and the number of pixels.

[0076] In a real-world application, the system could enter calibration mode when triggered by the user, or it could automatically enter calibration mode periodically by default to obtain the latest calibration size, or the user could configure how calibration mode is triggered.

[0077] In some cases, the coffee particle analysis method of this application can be used not only to analyze the quantity, particle size, area, volume, or mass of coffee particles, but also to analyze the chromaticity of coffee particles. As shown in Figure 7, Figure 7 shows a schematic diagram of one embodiment of the coffee particle analysis method of this application. Optionally, the coffee particle chromaticity analysis method of this embodiment further includes the following steps.

[0078] Step (S701): Acquire at least one frame of raw images, the raw image of at least one frame including the raw pixel values ​​of the coffee particles collected when at least one light source illuminates each coffee particle.

[0079] Optionally, the at least one light source includes a light source whose emission spectrum includes a wavelength of 850 nm. Optionally, the at least one light source is different from the irradiation light source in the coffee particle analysis device described above. To easily distinguish the at least one light source from the irradiation light source, the at least one light source will hereafter be referred to as the spectral light source.

[0080] Optionally, coffee particles may refer to coffee beans, coffee powder, or other coffee particle objects of different shapes and sizes. In one example, the coffee particle analysis device is provided with only one spectral light source. In another example, the coffee particle analysis device is provided with at least two spectral light sources having different emission spectra. Optionally, at least two spectral light sources are each used to emit light rays of different wavelengths between 500 nm and 1100 nm. Experiments have shown that the reflection of coffee particles in spectra within this range is more effective in calculating the chromaticity value of coffee particles. For example, the coffee particle analysis device is provided with at least a portion of six spectral light sources having emission spectra including six wavelengths: 520 nm, 600 nm, 640 nm, 850 nm, 940 nm, and 1100 nm, respectively. Even coffee particles with the same roasted chromaticity have different reflectivity to light of different spectra. Therefore, multiple spectral light sources with different spectra illuminate the coffee particles, each forming a different raw image of the reflected light. The algorithm then fuses these raw images corresponding to the spectral light sources with different spectra to determine the chromaticity value of the coffee particles. This effectively avoids the problem of poor stability in detection results obtained from chromaticity values ​​collected using a single spectrum.

[0081] In an example where a single spectral light source is provided within the coffee particle analysis device, a photosensitive array within the coffee particle analysis device is used to collect images of the coffee particles when the spectral light source irradiates the coffee particles and to obtain at least one frame of initial raw images. In an example where the coffee particle analysis device is provided with n spectral light sources, n is 2 or greater, and the n spectral light sources are used to irradiate the coffee particles at different times. The image acquisition module is used to collect images of the coffee particles when each spectral light source irradiates the coffee particles and to obtain at least n frames of initial raw images, where each of the n frames of initial raw images corresponds to one spectral light source.

[0082] Here, the raw image of one frame corresponding to each spectral light source may be an initial raw image of one frame acquired by the image acquisition module when the spectral light source irradiates the coffee particles, or it may be a raw image of one frame obtained by combining multiple initial raw images of frames acquired by the image acquisition module when the spectral light source irradiates the coffee particles.

[0083] Here, the initial raw image contains the raw pixel values ​​(also called RAW data) at each pixel position. This RAW data refers to the original record of high and low voltage levels when the image acquisition module converts optical signals into electrical signals when acquiring images of coffee particles, and is unprocessed RAW data. RAW data is usually output in a specific order, for example, GRBG, RGGB, BGGR, or GBRG. Here, R represents red, G represents green, and B represents blue. There are three common RAW data formats: raw8, raw10, and raw12, indicating that each pixel contains 8 bits, 10 bits, and 12 bits of data, respectively.

[0084] Step (S702): Obtain a representative chromaticity diagram for one frame based on the raw image of at least one frame. 。

[0085] Here, there may be multiple chromaticity values ​​representing each pixel position in the representative chromaticity diagram. For example, the chromaticity value may be "Agtron," an index indicating the degree of roasting of coffee particles, or other values ​​that reflect the chromaticity of coffee particles.

[0086] There are several methods for obtaining a representative chromaticity diagram for one frame based on at least one frame of the raw image. For example, in the case of a spectral light source having only one emission spectrum, i.e., where at least one frame of the raw image is specifically one frame of the raw image, a basis function is obtained. The basis function may be stored in advance. The basis function is a function between the raw 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 basis function corresponding to the raw pixel values ​​in the raw image, thereby obtaining a chromaticity diagram corresponding to the raw image.

[0087] In cases where n is 2 or more, corresponding to n spectral light sources having different emission spectra, and where at least one frame of the raw image is specifically n frames of raw images, a representative chromaticity diagram of one frame can be obtained using a linear model method.

[0088] In the linear model method, for example, n frames of raw images can be first merged into a single frame of raw images, and then a corresponding chromaticity diagram can be obtained based on the resulting single frame of raw images. Selectively, the weights of the n spectral light sources can be obtained, and the n frames of raw images may be weighted and merged into a single frame of raw images by adding the weights of the n spectral light sources, for example, by summing the weights.

[0089] Alternatively, in the linear model method, first, corresponding chromaticity diagrams are generated based on the raw images of the n frames, and the chromaticity diagrams for the n frames are obtained. Then, these n frame chromaticity diagrams are merged with a representative chromaticity diagram for one frame. Selectively, the weights of the n spectral light sources are obtained, and a representative chromaticity diagram for one frame is generated based on the weights of the n spectral light sources and the chromaticity diagrams for the n frames. For example, the representative chromaticity diagram for one frame is formed by merging the weighted sums.

[0090] For example, in one case, five spectral light sources with different emission spectra are set up, and the five spectral light sources correspond to weights a1, a2, a3, a4, and a5, respectively. A chromaticity diagram for five frames is obtained corresponding to these five spectral light sources. The chromaticity values ​​at the same pixel position on the five chromaticity diagrams are Ag1, Ag2, Ag3, Ag4, and Ag5, respectively, and the representative chromaticity value at that pixel position is a1*Ag1 + a2*Ag2 + a3*Ag3 + a4*Ag4 + a5*Ag5.

[0091] Here, there are several methods for generating a chromaticity diagram for the corresponding n frames based on the raw images of the n frames. For example, for the k-th spectral light source, obtain the basis function corresponding to the k-th spectral light source. The basis function is a relationship function between the raw pixel values ​​collected under the illumination of the k-th spectral light source and the corresponding chromaticity values. k is any integer from 1 to n. Obtain the raw pixel values ​​of the raw image of the k-th frame. The raw image of the k-th frame is the raw image collected when the coffee particles are illuminated by the k-th spectral light source. Obtain the corresponding chromaticity values ​​based on the raw pixel values ​​of the raw image of the k-th frame and the basis function corresponding to the k-th spectral light source, and obtain a chromaticity diagram corresponding to the raw image of the k-th frame.

[0092] Step (S703): Based on the representative chromaticity diagram of the frame, the overall chromaticity value of the coffee particles is determined.

[0093] Optionally, a representative chromaticity distribution is obtained based on the representative chromaticity diagram of the frame. This representative chromaticity distribution includes the ratio of the number of pixels with different representative chromaticity values ​​to the total number of pixels. Optionally, the representative chromaticity value with the highest ratio is taken as the overall chromaticity value of the coffee grains, or the weighted average of multiple representative chromaticity values ​​greater than a preset threshold for their ratios is taken as the overall chromaticity value of the coffee grains, or the mean or median of the representative chromaticity distribution is taken as the overall chromaticity value of the coffee grains. Here, when a weighted average of multiple chromaticity values ​​whose ratios are greater than a preset threshold is taken, the weight of each chromaticity value can be determined based on its ratio. For example, the higher the ratio, the greater the weight of the saturation value.

[0094] Compared to conventional methods of calculating chromaticity values ​​from grayscale images output by a photosensitive array, this embodiment acquires the raw image collected by the photosensitive array. The accuracy of this raw image is far higher than that of the grayscale image. Generally, the numerical range of a grayscale image is 0 to 255, but the upper limit of the numerical value of the raw image can reach 3000 to 4000 or even higher. Calculating the chromaticity value directly from this raw image significantly improves the accuracy of the chromaticity value, as there is no need to convert it to a grayscale value from a grayscale image, thus improving the accuracy of the chromaticity value.

[0095] In some examples, after obtaining a representative chromaticity diagram of at least one frame of raw image and the overall chromaticity value of coffee grains, the overall chromaticity value is displayed in the interactive interface. Selectively, the representative chromaticity distribution is also displayed in the interactive interface. As shown in Figure 8, Figure 8 is a schematic diagram of the interactive interface of this application. The interactive interface displays the representative chromaticity distribution, specifically the sum of pixel areas at different representative chromaticity value intervals, or the ratio of the sum of pixel areas to the total area, in the form of a chromaticity histogram. Furthermore, the overall chromaticity value is displayed in the interactive interface, specifically AG73.2. Selectively, the interactive interface highlights the representative chromaticity value interval in which the overall chromaticity value is included in the chromaticity histogram, thereby indicating that the overall chromaticity value is included in that representative chromaticity value interval.

[0096] In step (S702), basis functions for spectral light sources with different spectra can be obtained by calibration and stored in advance. During calculation, the weights stored in advance are read directly and used for calculation. There are many calibration methods; for example, for a first spectral light source, multiple preset color cards with different chromaticity values ​​can be irradiated using the first spectral light source, and the raw pixel values ​​corresponding to each preset color card can be obtained. Since the chromaticity values ​​of each preset color card are known, the basis function corresponding to the first spectral light source can be fitted and obtained using the chromaticity values ​​of multiple preset color cards and the corresponding raw pixel values. The calibration method for the basis functions of other spectral light sources can be the same as the calibration method for the basis function of the first spectral light source.

[0097] When obtaining the basis function for each spectral light source, the weight of the spectral light source is determined based on the degree of linear correlation between the chromaticity values ​​of the multiple preset color cards and the corresponding raw pixel values. When assigning weights to spectral light sources of different spectra, spectral light sources with a higher degree of linear correlation between the raw data and chromaticity values ​​correspond to higher weights. Optionally, the n spectral light sources include a first spectral light source and a second spectral light source, where the output spectrum of the first spectral light source includes a wavelength of 850 nm, and the dominant wavelength of the output spectrum of the second spectral light source is a wavelength other than 850 nm. Here, the weight of the first spectral light source is higher than the weight of the second spectral light source. The inventors conducted repeated experiments and found that the degree of linear correlation between the raw data and chromaticity values ​​obtained when irradiating coffee particles with a spectral light source of 850 nm wavelength is the highest. Therefore, setting the weight of the first spectral light source to the highest value can improve calculation accuracy.

[0098] Because infrared spectra are particularly sensitive to the measurement of pale objects, even a slight change in the color of a pale object can result in a significant change in the raw data obtained by imaging. As a result, the accuracy of chromaticity values ​​obtained from imaging data of coffee particles using only an infrared spectral light source is low. In the embodiments of this application, raw images are obtained from imaging of coffee particles using spectral light sources with different spectra, providing more dimensional information for calculating the chromaticity value of the coffee particles and improving the accuracy of the chromaticity value calculation.

[0099] Optionally, in step (S702), a representative chromaticity diagram may be obtained by other means based on the raw image of at least one frame. For example, the representative chromaticity diagram may be obtained by the Gaussian mixing model method. In this Gaussian mixing model method, the Gaussian mixing model can be pre-stored in the coffee particle analysis device, and the Gaussian mixing model may be obtained by reading the stored data. Gaussian mixingThe model includes the probability density functions of m known Gaussian models and the weights of m unknown Gaussian models. Each of the m Gaussian models is an n-dimensional Gaussian distribution of raw pixel values ​​collected by each of the m preset color cards under the illumination of the n spectral light sources, where m is an integer greater than or equal to 2. For example, m is an integer such as 10, 12, 13, 15, etc.

[0100] For example, a Gaussian mixture model is represented by the following equation (1).

[0101] JPEG2026511131000023.jpg18170

[0102] JPEG2026511131000024.jpg42170

[0103] JPEG2026511131000025.jpg51170

[0104] A representative chromaticity value at the first pixel position is obtained based on the weights of 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 (2).

[0105] JPEG2026511131000026.jpg20170

[0106] JPEG2026511131000027.jpg34170

[0107] In some cases, the raw images of the n frames are sent to the server, and the server then processes the raw images of the n frames and pre-configured settings Gaussian mixing Based on the model, a representative chromaticity diagram for one frame corresponding to the n frames of raw images is generated, and the representative chromaticity diagram for one frame transmitted from the server is received. Here, the n frames of raw images and a preset Gaussian mixingThe method for generating a representative chromaticity diagram for one frame corresponding to the n original images based on the model is described above and will not be repeated here. By offloading the calculation to a server, the computational power cost of the coffee particle analysis device can be reduced while maintaining the accuracy of the chromaticity value calculation.

[0108] In actual applications, the inventors have discovered that when the chromaticity value of the AG value is greater than a preset threshold, the relationship between the chromaticity value and the raw pixel value exhibits a clear nonlinear relationship. In the linear model method, this linear change can be corrected by weighting the chromaticity responses of different wavelengths, thereby improving the accuracy of chromaticity value calculation. Here, the preset threshold is an agtron between 95 and 105, for example, AG100. Specifically, when the chromaticity value of the AG value is greater than a preset threshold, the distribution coupling of raw pixel values ​​with different AG values ​​at different wavelengths is high. Gaussian mixing Model fitting allows for more appropriate distinction between each distribution. Therefore, when selectively obtaining a representative chromaticity diagram for one frame based on n frames of raw images, a corresponding chromaticity diagram for each of the n frames is generated based on the n frames of raw images. In the n-frame chromaticity diagram, if the area of ​​chromaticity values ​​greater than a preset threshold is greater than a preset area, or if the proportion of the area of ​​chromaticity values ​​greater than a preset threshold is greater than a preset proportion, then the Gaussian mixing A representative chromaticity diagram for one frame is obtained according to the modeling method. Optionally, if, in the n-frame chromaticity diagram, the area of ​​chromaticity values ​​greater than a preset threshold is less than or equal to a preset area, or if, in the n-frame chromaticity diagram, the proportion of the area of ​​chromaticity values ​​greater than a preset threshold is less than or equal to a preset proportion, a representative chromaticity diagram is obtained according to the linear modeling method.

[0109] Optionally, in some examples, the coffee particle chromaticity analysis method of the present application further includes entering an automatic calibration mode. In the automatic calibration mode, at least one frame of raw calibration image is acquired, the at least one frame of raw calibration image includes the raw pixel values ​​of the image collected by the preset calibration color card, if the preset calibration color card placed at a preset position is illuminated by at least one spectral light source. Based on the raw pixel values ​​in the at least one frame of raw calibration image, the chromaticity value of the preset calibration color card is calculated. Then, a chromaticity correction value is calculated based on the chromaticity value calculated by the preset calibration color card and the actual chromaticity value of the preset calibration color card.

[0110] Here, the preset calibration color card, positioned at a preset location, can refer to the user placing the preset calibration color card on a support surface, and then activating the spectral light source and image acquisition module to acquire an image of the preset calibration color card. Alternatively, the preset calibration color card may be fixed within the coffee particle analysis device and positioned outside the support surface while remaining within the field of view of the image acquisition module. For example, the preset calibration color card may be fixed to the inner wall of the coffee particle analysis device and positioned within the field of view of the image acquisition module without obstructing the support surface. When entering automatic calibration mode, a chromaticity correction value is obtained based on the image region of the acquired 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 positioned outside the field of view of the image acquisition module. The coffee particle analysis device can be fitted with a mechanical module. The mechanical module is used to move the preset calibration color card into the field of view of the image acquisition module after entering automatic calibration mode, thereby facilitating the image acquisition module to acquire a raw image of the preset calibration color card.

[0111] Selectively, a calibration pattern having the aforementioned preset area can be positioned on the preset calibration color card. As shown in Figure 10, Figure 10 is a schematic diagram of one embodiment of the preset calibration color card of this application. The preset calibration color card has known chromaticity values, and the preset calibration color card is fitted with a calibration pattern having a preset area (shown as a circle in Figure 10). Therefore, after collecting an image of the preset calibration color card, the circle can be used to determine the calibration size corresponding to one pixel.

[0112] In actual applications, the calculated chromaticity value may differ from the actual chromaticity value due to wear of the product's spectral light source or other factors. Therefore, a chromaticity correction value is obtained through an automatic calibration mode, and this chromaticity correction value is used to correct the calculated chromaticity value of the coffee particles when calculating the chromaticity value of the coffee particles, thereby improving calculation accuracy. Specifically, in step (S702), an initial representative chromaticity diagram for one frame is obtained based on the raw image of at least one frame. The method for obtaining the initial representative chromaticity diagram can be the same as the method for obtaining the representative chromaticity diagram described above. Next, the representative chromaticity diagram of the coffee particles is determined based on the chromaticity value of the initial representative chromaticity diagram of the coffee particles and the chromaticity correction value. For example, the chromaticity correction value is added to or subtracted from the initial representative chromaticity value at each pixel position of the initial representative chromaticity diagram to obtain the representative chromaticity value at each pixel position, i.e., the representative chromaticity diagram.

[0113] In actual application examples, coffee particles do not necessarily occupy the entire raw image, so there are pixels that do not correspond to coffee particles. If the chromaticity value of coffee particles is calculated based on pixels that do not correspond to coffee particles, the accuracy of the calculation of the chromaticity value of coffee particles decreases. As shown in Figure 9, Figure 9 is a schematic diagram of a collected image of coffee particles in one frame. In this collected image, a partial pixel region 91 corresponding to the support surface can be seen. Therefore, selectively, when acquiring at least one frame of raw image in step (S701), an initial raw image of at least one frame is acquired, and the raw image of at least one frame is determined based on this initial raw image of at least one frame. Specifically, after acquiring the initial raw image, invalid pixel values ​​can be determined from the initial raw image, and these invalid pixel values ​​are pixel values ​​corresponding to objects other than the coffee particles in the initial raw image. Then, the invalid pixel values ​​in the initial raw image of at least one frame are removed to obtain the raw image of at least one frame. In this way, the representative chromaticity diagram obtained in the subsequent step (S702) based on the raw image of at least one frame can more accurately reflect the chromaticity value of coffee particles.

[0114] There are various methods for determining valid or invalid pixel values ​​in an initial raw image. For example, in a selective image where the raw image visualizes coffee grains placed on a support surface, the coffee grains do not completely cover the support surface, resulting in the presence of invalid pixel values ​​in the raw image corresponding to the bottom of the support surface. The presence of these invalid pixel values ​​affects the measurement of the coffee grain's chromaticity. The support surface is positioned to have a color significantly different from the coffee grain (e.g., white), a texture significantly different from the surface texture of the coffee grain, or an easily identifiable pattern. Thus, invalid pixel values ​​can be determined by identifying the color, texture, or pattern of the raw image. Alternatively, without identifying the color, texture, or pattern of the raw image, the similarity of the coffee grains may cause valid pixel values ​​to have a certain commonality and to differ significantly from invalid pixel values, thereby allowing for the identification of valid or invalid pixel values ​​based on the differences and / or similarities in the raw data at each pixel location.

[0115] In some examples, when acquiring at least one frame of raw image in step (S701), specifically, when acquiring at least one initial frame of raw image, Kagayaki This includes obtaining a brightness correction function, determining a raw pixel correction value for the pixel position based on the brightness correction function and the pixel position in the initial raw image, correcting the raw pixel value for the pixel position in the initial raw image of at least 11 frames based on the raw pixel correction value for the pixel position, and obtaining the raw image of at least 1 frame.

[0116] In color analysis, the non-uniformity of the spectral light source can lead to different luminance levels in different regions. This can result in different raw pixel values ​​for regions with the same chromaticity in areas with different luminance levels, potentially causing analysis errors. Therefore, during the pre-production calibration of a coffee particle color analysis device, a single coffee granule sample with a uniform chromaticity distribution across the entire field of view is analyzed to determine the raw pixel value distribution at different pixel locations (corresponding to different luminance levels). Then, raw pixel correction values ​​(also called luminance correction functions) for different pixel locations are calculated and obtained. For example, the luminance correction function may be a relationship between the distance from the pixel location to the image center and the raw pixel correction value. In this way, the algorithm can improve the measurement accuracy of chromaticity analysis by correcting and adjusting the luminance of pixel points in various regions.

[0117] Optionally, in some examples, the support surface is specifically the bottom of a pre-configured sample tray. By setting the depth of the pre-configured sample tray so that it can support at least two layers of coffee particles, the bottom of the pre-configured sample tray is prevented from appearing in the raw image when imaging the coffee particles.

[0118] Optionally, in step (S701), if the raw image of at least one frame is determined based on the initial raw image of at least one frame, the method may further include obtaining the distance distribution between the coffee particles and the image acquisition module, and correcting the pixel values ​​in the initial raw image of at least one frame based on the distance distribution to obtain the raw image of at least one frame.

[0119] In actual applications, when an image acquisition module captures coffee particles, the distance between the module and the coffee particles varies, resulting in differences in the raw data of the obtained raw images. These differences can lead to inconsistencies in the measurement criteria for the chromaticity values ​​of different coffee particles within the raw image, potentially causing deviations in the measurement results. By correcting the pixel values ​​of at least one frame of the raw image based on the distance distribution and performing calculations based on the corrected at least one frame of the raw image, the accuracy of the coffee particle chromaticity values ​​can be further improved.

[0120] There are various methods for obtaining the distance distribution between the coffee particles and the image acquisition module. In some examples, a distance measuring module is controlled to irradiate the coffee particles with a ray of light and receive the reflected light from the coffee particles. Based on the irradiated ray and the reflected light, the distance distribution between the coffee particles and the image acquisition module is obtained. Here, the raw 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 is understood that the more regions there are, the finer the distance distribution will be.

[0121] Optionally, the distance measuring module is a laser distance measuring module positioned adjacent to the image acquisition module. The distance measuring module is used to irradiate a laser beam onto 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 irradiated and received laser beams. Here, the measurement method may be a pulse method, a coherence method, or a triangulation method. Here, a laser distance measuring module using laser triangulation is preferred because it has low requirements and low cost for the laser distance measuring module.

[0122] In some examples, the support surface is specifically the bottom surface of a pre-configured sample tray. An image acquisition module takes and acquires a photograph of the coffee particles placed in the pre-configured sample tray. The photograph is divided into at least one region, and in each region, a target pixel region corresponding to the bottom of the pre-configured sample tray is determined. The distribution of distances between the coffee particles and the image acquisition module is determined based on the proportion of the target pixel region in each region. Specifically, in a divided region, if the ratio of the area of ​​the target pixel region corresponding to the bottom of the pre-configured sample tray to the total area of ​​that region is greater than a certain value, it can be determined that the coffee particles in that region are arranged in only one layer in the pre-configured sample tray. 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 pre-configured sample tray and the image acquisition module. If the ratio of the target pixel area corresponding to the bottom of the pre-calibrated sample tray within the region is smaller than a certain value, it can be determined that the coffee particles completely cover the pre-set sample tray in that region, and the distance between the pre-calibrated sample tray and the image acquisition module is set as the distance between the coffee particles and the image acquisition module in that region.

[0123] Here, after determining the distance distribution between the coffee particles and the image acquisition module, the pixel values ​​of the raw image of at least one frame are corrected based on the distance distribution, thereby correcting the raw pixel values ​​of the raw image so that all coffee particles are at the same distance from the image acquisition module. For example, based on the correlation function between the pre-calibrated distance and the pixel values ​​of the raw image, and based on the acquired distance distribution, the raw pixel values ​​in at least one region of the raw image of at least one frame are corrected, and the raw pixel values ​​in that region of the raw image are corrected to the raw pixel values ​​corresponding to when the distance between the coffee particles and the image acquisition module is a predetermined distance.

[0124] Optionally, a vibration source is provided on the opposite side of the bottom surface of a pre-configured sample tray. This vibration source is driven to vibrate the bottom surface of the pre-configured sample tray, thereby uniformly distributing the coffee particles within the tray. Optionally, before acquiring a raw image each time, the vibration source is used to vibrate the bottom surface of the pre-configured sample tray and uniformly distribute the coffee particles. This means that when acquiring the distance between the coffee particles and the image acquisition module using the distance measurement module, it is not necessary to acquire the distance distribution of different areas within the pre-configured sample tray; only the distance between a coffee particle at a given location and the image acquisition module needs to be acquired. When correcting the raw pixel values ​​in the raw image, based on the distance between the coffee particle at that location and the image acquisition module, the raw pixel values ​​in the entire area of ​​the raw image are all corrected to the raw pixel values ​​corresponding to the distance between the coffee particle and the image acquisition module being the pre-configured distance.

[0125] Alternatively, in an example where the distance distribution between coffee particles and the image acquisition module is selectively acquired, if it is detected that the distance distribution satisfies a preset condition, a mechanical wave is emitted to the preset sample tray to vibrate it, thereby changing the distribution of coffee particles within the preset sample tray. The preset condition is that a mechanical wave is emitted to the preset sample tray only when the difference between each distance in the distance distribution between the coffee particles and the image acquisition module is greater than a preset difference, thereby uniformly distributing the coffee particles within the preset sample tray. Then, at least one frame of raw image of the uniformly distributed coffee particles is acquired.

[0126] Here, the vibration frequency, vibration amplitude, or vibration duration of the vibration source may be fixed or adjustable. Selectively, the display interface of the coffee particle analysis device may also include options for adjusting the vibration frequency, vibration amplitude, or vibration duration, thereby allowing the user to select an appropriate vibration frequency, vibration amplitude, or vibration duration based on the size of the coffee particles. Alternatively, the coffee particle analysis device may determine the particle size of the coffee particles based on the analysis results of the previous one or more frames of images acquired by the image acquisition module, and automatically adjust the vibration amplitude or vibration duration accordingly.

[0127] In practical applications, the higher the temperature of the coffee particles, the higher the energy of the infrared radiation emitted from the coffee particles themselves, which interferes with image detection and affects the measurement of chromaticity. Selectively, in some examples, in step (S702), an initial representative chromaticity diagram for one frame is obtained based on the raw image of at least one frame. Furthermore, a temperature sensor is installed in the coffee particle chromaticity analysis device. The temperature sensor detects the current ambient temperature and determines a chromaticity correction method corresponding to the current ambient temperature from among chromaticity correction methods for different temperatures. The representative chromaticity diagram of the coffee particles is determined based on the chromaticity value of the initial representative chromaticity diagram of the coffee particles and the chromaticity correction method. Specifically, the current ambient temperature may be the temperature of the sensor, the temperature of the light source, or the temperature of the coffee particles.

[0128] Here, the temperature sensor can be placed near a preset sample tray so that the measured temperature is close to the temperature of the coffee particles in the preset sample tray. Chromatic correction methods at different temperatures can be acquired during factory calibration and stored in the coffee particle analysis device. Specifically, during calibration, the difference between chromaticity values ​​calculated at multiple ambient temperatures and chromaticity values ​​calculated at a reference temperature can be determined as the chromatic correction 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 chromatic correction method. Specifically, the representative chromaticity value is obtained by adding or subtracting the chromatic correction value corresponding to the current ambient temperature to each initial representative chromaticity value in the initial representative chromaticity diagram.

[0129] Conventional techniques generally perform calculations based on a coffee particle chromaticity analysis device and the chromaticity value at the point when the coffee particles reach thermal equilibrium. If the temperature of the coffee particles is higher than the temperature of the device, a measurement error in the chromaticity value may occur due to the temperature difference between the two. In the embodiment of this application, a chromaticity correction value corresponding to the multi-point temperature of the coffee particles is obtained in advance, and temperature correction is performed by detecting the chromaticity correction value under conditions where thermal equilibrium has not been reached.

[0130] This application provides a coffee particle analyzer. As shown in Figure 11, Figure 11 is a schematic diagram showing one embodiment of the coffee particle analyzer of this application. The coffee particle analyzer 1100 comprises a control module 1101, an image acquisition module 1102, a first acquisition module 1103, and a first determination module 1104.

[0131] The control module 1101 is used to control the vibration source and drive the coffee particles to vibrate at least twice.

[0132] The image acquisition module 1102 is used to collect images of coffee particles after they have been vibrated at least twice, and to obtain a set of test images of coffee particles with different distributions.

[0133] The first acquisition module 1103 is used to acquire initial identification information of coffee particles in each test image within the test image set.

[0134] The first determination module 1104 is used to determine the final identification information of coffee particles based on the initial identification information of coffee particles in at least some of the frames of the image set in the test image.

[0135] Optionally, the control module 1101 is used to control the vibration source and drive the coffee particles to vibrate using a first drive mode in order to obtain coffee particles having a first distribution.

[0136] The image acquisition module 1102 is used to collect images of coffee particles having the first distribution and to obtain a first test image.

[0137] The control module 1101 is used to control the vibration source and drive the coffee particles to vibrate using a second drive mode in order to obtain coffee particles having a second distribution.

[0138] The image acquisition module 1102 is used to collect images of coffee particles having the second distribution and to obtain a second test image.

[0139] The first drive mode and the second drive mode are different, at the discretion of the user.

[0140] The control module 1101 is used to control the vibration source to drive the coffee particles having the first distribution to vibrate using a second drive mode, and then to further control the vibration source to drive the coffee particles to vibrate at least once using the second drive mode.

[0141] The image acquisition module 1102 is further used to acquire images of the coffee particles after each second drive mode has been driven, and to obtain at least one test image.

[0142] Optionally, the first drive mode and the second drive mode differ in at least one of the following: vibration frequency, vibration amplitude, vibration time, and vibration region.

[0143] Optionally, the vibration frequency in the first drive mode is the resonant frequency, 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.

[0144] Optionally, the vibration amplitude in the first drive mode is greater than the vibration amplitude in the second drive mode, and the vibration time in the second drive mode is longer than the vibration time in the first drive mode.

[0145] Optionally, the second drive mode is determined based on the first test image.

[0146] Optionally, Coffee particle analyzer The 1100 further comprises a second determination module. The second determination module is used to determine at least one of the vibration frequency, vibration amplitude, vibration time, or vibration region in the second drive mode based on initial identification information of coffee particles in the first test image.

[0147] The initial identification information of coffee particles in the first test image includes the quantity and / or area of ​​coffee particles in the first test image.

[0148] Optionally, the initial identification information of coffee particles in the test image includes the quantity of coffee particles.

[0149] The apparatus 1100 further comprises a third decision module and a fourth decision module. The third decision module is used to determine the change in the quantity of coffee particles based on the quantity of coffee particles in at least one frame of test images preceding the first test image, the first test image, and the second test image. The fourth decision module is used to determine the drive mode of the vibration source after the second test image based on the change in quantity.

[0150] Optionally, determining the drive mode of the vibration source after the second test image based on the change in quantity means stopping the next drive of the coffee particles by the vibration source or continuing the next drive of the coffee particles using the second drive mode if the change in quantity decreases or the change value is less than a threshold, or continuing the next drive of the coffee particles using the first drive mode if the change in quantity increases and the change value is greater than a threshold. of include.

[0151] Optionally, the quantity of coffee particles in the test image of at least one frame preceding the first test image, the first test image, and the second test image is the quantity of particles whose area in the test image of at least one frame preceding the first test image, the first test image, and the second test image is greater than a preset critical value.

[0152] 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 the minute coffee particles, wherein the minute 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 and larger than a preset threshold, where the value of the first preset particle size is smaller than the particle size values ​​in the plurality of particle size ranges.

[0153] Optionally, the initial identification information includes at least one of the quantity 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 very small coffee particles to the total coffee particles.

[0154] Optionally, the final identification information includes at least one of the final quantity distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges.

[0155] The aforementioned Coffee particle analyzer The 1100 further includes a display module. The display module is used to display at least one of the final quantity 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.

[0156] Optionally, the initial identification information for coffee particles includes the particle size of the coffee particles.

[0157] Coffee particle analyzer The 1100 includes a second acquisition module, a distortion correction module, and a first determination module.

[0158] The second acquisition module is used to acquire 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 test images in the test image set, and the distortion function is used to indicate particle size correction values ​​at multiple pixel positions.

[0159] The distortion correction module is used to perform distortion correction on the particle size of at least some of the coffee particles in the test image set based on the pixel position of the coffee particles and the corresponding particle size correction value, and to obtain the distortion-corrected particle size of the coffee particles.

[0160] The first determination module is used to determine the final identification information of the coffee particles based on the distortion-corrected particle size of the coffee particles in at least some of the frames of the test images in the set of test images.

[0161] Optionally, the initial identification information for the coffee particles may include the particle size of the coffee particles.

[0162] Before determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some of the frames of the test images in the set of test images, The coffee particle analyzer 1100 includes a third acquisition module, a fourth acquisition module, and a correction module. The third acquisition module is used to acquire a particle size correction function, which is used to indicate particle size correction values ​​at multiple brightness levels. The fourth acquisition module is used to acquire the brightness levels of the regions where coffee particles are located in at least some of the frames of the test images in the test image set. The correction module is used to correct the particle size of the coffee particles in the test images for at least some of the frames of the test images, based on the brightness levels of the regions where coffee particles are located in the test images and the particle size correction values, and to acquire the corrected particle size of the coffee particles.

[0163] Specifically, the first decision module is used to determine the final identification information of the coffee particles based on the corrected particle size of the coffee particles in at least some of the frames of the test images in the test image set.

[0164] Optionally, the initial identification information for coffee particles includes the particle size of the coffee particles.

[0165] The method includes a calibration mode, which is used to enter the calibration mode. In the calibration mode, the calibration mode is used to collect images of a calibration pattern having a preset area and placed at a preset position in the field of view to obtain a calibration image, to obtain the number of pixels corresponding to the calibration pattern, and to determine the calibration size corresponding to one pixel based on the preset area and the number of pixels.

[0166] The first acquisition module is used to acquire the number of pixels of coffee particles in each test image within the test image set, and to determine the particle size of the coffee particles based on the calibration size and the number of pixels.

[0167] The aforementioned Coffee particle analyzer 1100 It further includes a fifth acquisition module, a sixth acquisition module, and a fifth decision module.

[0168] The fifth acquisition module is used to acquire at least one frame of raw image. The at least one frame of raw image includes the raw pixel values ​​of the collected image of the coffee particles when the coffee particles are illuminated by at least one light source different from the illumination light source.

[0169] The sixth acquisition module is used to acquire a representative chromaticity diagram for one frame based on the raw image of at least one frame.

[0170] The fifth determination module is used to determine the overall chromaticity value of the coffee particles based on the representative chromaticity diagram of the first frame.

[0171] This application provides a coffee particle analysis device. As shown in Figure 12, Figure 12 is a schematic diagram showing one embodiment of the coffee particle analysis device of this application. The coffee particle analysis device 1200 comprises a memory 1201 and a processor 1202. Executable code is stored in the memory 1201. When the executable code is processed by the processor 1202, the coffee particle analysis device performs any of the aforementioned coffee particle analysis methods. Execute It is possible.

[0172] Selectively, the coffee particle analyzer 1200 further includes a vibration source, a light source module, a photosensitive array, and a support surface for supporting the coffee particles. Here, the vibration source includes an illumination light source and a backlight light source, respectively, positioned on both sides of the support surface. The photosensitive array is used to collect a test image of the coffee particles on the support surface as the illumination light source and the backlight light source emit light rays.

[0173] figure 13 As shown in Figure 13, Figure 13 is a schematic diagram showing the structure of a vibration source, a support surface, and a backlight source in one embodiment of the coffee particle analysis device of this application. duty Selectively, the vibration source 1301 includes a power amplifier, or the vibration source includes at least two linear vibration sources having different directions. A description of the vibration source is given in the description of the vibration source above and will not be repeated here. Figure 13 This shows the vibration source 1301 as a power amplifier.

[0174] The support surface 1302 is specifically a first light uniformizing film. A second light uniformizing film 1303 and a light guide plate 1304 are arranged between the power amplifier 1301 and the first light uniformizing film 1302. The first light uniformizing film 1302, the light guide plate 1304, and the second light uniformizing film 1303 are arranged in parallel in sequence, and the light guide plate 1304 is located in an airtight space surrounded by the first light uniformizing film 1302 and the second light uniformizing film 1302. The backlight light source 1305 is arranged around the light guide plate 1304.

[0175] Optionally, the second light homogenization film 1303 and the light guide plate 1304 are bonded to the first light homogenization film 1302 by adhesive, forming a sealed air cavity. The second light homogenization film 1303 is connected to a power amplifier 1301. When vibrations from the power amplifier 1301 are transmitted to the second light homogenization film 1303, the vibrations of the second light homogenization film 1303 are transmitted to the first light homogenization film 1302 through the air cavity, driving the vibrations of the coffee particles. Optionally, at least one through-hole 13041 is provided in the light guide plate 1304 to facilitate the transmission of vibrations through the air cavity.

[0176] In particle size analysis, when only the illumination light source is lit, the beam of the illumination light source is top-light relative to the support surface because the illumination light source and the photosensitive array are located on the same side of the support surface, resulting in a dark background in the captured test image. Figure 14 As shown, Figure 14 This is a schematic diagram of a test image acquired by a photosensitive array when only the illumination light source is lit, compared to the backlight light source. Because the background of the test image is dark, errors may occur when distinguishing between the background and coffee particles, reducing the accuracy of coffee particle size analysis. By installing the backlight light source on the support surface side opposite to the photosensitive array and illuminating both the backlight light source and the illumination light source simultaneously during particle size measurement, the problem of the dark background can be effectively solved. Figure 15 As shown, Figure 15This is a schematic diagram of test images collected by a photosensitive array when both the illumination light source and the backlight light source are lit. It can be seen that using a backlight light source improves the accuracy of distinguishing between the background and coffee particles, and thus improves the accuracy of analyzing the particle size of the coffee particles. Furthermore, to solve the problem of uniformity of the backlight at the bottom, a light guide plate is used in this example, and light is irradiated from the side of the light guide plate. This improves the brightness uniformity of the test image and improves the accuracy of analyzing the particle size of the coffee particles.

[0177] Optionally, the light source module further includes at least two spectral light sources. The at least two spectral light sources are used to emit light of different wavelengths from 500 nm to 1100 nm, respectively. When performing the coffee particle analysis method described above, the processor acquires at least one frame of raw image, specifically, by collecting the raw image of the coffee particles by a photosensitive array as each of the at least two spectral light sources irradiates the coffee particles.

[0178] Optionally, a preset calibration color card may be installed within the coffee particle analysis device, for example, the preset calibration color card shown in Figure 10. For example, the coffee particle analysis device further comprises a hollow cylindrical structural member having an opening on one side, and a base detachably fixed to the opening of the structural member. A light source module and a photosensitive array are located on the upper inner side of the structural member, and the base comprises a support surface and a vibration source. The preset calibration color card is fixed to the inner surface of the structural member, within the field of view of the photosensitive array and without obstructing the coffee particles on the support surface.

[0179] Alternatively, this application may be implemented as a computer-readable storage medium (or a non-temporary machine-readable storage medium or a machine-readable storage medium). Executable code (or a computer program or computer instruction code) is stored in the computer-readable storage medium. When the executable code (or computer program or computer instruction code) is executed by a processor in an electronic device (or such as a server), the processor performs some or all of the steps of the method described in this application.

[0180] Embodiments of this application have been described above. The above description is illustrative and not exhaustive, and is not limited to the embodiments disclosed. Many modifications and changes will be apparent to those skilled in the art without departing from the scope and spirit of the embodiments described. The terms used herein have been selected to best describe the principles of the embodiments, their practical applications, or improvements in the art in the market, or to enable those skilled in the art to understand the embodiments disclosed herein.

Claims

1. The steps include: controlling a vibration source to drive coffee particles to vibrate at least twice, collecting images of the coffee particles after they have been vibrated at least twice, and obtaining a test image set of coffee particles with different distributions; The steps include: obtaining initial identification information for coffee particles in each test image within the aforementioned test image set; A step of 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 test images in the set of test images, A method for analyzing coffee particles, including [specific component].

2. The step of controlling the vibration source to drive the coffee particles to vibrate at least twice, collecting images of the coffee particles after they have been vibrated at least twice, and obtaining a test image set of coffee particles with different distributions is: The method involves controlling the vibration source to drive the coffee particles to vibrate using a first drive mode, thereby obtaining coffee particles having a first distribution. To obtain a first test image by collecting images of coffee particles having the first distribution, The vibration source is controlled to drive the coffee particles having the first distribution to vibrate using a second drive mode, thereby obtaining coffee particles having a second distribution. To obtain a second test image by collecting images of coffee particles having the second distribution, A method for analyzing coffee particles according to claim 1, including the following:

3. The first drive mode and the second drive mode are different, After controlling the vibration source to drive the coffee particles having the first distribution to vibrate using a second drive mode, the coffee particle analysis method is as follows: The vibration source is controlled to drive the coffee particles to vibrate at least once using the second drive mode, Each time, an image of the coffee particles after being driven using the second drive mode is collected, and at least one test image is obtained. The method for analyzing coffee particles according to claim 2, further comprising:

4. The method for analyzing coffee particles according to claim 2, wherein the first drive mode and the second drive mode differ in at least one of the vibration frequency, vibration amplitude, vibration time, and vibration region.

5. The vibration frequency of the first drive mode is the resonant frequency, the vibration frequency of the second drive mode is less than the resonant frequency, or the vibration frequency of the second drive mode is greater than the resonant frequency, and / or The method for analyzing coffee particles according to claim 4, wherein the vibration amplitude of the first drive mode is greater than the vibration amplitude of the second drive mode.

6. The method for analyzing coffee particles according to claim 5, wherein the vibration amplitude in the first drive mode is greater than the vibration amplitude in the second drive mode, and the vibration time in the second drive mode is longer than the vibration time in the first drive mode.

7. The method for analyzing coffee particles according to any one of claims 2 to 6, wherein the second drive mode is determined based on the first test image.

8. The aforementioned method for analyzing coffee particles is: Based on the initial identification information of coffee particles in the first test image, determine at least one of the vibration frequency, vibration amplitude, vibration time, or vibration region in the second drive mode, The initial identification information of coffee particles in the first test image includes the number and / or area of ​​coffee particles in the first test image, The method for analyzing coffee particles according to claim 7, further comprising:

9. The initial identification information of coffee particles in the first test image includes the number of coffee particles, The aforementioned method for analyzing coffee particles is: The change in the number of coffee particles is determined based on the number of coffee particles in the test image of at least one frame preceding the first test image, the first test image, and the second test image. Based on the change in the aforementioned number, the drive mode of the vibration source is determined after the second test image, Furthermore, the method for analyzing coffee particles according to claim 7.

10. Based on the change in the aforementioned number, determining the drive mode of the vibration source after the second test image is: If the change in the number is a decrease in quantity, or if the change value is less than a threshold, the next drive of the coffee particles by the vibration source is stopped, or the next drive of the coffee particles is continued using the second drive mode, or A method for analyzing coffee particles according to claim 9, comprising at least one of the following: if the change in the number is an increase in quantity and the change value is greater than the threshold, continuing to drive the coffee particles again using the first drive mode.

11. The method for analyzing coffee particles according to claim 10, wherein the number of coffee particles in the test image of at least one frame preceding the first test image, the first test image, and the second test image is the number of particles in the test image of at least one frame preceding the first test image, the first test image, and the second test image whose area is greater than a preset threshold.

12. The initial identification information includes at least one of the particle size, quantity, area, volume, mass, and chromaticity of the coffee particles, and / or A method for analyzing coffee particles according to any one of claims 1 to 6, comprising at least one of the quantity, area, volume, mass, and chromaticity of the minute coffee particles, wherein the minute 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 larger than a preset threshold, wherein the value of the first preset particle size is smaller than the particle size values ​​in the plurality of particle size ranges.

13. The method for analyzing coffee particles according to claim 12, wherein the initial identification information includes at least one of the quantity 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 very small coffee particles among all coffee particles.

14. The final identification information includes at least one of the final quantity 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 for analyzing coffee particles according to claim 13, further comprising displaying at least one of the final quantity 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.

15. The initial identification information of the coffee particles includes the particle size of the coffee particles. Before the step of 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 test images in the set of test images, the coffee particle analysis method is as follows: This involves obtaining a distortion function, wherein the distortion function indicates particle size correction values ​​at multiple pixel positions, For coffee particles in at least some frames of the test images within the set of test images, distortion correction is performed based on the pixel position of the coffee particles and the corresponding particle size correction value, and the particle size after distortion correction is obtained. It further includes, A method for analyzing coffee particles according to any one of claims 1 to 6, wherein the step of 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 test images in the set of test images 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 test images in the set of test images.

16. The initial identification information of the coffee particles includes the particle size of the coffee particles. Before the step of 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 test images in the set of test images, the coffee particle analysis method is as follows: The process involves obtaining a particle size correction function, which is used to indicate particle size correction values ​​at multiple brightness levels. To obtain the brightness of the region where coffee particles are located in at least some of the frames of the test images in the aforementioned set of test images, For at least a portion of the frames of the test image, the particle size of the coffee particles in the test image is corrected based on the brightness of the region where the coffee particles are located in the test image and the particle size correction value, and the corrected particle size of the coffee particles is obtained. It further includes, A method for analyzing coffee particles according to any one of claims 1 to 6, wherein the step of 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 test images in the set of test images includes determining the final identification information of the coffee particles based on the corrected particle size of the coffee particles in at least some frames of the test images in the set of test images.

17. The initial identification information of the coffee particles includes the particle size of the coffee particles. The aforementioned method for analyzing coffee particles includes entering a calibration mode. Here, in the calibration mode, A calibration image is obtained by collecting images of a calibration pattern having a predetermined area and placed at a predetermined position within the field of view. The number of pixels corresponding to the calibration pattern is obtained, Based on the aforementioned preset area and the number of pixels, the calibration size corresponding to one pixel is determined. The step of obtaining initial identification information for coffee particles in each test image within the aforementioned test image set is: Obtain the number of pixels of coffee particles in the test images within the aforementioned set of test images, The particle size of the coffee particles is determined based on the calibration size and the number of pixels. A method for analyzing coffee particles according to any one of claims 1 to 6, including the following:

18. The aforementioned test image is an image collected when the coffee particles are irradiated by the light source. The aforementioned method for analyzing coffee particles is: A step of acquiring at least one frame of raw image, wherein the at least one frame of raw image includes the raw pixel values ​​of the collected image of the coffee particles when the coffee particles are irradiated by at least one light source different from the irradiating light source. The steps include obtaining a representative chromaticity diagram for one frame based on the raw image of at least one frame, The steps include determining the overall chromaticity value of the coffee particles based on the representative chromaticity diagram of the aforementioned frame, A method for analyzing coffee particles according to any one of claims 1 to 6, further comprising:

19. A coffee particle analyzer comprising a control module, an image acquisition module, a first acquisition module, and a first determination module, The control module is used to control the vibration source and drive the coffee particles to vibrate at least twice. The image acquisition module is used to acquire a set of test images of the coffee particles after they have been vibrated at least twice, and to obtain a set of test images of coffee particles having different distributions. The first acquisition module is used to acquire initial identification information of coffee particles in each test image within the test image set. A first determination module is a coffee particle analyzer used to determine the final identification information of coffee particles based on initial identification information of coffee particles in at least some frames of test images within the test image set.

20. A coffee particle analysis device comprising a memory and a processor, wherein executable code is stored in the memory, and when the executable code is processed by the processor, the processor can perform the coffee particle analysis method according to any one of claims 1 to 18.

21. The coffee particle analysis device further includes a vibration source, a light source module, a photosensitive array, and a support surface for supporting the coffee particles. The vibration source is located on one side of the support surface. The light source module includes an irradiation light source located on the side of the support surface supporting the coffee particles, The coffee particle analysis device according to claim 20, wherein the photosensitive array is used to collect a test image of coffee particles on the support surface when the illumination light source emits light rays.

22. The support surface is specifically a first light-uniformity film. A second light-uniform film and a light guide plate are further arranged 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 order, the light guide plate is placed in an airtight space surrounded by the first light-uniform film and the second light-uniform film, and the light guide plate is further provided with at least one through hole. The light source module further includes a backlight light source arranged at the periphery of the light guide plate, The coffee particle analysis device according to claim 21, wherein the photosensitive array is used to collect a test image of coffee particles on the support surface when the illumination light source and the backlight light source emit light rays.

23. The coffee particle analysis device according to claim 21, wherein the vibration source includes a power amplifier, or the vibration source includes at least two linear vibration sources having different directions.

24. The light source module further includes at least two spectral light sources used to emit light of different wavelengths ranging from 500 nm to 1100 nm, The coffee particle analysis device according to claim 21, wherein the processor is used to acquire at least one frame of raw image, the raw image of at least one frame including raw pixel values ​​of images collected from the coffee particles when at least two spectral light sources each irradiate the coffee particles, to acquire a representative chromaticity diagram of one frame based on the raw image of at least one frame, and to determine the overall chromaticity value of the coffee particles based on the representative chromaticity diagram of one frame.

25. A computer-readable storage medium stores executable code, and when the executable code is executed by a coffee particle identification device, the coffee particle identification device performs the coffee particle analysis method according to any one of claims 1 to 18.