WO2024192831A1 - 咖啡颗粒的分析方法、装置、设备和计算可读存储介质 - Google Patents

咖啡颗粒的分析方法、装置、设备和计算可读存储介质 Download PDF

Info

Publication number
WO2024192831A1
WO2024192831A1 PCT/CN2023/088295 CN2023088295W WO2024192831A1 WO 2024192831 A1 WO2024192831 A1 WO 2024192831A1 CN 2023088295 W CN2023088295 W CN 2023088295W WO 2024192831 A1 WO2024192831 A1 WO 2024192831A1
Authority
WO
WIPO (PCT)
Prior art keywords
coffee particles
image
tested
coffee
particle size
Prior art date
Application number
PCT/CN2023/088295
Other languages
English (en)
French (fr)
Inventor
王程杰
吴泳智
彭倜
Original Assignee
深圳市流数科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市流数科技有限公司 filed Critical 深圳市流数科技有限公司
Publication of WO2024192831A1 publication Critical patent/WO2024192831A1/zh

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N15/00Investigating characteristics of particles; Investigating permeability, pore-volume or surface-area of porous materials
    • G01N15/02Investigating particle size or size distribution

Definitions

  • the present application relates to the field of coffee measurement, and in particular to an analysis method, device, equipment and computer-readable storage medium for coffee particles.
  • the grinding degree of coffee powder determines the contact area between the coffee powder and the brewing water, which in turn affects the extraction rate of the coffee powder.
  • the finer the coffee powder the higher the extraction rate. Therefore, by adjusting the grinding degree of the coffee powder, the extraction rate of the coffee can be adjusted.
  • Particle size analysis can obtain the particle size distribution of coffee powder, help study the coarseness and uniformity of coffee powder, determine whether the coffee powder is too coarse or too fine, and then adjust the extraction rate of coffee by adjusting the coarseness of the coffee powder.
  • a method for analyzing the particle size distribution of coffee powder is to obtain the particle size of coffee powder by collecting images of coffee powder and analyzing the images.
  • the present application provides a coffee particle analysis method, device, equipment and computer-readable storage medium, which can improve the analysis accuracy of coffee particles.
  • a first aspect of the present application provides a method for analyzing coffee particles, the method comprising:
  • the final identification information of the coffee particles is determined according to the initial identification information of the coffee particles in at least some frames of the images to be tested in the image set to be tested.
  • the vibration source is controlled to drive the coffee particles to vibrate at least twice, and images are respectively captured of the coffee particles after the at least two vibrations to obtain a set of images to be tested of coffee particles with different distributions, including: controlling the vibration source to drive the coffee particles to vibrate in a first driving manner to obtain coffee particles with a first distribution; capturing images of the coffee particles with the first distribution to obtain a first image to be tested; controlling the vibration source to drive the coffee particles with the first distribution to vibrate in a second driving manner to obtain coffee particles with a second distribution; capturing images of the coffee particles with the second distribution to obtain a second image to be tested.
  • the first driving mode and the second driving mode are different; controlling the vibration source to drive the coffee particles with the first distribution to vibrate in the second driving mode, and then further comprising: controlling the vibration source to drive the coffee particles to vibrate in the second driving mode at least once; capturing images of the coffee particles after each driving in the second driving mode, to obtain at least one frame of image to be measured.
  • At least one of the following items is different between the first driving mode and the second driving mode: vibration frequency, vibration amplitude, vibration time, and vibration area.
  • the vibration frequency in the first driving mode is a resonance frequency
  • the vibration frequency in the second driving mode is less than or greater than the resonance frequency
  • the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode
  • the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode, and the vibration time in the second driving mode is longer than the vibration time in the first driving mode.
  • the second driving mode is determined according to the first image to be tested.
  • the method also includes: determining at least one of the vibration frequency, vibration amplitude, vibration time or vibration area in the second driving mode based on the initial identification information of the coffee particles in the first image to be tested; the initial identification information of the coffee particles in the first image to be tested includes the number and/or area of the coffee particles in the first image to be tested.
  • the initial identification information of the coffee particles in the image to be tested includes the number of coffee particles; the method further includes: determining a change in the number of coffee particles based on the number of coffee particles in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested; and determining a driving mode of the vibration source after the second image to be tested based on the change in number.
  • determining the driving mode of the vibration source after the second image to be tested based on the quantity change includes at least one of the following: when the quantity change is a decrease in quantity or the change value is less than a threshold value, stopping the next drive of the vibration source on the coffee particles or continuing the next drive of the coffee particles with the second driving mode; or, when the quantity change is an increase in quantity and the change value is greater than the threshold value, continuing the next drive of the coffee particles with the first driving mode.
  • the number of coffee particles in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested is the number of particles whose area is greater than a preset critical value in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested.
  • the initial identification information includes at least one of the particle size, quantity, area, volume, mass, and chromaticity of the coffee particles; and/or at least one of the quantity, area, volume, mass, and chromaticity of extremely small coffee particles, wherein the extremely small coffee particles are coffee particles having a particle size smaller than a first preset particle size, or a particle size smaller than the first preset particle size and greater than a preset critical value, wherein the value of the first preset particle size is smaller than the value of the particle size in the multiple particle size intervals.
  • the initial identification information also includes: at least one of the number distribution, area distribution, volume distribution, mass distribution, and chromaticity distribution of the coffee particles in different particle size ranges; and/or information on the proportion of the extremely small coffee particles in all coffee particles.
  • the final identification information includes at least one of the final number distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges; the method also includes: displaying at least one of the final number distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges on an interactive interface.
  • the initial identification information of the coffee particles includes the particle size of the coffee particles; before determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the images to be tested in the image set to be tested, it also includes: obtaining a distortion function, wherein the distortion function is used to indicate particle size compensation values at multiple pixel positions; performing distortion correction on the particle size of at least some of the coffee particles in the images to be tested in the image set to be tested, according to the pixel positions of the coffee particles and the corresponding particle size compensation values, to obtain the distortion-corrected particle size of the coffee particles; determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the images to be tested in the image set to be tested includes: determining the final identification information of the coffee particles based on the distortion-corrected particle size of the coffee particles in at least some frames of the images to be tested in the image set to be tested.
  • the initial identification information of the coffee particles includes the particle size of the coffee particles; before determining the final identification information of the coffee particles based on the initial identification information of the coffee particles in at least some frames of the image to be tested in the image set to be tested, the method further includes: obtaining a particle size compensation function, the particle size compensation function being used to indicate a particle size compensation value under multiple brightness levels; respectively obtaining the brightness of the area where the coffee particles are located in at least some frames of the image to be tested in the image set to be tested; for the at least some frames of the image to be tested, compensating for the particle size of the coffee particles in the image to be tested according to the brightness of the area where the coffee particles are located in the image to be tested and the particle size compensation value, to obtain the compensated particle size of the coffee particles;
  • the final identification information of the coffee particles is determined based on the initial identification information of the coffee particles in the image, including: determining the final identification information of the coffee particles based on the compensated particle sizes of the coffee particles in at least some frames of the image to be tested
  • the initial identification information of the coffee particles includes the particle size of the coffee particles; the method further comprises: entering a calibration mode, wherein in the calibration mode: capturing an image of a calibration pattern with a preset area and located at a preset position within the field of view to obtain a calibration image; obtaining the number of pixels corresponding to the calibration pattern; and determining a calibration size corresponding to one pixel according to the preset area and the number of pixels;
  • the step of respectively obtaining the initial identification information of the coffee particles in the images to be tested in the image set to be tested comprises: respectively obtaining the number of pixels of the coffee particles in the images to be tested in the image set to be tested; and determining the particle size of the coffee particles according to the calibrated size and the number of pixels.
  • the image to be tested is an image captured when the coffee particles are illuminated by an illumination light source; the method further includes: acquiring at least one frame of raw image, the at least one frame of raw image comprising raw pixel values of the image captured when the coffee particles are illuminated by at least one light source different from the illumination light source; acquiring a frame of representative chromaticity diagram based on the at least one frame of raw image; and determining the overall chromaticity value of the coffee particles based on the one frame of representative chromaticity diagram.
  • a second aspect of the present application provides a coffee particle analysis device, comprising:
  • a control module used for controlling the vibration source to drive the coffee particles to vibrate at least twice
  • An image acquisition module used to respectively acquire images of the coffee particles after the at least two vibrations, to obtain a set of images to be tested having coffee particles with different distributions;
  • a first acquisition module used for respectively acquiring initial recognition information of coffee particles in the images to be tested in the image set to be tested;
  • the first determination module is used to determine the final identification information of the coffee particles according to the initial identification information of the coffee particles in at least part of the frames of the image set to be tested.
  • a third aspect of the present application provides a coffee particle analysis device, comprising a memory and a processor, wherein the memory stores executable code, and when the executable code is processed by the processor, the processor can execute any one of the coffee particle analysis methods described.
  • the coffee particle analysis equipment also includes: a vibration source, a light source module, a photosensitive area array, and a carrying surface for carrying the coffee particles;
  • the vibration source is located on one side of the carrying surface;
  • the light source module includes an irradiation light source located on the side of the carrying surface for carrying the coffee particles;
  • the photosensitive area array is used to capture the image to be measured of the coffee particles on the carrying surface when the irradiation light source emits a light beam.
  • the bearing surface is specifically a first light-evening film; a second light-evening film and a light guide plate are also arranged between the vibration source and the first light-evening film, the first light-evening film, the light guide plate and the second light-evening film are arranged side by side in sequence, and the light guide plate is located in an airtight space surrounded by the first light-evening film and the second light-evening film; at least one through hole is also provided on the light guide plate; the light source module also includes a backlight light source, which is located at the periphery of the light guide plate; the photosensitive surface array is used to collect the image to be measured of the coffee particles on the bearing surface when the illumination light source and the backlight light source emit light beams.
  • the vibration source includes a power amplifier, or the vibration source includes at least two linear vibration sources with different directions.
  • the light source module also includes at least two spectral light sources for emitting different wavelengths between 500nm and 1100nm respectively; the processor is also used to: acquire at least one frame of raw image, the at least one frame of raw image containing raw pixel values of the image collected from the coffee particles when the at least two spectral light sources respectively irradiate the coffee particles; acquire a frame of representative chromaticity diagram based on the at least one frame of raw image; determine the overall chromaticity value of the coffee particles based on the one frame of representative chromaticity diagram.
  • a fourth aspect of the present application provides a computer-readable storage medium having executable code stored thereon.
  • the executable code is executed by a coffee particle identification device, the coffee particle identification device is caused to execute any one of the methods described above.
  • the coffee particles are driven to vibrate at least twice by a vibration source to disperse the stuck coffee particles, and the distribution of the coffee particles can be changed.
  • the final identification information is obtained by using the identification information of multiple frames of coffee particles with different distributions, which can improve the recognition accuracy of the coffee particles.
  • FIG1 is a schematic diagram of an embodiment of the coffee particle analysis method of the present application
  • FIG2 is a schematic diagram of an embodiment of the particle size distribution histogram of the coffee particles of the present application
  • FIG3 is a schematic diagram of another embodiment of the particle size distribution histogram of the coffee particles of the present application
  • FIG4 is a schematic diagram of a quantity distribution histogram in the final identification information of the coffee particles displayed on the interactive interface
  • FIG5 and FIG6 are respectively images of coffee particles to be tested in different brightness areas
  • FIG7 is a schematic diagram of an embodiment of the coffee particle analysis method of the present application
  • FIG8 is a schematic diagram of an interactive interface of the present application
  • FIG9 is a schematic diagram of a frame of captured image of coffee particles
  • FIG10 is a schematic diagram of the present application
  • FIG10 is a schematic diagram of an embodiment of the preset calibration color card of the application
  • FIG11 is an example diagram of an embodiment of the coffee particle analysis device of the present application
  • FIG12 is an example diagram of an embodiment of the
  • the term “and/or” used herein refers to and includes any or all possible combinations of one or more associated listed items. It should be understood that although the terms “first”, “second”, “third”, etc. may be used in this application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, a feature defined as “first” or “second” may explicitly or implicitly include one or more of the features. In the description of this application, “plurality” means two or more, unless otherwise clearly and specifically defined.
  • FIG1 is a schematic diagram of an embodiment of a method for analyzing coffee particles of the present application.
  • the method for analyzing coffee particles comprises:
  • Step S101 controlling a vibration source to drive coffee particles to vibrate at least twice, and collecting images of the coffee particles after the at least two vibrations, respectively, to obtain a set of images to be tested having coffee particles with different distributions.
  • coffee particles may refer to coffee beans or coffee powder or coffee particles of other shapes and particle sizes.
  • the coffee particle analysis method of the present application is applied to a coffee particle analysis device.
  • the coffee particle analysis device is provided with a photosensitive array for collecting images containing coffee particles to obtain an image to be tested.
  • the photosensitive array may include a charge-coupled device (CCD). Or complementary metal oxide semiconductor (CMOS).
  • CMOS complementary metal oxide semiconductor
  • a carrying surface for loading coffee particles is also provided in the analysis device for coffee particles.
  • a preset sample tray is also provided in the analysis device for coffee particles, and the carrying surface is the bottom surface of the preset sample tray.
  • the photosensitive area array is specifically used to collect coffee particles located in the preset sample tray to obtain multiple frames of images to be tested, and the image set to be tested includes the multiple frames of images to be tested.
  • an irradiation light source is also provided in the analysis device for coffee particles, which is used to irradiate the coffee particles when the photosensitive area array images the coffee particles.
  • a vibration source is further provided on the side of the bearing surface facing away from the coffee particles, and the vibration source can drive the bearing surface to vibrate, so as to drive the coffee particles on the bearing surface to vibrate, thereby changing the distribution of the coffee particles.
  • the vibration source is controlled to drive the coffee particles to vibrate.
  • the bearing surface is a vibration membrane, and the coffee particles are carried on the vibration membrane, and the vibration source drives the coffee particles to vibrate by driving the vibration membrane to vibrate.
  • the vibration source is a power amplifier for emitting sound waves to drive the vibration membrane to vibrate.
  • the vibration source can be a vibration source for emitting other mechanical waves, such as water waves, rope waves, etc.
  • the vibration source drives the coffee particles to vibrate by other means (such as mechanical impact) rather than emitting mechanical waves.
  • the vibration source is an electromagnetic coil, electrode, air hammer, spring, etc. connected to the bearing surface, which drives the coffee particles on the bearing surface to vibrate by impacting the bearing surface.
  • the vibration source includes at least two linear vibration sources with different directions.
  • the vibration motion direction and separation degree of the coffee particles can be controlled by controlling the frequency of the transverse wave and the longitudinal wave of each linear vibration source.
  • multiple vibration sources can be set on the back of the bearing surface, and in a Cartesian coordinate system centered on the surface center of the bearing surface, the multiple vibration sources can include three vibration sources whose vibration directions are parallel to the X, Y, and Z coordinate axes in the Cartesian coordinate system.
  • voice coil motors with a vibration direction perpendicular to the bearing surface may be arranged at the four corners of the bearing surface, and control may be achieved by controlling the amplitude and frequency of the voice coil electrode and utilizing the interference principle of resonance and coherent waves.
  • the vibration source is controlled to drive the coffee particles to vibrate in a first driving mode to obtain coffee particles with a first distribution; images of the coffee particles with the first distribution are captured to obtain a first image to be tested; the vibration source is controlled to drive the coffee particles with the first distribution to vibrate in a second driving mode to obtain coffee particles with a second distribution; images of the coffee particles with the second distribution are captured to obtain a second image to be tested.
  • the first driving mode and the second driving mode may be the same.
  • the vibration source may be controlled to drive the coffee particles to vibrate multiple times in a fixed manner, and the coffee particles after each vibration stop are captured, so as to obtain multiple frames of images to be tested with different distributions of coffee particles.
  • the first driving mode and the second driving mode may be different.
  • at least one of the following items is different between the first driving mode and the second driving mode: vibration frequency, vibration amplitude, vibration time, and vibration area.
  • the vibration frequency in the first driving mode is a resonant frequency
  • the vibration frequency in the second driving mode is less than or greater than the resonant frequency
  • the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode. Since the vibration frequency of the vibration source is a resonant frequency, which is a vibration amplitude that can reach a maximum or close to a maximum, the coffee particles are first vibrated to separate using a resonant frequency or a larger vibration amplitude.
  • the coffee particles are driven to vibrate using a resonant frequency, which can better separate the coffee particles, so that the first image to be measured can better measure the particle size of the coffee particles. Then, before the second image to be measured is captured, a smaller vibration amplitude is used to fine-tune the distribution of the coffee particles.
  • the accuracy of the particle size analysis of the coffee particles can be improved by using such a first image to be measured and a second image to be measured.
  • the vibration amplitude in the first driving mode is larger than the vibration amplitude in the second driving mode, and the vibration time in the second driving mode is longer than the vibration time in the first driving mode.
  • the coffee particles can be completely shaken apart with a shorter vibration time and a larger vibration amplitude before the first image to be measured is acquired, and then the coffee particles can be further shaken apart and the coffee particles can be further shaken apart with a longer vibration time and a smaller vibration amplitude.
  • the distribution of particles can be fine-tuned to facilitate the acquisition of more particle size information of coffee particles.
  • the vibration time in the first driving mode can be a duration between 0.1s and 0.5s
  • the vibration time in the second driving mode can be a duration between 0.1s and 1s that is longer than the vibration time in the first driving mode.
  • the vibration time in the second driving mode can also be the same as the vibration time in the first driving mode, or the vibration time in the second driving mode can be shorter than the vibration time in the first driving mode.
  • the vibration source after controlling the vibration source to drive the coffee particles with the first distribution to vibrate in the second driving mode, the vibration source is further controlled to drive the coffee particles to vibrate in the second driving mode at least once; and images are captured from the coffee particles after each driving in the second driving mode, to obtain at least one frame of image to be measured.
  • the vibration source may continue to capture images of the coffee particles at preset intervals without stopping the vibration source driving the coffee particles, to obtain multiple frames of image to be measured.
  • Step S102 respectively obtaining initial recognition information of coffee particles in the images to be tested in the image set to be tested.
  • the initial identification information includes at least one of the particle size, quantity, area, volume, and mass of the coffee particles.
  • the initial identification information also includes the distribution of at least one of the particle size, quantity, area, volume, and mass of the coffee particles.
  • the particle size of coffee particles There are many methods for obtaining the particle size of coffee particles. For example, the area occupied by the coffee powder particles in the image to be tested is detected, the area is equivalent to the diameter of a circle with the same area, and the diameter is used as the initial particle size of the coffee powder particles.
  • most of the analysis of coffee powder particle size uses the powder screening method or the laser scattering method.
  • the powder screening method is low-cost but has low work efficiency, while the laser scattering method has high work efficiency but is expensive.
  • the image analysis method has the advantages of fast recognition speed, high analysis efficiency, and low cost.
  • the size of coffee particles in the image to be tested can be identified by a machine learning method, and the coffee particles can be labeled with adhesion and non-adhesion, and/or the silver skin in the coffee particles can be labeled to improve the recognition efficiency and accuracy of the size of the coffee particles.
  • the volume of the coffee particles can be calculated based on the particle size and/or area of the coffee particles.
  • the mass of the coffee particles can be calculated based on the volume of the coffee particles and the preset density of the coffee particles.
  • the initial identification information also includes distribution information of coffee particles in different particle size intervals.
  • the distribution information of coffee particles in different particle size intervals may include the number distribution, area distribution, volume distribution, mass distribution and/or chromaticity distribution of coffee particles in different particle size intervals.
  • 9 particle size intervals of 200um-300um, 300um-425um, 425um-600um, 600um-850um, 850um-1180um, 1180um-1400um, 1400um-1700um, 1700um-2360um, and 2360um-2500um are pre-set.
  • the number of preset particle size intervals and the length of each interval can be set in other ways, which are not limited here.
  • the number distribution of coffee particles in multiple preset particle size intervals can be the sum of the numbers in each preset particle size interval, or the ratio of the sum of the numbers in each preset particle size interval to the sum of the numbers in all preset particle size intervals.
  • the area/volume/mass distribution of coffee particles in multiple preset particle size intervals can be the sum of the area/volume/mass in each preset particle size interval, or the ratio of the sum of the area/volume/mass in each preset particle size interval to the sum of the area/volume/mass in all preset particle size intervals.
  • the chromaticity distribution of coffee particles in multiple preset particle size intervals can be the average value or median of the chromaticity values in each preset particle size interval.
  • Figure 2 is a schematic diagram of an embodiment of a particle size distribution histogram of coffee particles of the present application.
  • Each square in the histogram corresponds to a preset particle size interval
  • the abscissa in the histogram represents the particle size corresponding to the preset particle size interval
  • the ordinate represents the ratio of the number of coffee particles in the preset particle size interval to the total number of all preset particle size intervals.
  • FIG. 3 is a diagram showing another embodiment of a particle size distribution histogram of coffee particles of the present application.
  • Each square in the histogram corresponds to a preset particle size interval
  • the abscissa in the histogram represents the particle size corresponding to the preset particle size interval
  • the ordinate represents the ratio of the sum of the areas of the coffee particles in the preset particle size interval to the total area of the coffee particles in all preset particle size intervals.
  • the initial identification information also includes at least one of the number, area, volume, and mass of extremely small coffee particles.
  • the extremely small coffee particles are coffee particles with a particle size smaller than a first preset particle size, or coffee particles with a particle size smaller than the first preset particle size and larger than a preset critical value.
  • the value of the first preset particle size is smaller than the value of the particle size in the multiple preset particle size intervals.
  • the extremely small coffee particles are coffee particles with a particle size smaller than 200um. In the coffee grinding process, the difference in particle size depends on the requirements of different brewing methods, but generally it is hoped to obtain coffee particles with higher uniformity, and the extremely small coffee particles are particles generated during the grinding process that are outside the expected particle size range.
  • Obtaining information about the extremely small coffee particles can provide users with a reference for the grinding effect; for example, if the number or area of extremely small coffee particles exceeds a certain value, or the number ratio or area ratio exceeds a certain value, it means that the grinding effect is not good.
  • the initial identification information also includes information about the proportion of the tiny coffee particles in all coffee particles.
  • the proportion information may be the proportion of the total number, total area, total volume or total mass of the tiny coffee particles in the total number, total area, total volume or total mass of all coffee particles.
  • the coffee particles are coffee powder or coffee beans. Specifically, it can be determined whether the coffee particles are coffee powder or coffee beans through user input, or by analyzing the image to be tested, for example, by obtaining the gradient of the image to be tested and determining whether the coffee particles are coffee powder or coffee beans according to the classification result of the gradient.
  • Step S103 determining final identification information of the coffee particles according to initial identification information of coffee particles in at least some frames of the image set to be tested.
  • the final particle size information of the coffee particles can be obtained by taking a weighted average of the initial identification information of the coffee particles in all frames of the image to be tested in the image set to be tested. This can reduce measurement errors and improve measurement accuracy.
  • the image to be tested is determined to be invalid when there is severe adhesion of coffee particles in the image to be tested.
  • the size of the area of the coffee powder particles in the image to be tested is detected.
  • the frame of the image to be tested is determined to be invalid.
  • the first threshold and the second threshold may be the same or different.
  • the distribution information of each frame to be tested in the at least some of the frames to be tested in multiple different particle size intervals is obtained, and the distribution information is weighted average summation is performed. Specifically, for each particle size interval, at least one of the number, area, volume, and mass of multiple frames to be tested is obtained, and similar items are weighted average summation is performed. Alternatively, for extremely small coffee particles, at least one of the number, area, volume, and mass of extremely small coffee particles in multiple frames to be tested is obtained, and similar items are weighted average summation is performed.
  • the weighted values of each frame of the image to be tested are the same, and the similar items of the multiple frames of the image to be tested are averaged and summed.
  • the ratio of the total number in each particle size interval to the total number in all particle size intervals, or the ratio of the total area in each particle size interval to the total area in all particle size intervals, or the ratio of the total volume in each particle size interval to the total volume in all particle size intervals, or the ratio of the total mass in each particle size interval to the total mass in all particle size intervals can also be obtained.
  • the final identification information of the coffee particles is also displayed through the interactive interface.
  • FIG4 is a schematic diagram of a quantity distribution histogram in the final identification information of the coffee particles displayed on the interactive interface.
  • the final identification information includes the total number of coffee particles in the 9 preset particle size intervals as a percentage of all particle size intervals.
  • the x-axis in Figure 4 represents the median of the 9 particle size intervals, and the y-axis represents the ratio of the number in each particle size interval to the total number in all particle size intervals.
  • the particle size interval in which the median particle size of the coffee particles is located is also displayed through the interactive interface.
  • the median particle size refers to the particle size corresponding to when the cumulative particle size distribution percentage of the coffee particles reaches 50%. Its physical meaning is that particles with a particle size greater than the median particle size account for 50%, and particles with a particle size less than the median particle size also account for 50%. As shown in Figure 4, for example, the median particle size falls within the particle size interval of 600um-850um, and the number ratio within the particle size interval is displayed as a different color or pattern from the number ratio display of other devices to indicate that the median particle size falls within the particle size interval.
  • the coffee particles are driven to vibrate at least twice by a vibration source to disperse the stuck coffee particles, and the distribution of the coffee particles can be changed.
  • the final identification information is obtained by obtaining the identification information of multiple frames of coffee particles with different distributions, which can improve the identification accuracy of the coffee particles.
  • the driving mode of at least one driving is determined based on the most recent one or more images captured for the driving.
  • the second driving mode is determined based on the first image to be tested.
  • the degree of adhesion of coffee particles in the first image to be tested is obtained, and at least one of the vibration frequency, vibration amplitude, vibration time, or vibration area in the second driving mode is determined based on the adhesion degree.
  • the adhesion degree is determined according to the number and/or area of the coffee particles in the first image to be tested. For example, for a part of the area or the whole area in the first image to be tested, the number and total area of the coffee particles in the area are detected, and when the ratio of the total area to the number in the area exceeds different ranges, different adhesion degrees correspond to the adhesion degree; or, the area of each coffee particle in the area is detected, and when the area is greater than the preset area or the number of coffee particles greater than the preset area is in different ranges, different adhesion degrees correspond to the adhesion degree.
  • different adhesion degrees correspond to different vibration frequencies, or different vibration amplitudes, or different vibration times.
  • the corresponding vibration frequency, vibration amplitude or vibration time is used as the vibration frequency, vibration amplitude or vibration time in the second driving mode according to the adhesion degree.
  • the vibration frequency, vibration amplitude or vibration time corresponding to the region can also be determined according to the adhesion degree of the coffee particles on each region.
  • the second driving mode has at least one of a higher vibration frequency, a higher vibration amplitude, and a higher vibration time than the first driving mode.
  • only one of the items may be increased, and the other items may use default values.
  • the vibration frequency and the vibration amplitude both use default values, and the vibration time is determined based on the degree of adhesion of the coffee particles in the first image to be tested.
  • the first image to be tested is fixedly divided into multiple areas in a preset manner, for example, it is evenly divided into four areas.
  • the way of dividing the areas can be coordinated with the control accuracy of the vibration source, so that the vibration source can vibrate different areas separately.
  • different areas can be vibrated separately by multiple vibration sources, or the vibration of the area can be changed by moving the vibration position of the vibration source.
  • the adhesion degree of the area can be determined in the above manner.
  • the area with an adhesion degree higher than the preset degree can be used as the vibration area in the second driving mode.
  • the first image to be tested may not be fixedly divided into multiple areas in a preset manner. In the example where the vibration source can control the driving position, after detecting the position where the adhesion degree of coffee particles is higher than the preset degree, the vibration source can be driven with this position as the center of the vibration area.
  • the adhesion degree of the coffee particles in the first image to be tested is obtained, and The adhesion degree determines the vibration frequency in the second driving mode.
  • the adhesion condition in the first image to be tested can be determined according to the adhesion degree of the coffee particles to determine the corresponding vibration frequency, for example, the higher the adhesion degree, the higher the vibration frequency.
  • the initial identification information of the coffee particles in the image to be tested includes the number of coffee particles.
  • the number change information of the coffee particles is determined according to the number of coffee particles in at least one frame of the image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested, and the driving mode of the vibration source after the second image to be tested is determined according to the number change information.
  • the vibration source stops driving the coffee particles for the next time or drives the coffee particles to vibrate in a driving mode in which the vibration amplitude is less than a preset vibration amplitude, the vibration frequency is less than a preset vibration frequency, or the vibration time is less than a preset vibration time.
  • the coffee particles are driven to vibrate in a driving mode in which the vibration amplitude is greater than the preset vibration amplitude, the vibration frequency is greater than the preset vibration frequency, or the vibration time is greater than the preset vibration time.
  • the vibration source may be provided with only different first driving modes and second driving modes, wherein the vibration frequency in the first driving mode is a resonance frequency, and the vibration frequency in the second driving mode is less than or greater than the resonance frequency; and/or the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode.
  • the coffee particles are driven to vibrate by the first driving mode to shake the coffee particles apart.
  • the coffee particles may continue to be driven to vibrate by the first driving mode before at least two subsequent acquisitions of the image to be tested.
  • the coffee particles may also be driven to vibrate by the second driving mode before at least two subsequent acquisitions of the image to be tested.
  • the change in the number of coffee particles is confirmed according to the number of coffee particles in each frame of the image to be tested.
  • the next drive of the coffee particles by the vibration source is stopped or the next drive of the coffee particles by the second driving mode is continued.
  • the next driving of the coffee particles is continued in the first driving mode.
  • the initial identification information of the coffee particles includes the particle size of the coffee particles.
  • a distortion function is also obtained, and the distortion function is used to indicate the particle size compensation values at multiple pixel positions; the particle size of at least part of the coffee particles in the image to be tested in the image set to be tested is subjected to distortion correction according to the pixel position of the coffee particles and the corresponding particle size compensation value to obtain the particle size of the coffee particles after distortion correction.
  • the final identification information of the coffee particles is determined specifically according to the particle size of at least part of the frames to be tested in the image set to be tested after distortion correction.
  • the distortion function can be obtained and stored by calibrating the equipment before leaving the factory.
  • a checkerboard pattern can be imaged using a photosensitive array in the analysis equipment of the coffee particles, thereby fitting the distortion coefficient of each pixel position, that is, the distortion function.
  • the distortion function is a relationship curve between the distance between the pixel position and the center position of the image, and the difference between the actual particle size at the pixel position and the calculated particle size.
  • the difference between the calculated particle size and the actual particle size can be obtained based on this distance and the distortion function. By compensating this difference to the calculated particle size, the distortion can be corrected to obtain a more accurate particle size result.
  • the initial identification information of the coffee particles includes the particle size of the coffee particles; in step S103 Previously, a particle size compensation function is also obtained, and the particle size compensation function is used to indicate the particle size compensation value under multiple brightnesses.
  • the brightness of the area where the coffee particles are located in at least some frames of the image to be tested in the image set to be tested is also obtained respectively.
  • the particle size of the coffee particles in the image to be tested is compensated according to the brightness of the area where the coffee particles are located in the image to be tested and the particle size compensation value, so as to obtain the compensated particle size of the coffee particles.
  • step S103 the final identification information of the coffee particles is determined specifically according to the compensated particle size of the coffee particles in at least some frames of the image to be tested in the image set to be tested.
  • different brightnesses may be caused by uneven illumination light sources or different backgrounds of the carrying surface. Different brightnesses may lead to inconsistent particle size calculation results for the same coffee particles.
  • Figures 5 and 6 are respectively the images to be tested of coffee particles in different brightness areas.
  • the coffee particles are located in the area 701 with moderate brightness, and the edges of the coffee particles are relatively clear.
  • the coffee particles are located in the area 601 with too bright brightness, which may cause the edges of the coffee particles to be overexposed, and appear as corrosion of the edges of the coffee particles in the image to be tested, causing measurement errors in the particle size analysis. Therefore, by analyzing the particle size of the same coffee particles in different brightness areas during the calibration process before leaving the factory, the effect of different brightness on the particle size calculation of the coffee particles can be obtained and stored. In the actual particle size analysis, the particle size of the coffee particles in different brightness areas is compensated and calibrated to improve the measurement accuracy.
  • the initial identification information of the coffee particles includes the particle size of the coffee particles.
  • the coffee particle analysis method of the present application also includes: entering a calibration mode, wherein, in the calibration mode: capturing an image of a calibration pattern with a preset area located at a preset position within the field of view to obtain a calibration image; obtaining the number of pixels corresponding to the calibration pattern; and determining a calibration size corresponding to one pixel based on the preset area and the number of pixels.
  • the particle size of the coffee particles in step S102 the number of pixels of the coffee particles in the image to be tested in the image set to be tested is obtained respectively; and the particle size of the coffee particles is determined based on the calibration size and the number of pixels.
  • the calibration mode may be entered under the triggering of the user, or the calibration mode may be automatically entered at a certain interval by default to obtain the latest calibration size, or the user may set how to trigger the calibration mode.
  • the coffee particle analysis method of the present application not only includes analyzing the number, particle size, area, volume or mass of coffee particles, but also includes analyzing the chromaticity of coffee particles.
  • FIG. 7 is a schematic diagram of an embodiment of the coffee particle analysis method of the present application.
  • the chromaticity analysis method of coffee particles in this embodiment includes:
  • Step S701 acquiring at least one frame of raw image, wherein the at least one frame of raw image comprises raw pixel values of an image of the coffee particles captured when at least one light source irradiates the coffee particles respectively.
  • the at least one light source comprises a light source having an emission spectrum comprising a wavelength of 850 nm.
  • the at least one light source is different from the illumination light source in the coffee particle analysis device described above.
  • the at least one light source is referred to as a spectral light source hereinafter.
  • coffee particles may refer to coffee beans or coffee powder or coffee particles of other shapes and sizes.
  • the coffee particle analysis device is provided with only one spectral light source.
  • the coffee particle analysis device is provided with at least two spectral light sources with different emission spectra.
  • the at least two spectral light sources are used to emit light beams of different wavelengths between 500nm and 1100nm. It has been found through experiments that the reflection of the spectrum within this range by coffee particles is more conducive to calculating the chromaticity value of coffee particles.
  • the coffee particle analysis device is provided with at least some of the spectral light sources of six spectral light sources with emission spectra of 520nm, 600nm, 640nm, 850nm, 940nm, and 1100nm. Since coffee particles of the same roasted chromaticity have different reflectivities to light beams of different spectra, different original images are formed by the reflected light irradiated by multiple spectral light sources of different spectra to the coffee particles, and the original images corresponding to the spectral light sources of different spectra are fused by an algorithm to determine the chromaticity value of the coffee particles, which can effectively avoid the use of a single light source. The problem of poor stability of chromaticity value detection results caused by spectrum acquisition.
  • the photosensitive array in the coffee particle analysis device is used to capture images of the coffee particles when the spectral light source irradiates the coffee particles, and obtain at least one frame of initial original images.
  • n spectral light sources are provided in the coffee particle analysis device, n is greater than or equal to 2, and the n spectral light sources are used to irradiate the coffee particles at different times, respectively
  • the image acquisition module is used to capture images of the coffee particles when each spectral light source irradiates the coffee particles, and obtain at least n frames of initial original images, wherein each of the n frames of initial original images corresponds to a spectral light source.
  • a frame of original image corresponding to each spectral light source can be a frame of initial original image captured by the image acquisition module when the spectral light source irradiates the coffee particles, or it can be a frame of original image obtained by fusing multiple frames of initial original images captured by the image acquisition module when the spectral light source irradiates the coffee particles.
  • the initial raw image includes the original pixel value of each pixel position, also known as raw data.
  • the raw data refers to the original record of the level when the image acquisition module converts the light signal into an electrical signal when capturing the image of coffee particles. It is the raw data that has not been processed.
  • the raw data is generally output in a certain order, such as GRBG, RGGB, BGGR or GBRG, where R represents red, G represents green, and B represents blue.
  • GRBG, RGGB, BGGR or GBRG where R represents red, G represents green, and B represents blue.
  • Step S702 obtaining a frame of representative chromaticity diagram according to the at least one frame of original image.
  • Step S102 obtaining a frame of representative chromaticity diagram according to the at least one frame of original image.
  • the chromaticity value may specifically be the roasting degree index "Agtron" of the coffee particles or other values that can reflect the chromaticity of the coffee particles.
  • a basis function is obtained, which may be pre-stored and is a function between the original pixel values collected under the illumination of the spectral light source and the corresponding chromaticity values; the corresponding chromaticity values are obtained based on the original pixel values in the original image and the corresponding basis function, and the chromaticity diagram corresponding to the original image is obtained.
  • n is greater than or equal to 2
  • a frame of representative chromaticity diagram can be obtained by a linear model method.
  • the n frames of original images can be first fused into one frame of original image, and then the corresponding chromaticity diagram can be obtained based on the fused one frame of original image.
  • the weights of the n spectral light sources can also be obtained, and the n frames of original images can be the weights of the n spectral light sources fused into one frame of original image, for example, fused into one frame of original image by weighted summation.
  • corresponding chromaticity diagrams can be generated respectively according to the n frames of original images to obtain n frames of chromaticity diagrams, and then the n frames of chromaticity diagrams are fused into one frame of representative chromaticity diagram.
  • the weights of the n spectral light sources can also be obtained, and the one frame of representative chromaticity diagram is generated according to the weights of the n spectral light sources and the n frames of chromaticity diagrams, for example, fused into one frame of representative chromaticity diagram by weighted summation.
  • spectral light sources with different emission spectra are provided, and the corresponding weights are a1, a2, a3, a4, and a5, respectively, and five frames of chromaticity diagrams are obtained corresponding to the five spectral light sources.
  • a basis function corresponding to the kth spectral light source is obtained, and the basis function is a relationship function between the original pixel values collected under the irradiation of the kth spectral light source and the corresponding chromaticity values.
  • k is any integer from 1 to n.
  • the original pixel value in the k-th frame of the original image is obtained, and the k-th frame of the original image is the original image collected when the coffee particles are irradiated by the k-th spectral light source.
  • the corresponding chromaticity value is obtained according to the original pixel value in the k-th frame of the original image and the basis function corresponding to the k-th spectral light source, and the chromaticity diagram corresponding to the k-th frame of the original image is obtained.
  • Step S703 determining the overall chromaticity value of the coffee particles according to the one-frame representative chromaticity diagram.
  • a corresponding representative chromaticity distribution is obtained based on the representative chromaticity diagram of the frame, and the representative chromaticity distribution includes the ratio of the number of pixels of different representative chromaticity values to the total number of pixels.
  • the representative chromaticity value with the highest ratio is used as the overall chromaticity value of the coffee particles, or the weighted average of multiple representative chromaticity values with a ratio greater than a preset threshold is used as the overall chromaticity value of the coffee particles, or the average value or median in the representative chromaticity distribution is used as the overall chromaticity value of the coffee particles.
  • the weight of each chromaticity value can be determined according to its ratio. For example, the higher the ratio, the greater the weight of the chromaticity value.
  • the original image captured by the photosensitive array is obtained in the embodiments of the present application, and the accuracy of the original image is much higher than the accuracy of the grayscale image.
  • the numerical range of the grayscale image is 0 to 255, but the upper limit of the numerical value of the original image can reach three or four thousand or even higher.
  • the overall chromaticity value is also displayed on the interactive interface.
  • the representative chromaticity distribution is also displayed on the interactive interface.
  • Figure 8 is a schematic diagram of an interactive interface of the present application.
  • the representative chromaticity distribution is displayed on the interactive interface, specifically in the form of a chromaticity histogram to display the sum of pixel areas in different representative chromaticity value intervals or the ratio of the sum of pixel areas to the total area.
  • the overall chromaticity value is also displayed on the interactive interface, specifically AG 73.2.
  • the interactive interface also highlights the representative chromaticity value interval where the overall chromaticity value is located in the chromaticity histogram to indicate that the overall chromaticity value falls within the representative chromaticity value interval.
  • the basis functions of spectral light sources of different spectra can be obtained through calibration and pre-stored, and the pre-stored weights are directly read for calculation during calculation.
  • the first spectral light source can be used to illuminate a plurality of preset color cards with different chromaticity values, and the original pixel values corresponding to each of the preset color cards can be obtained. Since the chromaticity value of each preset color card is known, the basis function corresponding to the first spectral light source can be fitted through the chromaticity values of the plurality of preset color cards and the corresponding original pixel values.
  • the calibration method of the basis functions of other spectral light sources can be similar to the calibration method of the basis function of the first spectral light source.
  • the weight of the spectral light source is also determined according to the degree of linear correlation between the chromaticity values of the multiple preset color cards and the corresponding raw pixel values.
  • the weight corresponding to the spectral light source with a higher degree of linear correlation between the raw data and the chromaticity value can be higher.
  • the n spectral light sources include a first spectral light source and a second spectral light source, wherein the emission spectrum of the first spectral light source includes a wavelength of 850nm, and the main wavelength of the emission spectrum of the second spectral light source is a wavelength other than 850nm; wherein the weight of the first spectral light source is higher than the weight of the second spectral light source.
  • infrared spectroscopy is more sensitive to light-colored objects, when the color of light-colored objects changes slightly, the raw data obtained by imaging will change greatly, resulting in low accuracy of the chromaticity value obtained by imaging coffee particles using only infrared spectral light sources.
  • spectral light sources of different spectra to image coffee particles to obtain raw images, more dimensional information can be provided to calculate the color of coffee particles.
  • the chromaticity value of the particles is calculated to improve the calculation accuracy of the chromaticity value.
  • a representative chromaticity diagram may be obtained according to the at least one frame of the original image by other methods.
  • the representative chromaticity diagram may be obtained by a Gaussian mixture model method.
  • the Gaussian mixture model may be pre-stored in the analysis device of the coffee particles, and the Gaussian mixture model may be obtained by reading the storage.
  • the mixed Gaussian model includes the probability density functions of m known Gaussian models and the weights of the m unknown Gaussian models, and the m Gaussian models are respectively the n-dimensional Gaussian distributions of the original pixel values collected by each of the m preset color cards under the irradiation of the n spectral light sources, and m is an integer greater than or equal to 2.
  • m is an integer such as 10, 12, 13, 15, etc.
  • the Gaussian mixture model can be any Gaussian mixture model.
  • the Gaussian mixture model can be any Gaussian mixture model.
  • ⁇ k represents the weight of the k-th Gaussian model
  • ⁇ k , ⁇ k ) represents the probability density function of the k-th Gaussian model
  • x represents the original pixel value
  • p(x) represents the Gaussian distribution of the original pixel value in the original image.
  • ⁇ k , ⁇ k ) is known. This N(x
  • the Gaussian distribution of the original pixel value of the first pixel position is acquired according to the n frames of original images, and the weight values of the m Gaussian models are acquired according to the Gaussian distribution of the original pixel value of the first pixel position and the mixed Gaussian model.
  • the first pixel position an n-dimensional vector composed of the n original pixel values of the first pixel position in the n frames of original images is acquired as x, and the Gaussian distribution of the n original pixel values is substituted into the above Gaussian mixture model as p(x).
  • the weight values ⁇ k of the m Gaussian models corresponding to the first pixel position can be obtained according to the Gaussian distribution p(x ) and N(x
  • the representative chromaticity value at the first pixel position is obtained.
  • the representative chromaticity value at the first pixel position can be calculated according to the following formula:
  • Ak represents the chromaticity value of the preset color card corresponding to the kth Gaussian model, and the chromaticity values of each preset color card are known. After substituting ⁇ k into the above formula, the representative chromaticity value Ak at the first pixel position can be obtained.
  • the n frames of original images may be sent to a server so that the server generates a representative chromaticity graph corresponding to the n frames of original images based on the n frames of original images and a preset mixed Gaussian model, and then receives the representative chromaticity graph sent by the server.
  • the method of generating a representative chromaticity graph corresponding to the n frames of original images based on the n frames of original images and a preset mixed Gaussian model can be referred to the above description and will not be repeated here. Since the calculation is moved to the server, the computing power cost of the coffee particle analysis equipment can be reduced while maintaining the accuracy of the chromaticity value calculation.
  • the linear change can be compensated by weighted averaging the chromaticity responses of different wavelengths to improve the accuracy of chromaticity value calculation.
  • the preset threshold is an Ag value between 95 and 105, for example, AG 100.
  • the chromaticity value, specifically the AG value is greater than the preset threshold, the distribution coupling degree of the original pixel values of different AG values at different wavelengths is relatively large. High, using the mixed Gaussian model fitting can better distinguish each distribution.
  • n frames of chromaticity diagrams are generated according to the n frames of original images; when the area of the n-frame chromaticity diagram whose chromaticity value is greater than the preset threshold is greater than the preset area, or when the proportion of the area of the n-frame chromaticity diagram whose chromaticity value is greater than the preset threshold is greater than the preset proportion, the one-frame representative chromaticity diagram is obtained according to the mixed Gaussian model method.
  • the one-frame representative chromaticity diagram is obtained according to the linear model method.
  • the colorimetric analysis method of coffee particles of the present application also includes: entering an automatic calibration mode, in the automatic calibration mode: acquiring at least one frame of original calibration image, the at least one frame of original calibration image comprising original pixel values of an image captured of a preset calibration color card when a preset calibration color card located at a preset position is irradiated by at least one spectral light source; calculating the chromaticity value of the preset calibration color card based on the original pixel values in the at least one frame of original calibration image; calculating the chromaticity compensation value based on the chromaticity value calculated from the preset calibration color card and the actual chromaticity value of the preset calibration color card.
  • the preset calibration color card located at the preset position may refer to the user placing the preset calibration color card on the carrying surface, and then starting the spectral light source and the image acquisition module to collect images of the preset calibration color card.
  • the preset calibration color card may be fixed in the analysis device of the coffee particles, and fixed at a position other than the carrying surface within the field of view of the image acquisition module, for example, fixed on the inner wall of the analysis device of the coffee particles, so as to be located within the field of view of the image acquisition module without blocking the carrying surface.
  • the chromaticity compensation value is obtained by the image area corresponding to the preset calibration color card in the collected original image.
  • the preset calibration color card is fixed in the analysis device of the coffee particles, and fixed outside the field of view of the image acquisition module; the analysis device of the coffee particles is also provided with a mechanical module for moving the preset calibration color card into the field of view of the image acquisition module after entering the automatic calibration mode, so that the image acquisition module collects the original image of the preset calibration color card.
  • the calibration pattern with a preset area described above can be located on the preset calibration color card.
  • Figure 10 is a schematic diagram of an embodiment of the preset calibration color card of the present application.
  • the preset calibration color card has a known chromaticity value, and a calibration pattern with a preset area is provided on the preset calibration color card (a circle is used as an example in Figure 10). In this way, after the image of the preset calibration color card is acquired, the circle above can also be used to determine the calibration size corresponding to a pixel.
  • the chromaticity compensation value is obtained through the automatic calibration mode, and the chromaticity compensation value is compensated to the calculated chromaticity value of the coffee particles when calculating the chromaticity value of the coffee particle size, so as to improve the calculation accuracy.
  • a frame of initial representative chromaticity diagram is obtained based on the at least one frame of original image; the method of obtaining the initial representative chromaticity diagram can be the same as the method of obtaining the representative chromaticity diagram described above.
  • the representative chromaticity diagram of the coffee particles is determined based on the chromaticity values in the initial representative chromaticity diagram of the coffee particles and the chromaticity compensation value.
  • the chromaticity compensation value is added to or subtracted from the initial representative chromaticity value of each pixel position in the initial representative chromaticity diagram to obtain the representative chromaticity value of each pixel position, that is, the representative chromaticity diagram.
  • Figure 9 is a schematic diagram of a frame of captured image of coffee particles. In the captured image, a partial pixel area 91 corresponding to the carrier surface can be seen. Therefore, optionally, when acquiring at least one frame of original image in step S701, at least one frame of initial original image is acquired, and the at least one frame of original image is determined based on the at least one frame of initial original image.
  • invalid pixel values can be determined from the initial original image, where the invalid pixel values are pixel values corresponding to objects other than the coffee particles in the initial original image; the invalid pixel values in the at least one frame of the initial original image are removed to obtain the at least one frame of the original image.
  • the representative chromaticity diagram obtained from the at least one frame of the original image in the subsequent step S702 can more accurately reflect the chromaticity values of the coffee particles.
  • the original image is an image of coffee particles mounted on a carrying surface
  • the original image contains ineffective pixel values corresponding to the bottom of the carrying surface because the coffee particles fail to cover the entire carrying surface.
  • the presence of these ineffective pixel values will affect the measurement of the chromaticity values of the coffee particles.
  • the carrying surface can be set to have a color (e.g., white) that is significantly different from the color of the coffee particles, or to have a texture that is significantly different from the surface texture of the coffee particles, or to have an easily recognizable pattern. In this way, the ineffective pixel values can be identified by identifying the color, texture, or pattern of the original image.
  • the effective pixel values have certain commonalities and are significantly different from the ineffective pixel values.
  • the effective pixel values or ineffective pixel values can be identified by the difference and/or similarity of the raw data at each pixel position.
  • step S701 when acquiring at least one frame of original image in step S701, specifically acquiring at least one frame of initial original image; acquiring at least one frame of initial original image; acquiring a brightness compensation function; determining the original pixel compensation value of the pixel position according to the brightness compensation function and the pixel position in the initial original image; compensating the original pixel value of the pixel position in the at least one frame of initial original image according to the original pixel compensation value of the pixel position to obtain the at least one frame of original image.
  • the analysis of a single sample coffee particle with uniform chromaticity distribution in the entire field of view can obtain the original pixel value distribution of different pixel positions (corresponding to different brightness), and then calculate the original pixel compensation value at different pixel positions, that is, the brightness compensation function.
  • the brightness compensation function can be the relationship between the distance between the pixel position and the center position of the image and the original pixel compensation value. In this way, the brightness of pixels in different areas is compensated and calibrated in the algorithm to improve the measurement accuracy of colorimetric analysis.
  • the carrying surface is specifically the bottom surface of a preset sample tray, and the depth of the preset sample tray is set to enable the preset sample tray to carry at least two layers of coffee particles, so as to avoid the bottom surface of the preset sample tray appearing in the original image when imaging the coffee particles.
  • step S701 when determining the at least one frame of original image based on the at least one frame of initial original image in step S701, it can also include obtaining the distance distribution between the coffee particles and the image acquisition module, and compensating the pixel values in the at least one frame of initial original image according to the distance distribution to obtain the at least one frame of original image.
  • the distance between the image acquisition module and the coffee particles is different, and the raw data in the obtained original image will also be somewhat different. These differences will lead to inconsistent measurement benchmarks for the chromaticity values of different coffee particles in the original image, resulting in deviations in the measurement results.
  • the accuracy of the chromaticity values of the coffee particles can be further improved.
  • the distance measurement module is controlled to emit a light beam to the coffee particles and receive the return light reflected by the coffee particles, and the distance distribution between the coffee particles and the image acquisition module is obtained according to the emitted light beam and the return light.
  • the original image is divided into at least one area, and the distance distribution refers to the distance between the coffee particles and the image acquisition module in each area. It can be understood that the more areas are divided, the finer the distance distribution.
  • the distance measuring module is a laser distance measuring module arranged adjacent to the image acquisition module, for emitting a laser beam to the coffee particles, receiving the laser beam reflected by the coffee particles, and measuring the distance between the coffee particles and the image acquisition module according to the emitted laser beam and the received laser beam.
  • the measuring method may be a pulse method, a coherent method or a triangulation method, etc. Since the laser triangulation method has lower requirements on the laser distance measuring module and thus has lower costs, it is preferred to use a laser distance measuring module of the laser triangulation method.
  • the bearing surface is specifically the bottom surface of the preset sample tray
  • the image acquisition module is used to obtain a picture of the coffee particles in the preset sample tray; the picture is divided into at least one area; the target pixel area corresponding to the bottom of the preset sample tray in each area is determined; and the distance distribution between the coffee particles and the image acquisition module is obtained according to the proportion of the target pixel area in each area.
  • a divided area when the area of the target pixel area corresponding to the bottom surface of the preset sample tray and the area of the area are greater than a certain value, it can be determined that the coffee particles in the area are only spread in one layer in the preset sample tray.
  • the distance between the coffee particles and the image acquisition module in the area can be estimated.
  • the proportion of the target pixel area corresponding to the bottom of the preset sample tray in the area is less than a certain value, it can be considered that the coffee particles cover the preset sample tray in the area, and the pre-calibrated distance between the preset sample tray and the image acquisition module is used as the distance between the coffee particles and the image acquisition module in the area.
  • the pixel values in the at least one frame of the original image are compensated according to the distance distribution, so as to compensate the original pixel values in the original image to the original pixel values when all the coffee particles and the image acquisition module have the same distance.
  • the original pixel values in at least one area of the original image of at least one frame can be compensated according to the acquired distance distribution, so as to compensate the original pixel values in the area of the original image to the original pixel values corresponding to the preset distance between the coffee particles and the image acquisition module.
  • a vibration source is further provided on the other side of the bottom surface of the preset sample tray, which is used to drive the bottom surface of the preset sample tray to vibrate, so that the coffee particles in the preset sample tray are evenly distributed.
  • the vibration source is used to vibrate the bottom surface of the preset sample tray, so that the coffee particles are evenly distributed, so that when the distance between the coffee particles and the image acquisition module is acquired by the distance measuring module, it is not necessary to acquire the distance distribution of different areas in the preset sample tray, but only the distance between the coffee particles and the image acquisition module at one place needs to be acquired.
  • a mechanical wave is emitted to the preset sample tray to vibrate the preset sample tray to change the distribution of the coffee particles in the preset sample tray.
  • the preset condition may be that 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, a mechanical wave is emitted to the preset sample tray to make the distribution of the coffee particles in the preset sample tray uniform. Then, at least one frame of original image is acquired for the uniformly distributed coffee particles.
  • the vibration frequency, vibration amplitude or vibration time of the vibration source may be fixed or adjustable.
  • the display interface of the coffee particle analysis device is also provided with adjustment options for the vibration frequency, vibration amplitude or vibration time, so that the user can select the corresponding vibration frequency, vibration amplitude or vibration time according to the size of the coffee particles.
  • the coffee particle analysis device can preliminarily determine the particle size of the coffee particles based on the analysis results of the previous frame or frames of images collected by the image acquisition module, and automatically adjust the corresponding vibration amplitude or vibration time.
  • a frame of initial representative chromaticity diagram is obtained specifically according to the at least one frame of original image; in addition, a temperature sensor is provided in the chromaticity analysis device of the coffee particles, and the current ambient temperature is obtained by the temperature sensor, and the chromaticity compensation method corresponding to the current ambient temperature is determined from the chromaticity compensation methods at different temperatures; the representative chromaticity diagram of the coffee particles is determined according to the chromaticity values in the initial representative chromaticity diagram of the coffee particles and the chromaticity compensation method.
  • the current ambient temperature can be the temperature of the sensor, or the temperature of the light source, or the temperature of the coffee particles.
  • the temperature sensor can be set close to the preset sample tray so that the measured temperature is closer to the temperature of the coffee particles in the preset sample tray.
  • the chromaticity compensation method at different temperatures can be obtained through the calibration before leaving the factory and stored in the analysis equipment of the coffee particles. Specifically, the difference between the chromaticity values calculated at multiple ambient temperatures and the chromaticity values calculated at the reference temperature can be determined in the calibration as the chromaticity compensation value.
  • the representative chromaticity diagram of the coffee particles is determined according to the initial representative chromaticity values in the initial representative chromaticity diagram of the coffee particles and the chromaticity compensation method, specifically, each initial representative chromaticity value in the initial representative chromaticity diagram is added or subtracted with the chromaticity compensation value corresponding to the current ambient temperature as the representative chromaticity value to obtain the representative chromaticity diagram.
  • the colorimetric analysis device of the coffee particles and the colorimetric value when the coffee particles reach temperature equilibrium are generally used as the basis for calculation.
  • the temperature difference between the two will cause colorimetric value measurement errors.
  • the colorimetric compensation value under non-temperature equilibrium is detected to perform temperature compensation.
  • the present application also provides a coffee particle analysis device, as shown in FIG11 , which is an exemplary diagram of an embodiment of the coffee particle analysis device of the present application.
  • the coffee particle analysis device 1100 includes:
  • a control module 1101 is used to control the vibration source to drive the coffee particles to vibrate at least twice;
  • An image acquisition module 1102 is used to respectively acquire images of the coffee particles after the at least two vibrations to obtain a set of images to be tested having coffee particles with different distributions;
  • a first acquisition module 1103 is used to respectively acquire initial recognition information of coffee particles in the images to be tested in the image set to be tested;
  • the first determination module 1104 is configured to determine final identification information of the coffee particles according to initial identification information of coffee particles in at least some frames of the image set to be tested.
  • control module 1101 is used to control the vibration source to drive the coffee particles to vibrate in a first driving mode to obtain coffee particles with a first distribution; the image acquisition module 1102 is used to capture images of the coffee particles with the first distribution to obtain a first image to be tested; the control module 1101 is also used to control the vibration source to drive the coffee particles with the first distribution to vibrate in a second driving mode to obtain coffee particles with a second distribution; the image acquisition module 1102 is also used to capture images of the coffee particles with the second distribution to obtain a second image to be tested.
  • the first driving mode and the second driving mode are different; the control module 1101 is further used to control the vibration source to drive the coffee particles with the first distribution to vibrate in the second driving mode at least once after controlling the vibration source to drive the coffee particles with the first distribution to vibrate in the second driving mode; the image acquisition module 1102 is also used to capture images of the coffee particles after each driving in the second driving mode, to obtain at least one frame of image to be tested.
  • At least one of the following items is different between the first driving mode and the second driving mode: vibration frequency, vibration amplitude, vibration time, and vibration area.
  • the vibration frequency in the first driving mode is a resonance frequency
  • the vibration frequency in the second driving mode is less than or greater than the resonance frequency
  • the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode
  • the vibration amplitude in the first driving mode is greater than the vibration amplitude in the second driving mode, And the vibration time in the second driving mode is longer than the vibration time in the first driving mode.
  • the second driving mode is determined according to the first image to be tested.
  • the device 1100 also includes: a second determination module, used to determine at least one of the vibration frequency, vibration amplitude, vibration time or vibration area in the second driving mode according to the initial identification information of the coffee particles in the first image to be tested; the initial identification information of the coffee particles in the first image to be tested includes the number and/or area of the coffee particles in the first image to be tested.
  • a second determination module used to determine at least one of the vibration frequency, vibration amplitude, vibration time or vibration area in the second driving mode according to the initial identification information of the coffee particles in the first image to be tested.
  • the initial identification information of the coffee particles in the image to be tested includes the number of coffee particles; the device 1100 also includes: a third determination module, used to determine the change in the number of the coffee particles based on the number of coffee particles in at least one frame of the image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested; a fourth determination module, used to determine the driving mode of the vibration source after the second image to be tested based on the change in the number.
  • determining the driving mode of the vibration source after the second image to be tested based on the quantity change includes at least one of the following: when the quantity change is a decrease in quantity or the change value is less than a threshold value, stopping the next drive of the vibration source on the coffee particles or continuing the next drive of the coffee particles with the second driving mode; or, when the quantity change is an increase in quantity and the change value is greater than the threshold value, continuing the next drive of the coffee particles with the first driving mode.
  • the number of coffee particles in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested is the number of particles whose area is greater than a preset critical value in at least one frame of image to be tested before the first image to be tested, the first image to be tested, and the second image to be tested.
  • the initial identification information includes at least one of the particle size, quantity, area, volume, mass, and chromaticity of the coffee particles; and/or at least one of the quantity, area, volume, mass, and chromaticity of extremely small coffee particles, wherein the extremely small coffee particles are coffee particles having a particle size smaller than a first preset particle size, or a particle size smaller than the first preset particle size and greater than a preset critical value, wherein the value of the first preset particle size is smaller than the value of the particle size in the multiple particle size intervals.
  • the initial identification information also includes: at least one of the number distribution, area distribution, volume distribution, mass distribution, and chromaticity distribution of the coffee particles in different particle size ranges; and/or information on the proportion of the extremely small coffee particles in all coffee particles.
  • the final identification information includes at least one of a final number distribution, a final area distribution, a final volume distribution, a final mass distribution, and a final chromaticity distribution of the coffee particles in different particle size intervals; the device 1100 further includes:
  • the display module is used to display at least one of the final number distribution, final area distribution, final volume distribution, final mass distribution, and final chromaticity distribution of the coffee particles in different particle size ranges on an interactive interface.
  • the initial identification information of the coffee particles includes the particle size of the coffee particles
  • the device 1100 also includes: a second acquisition module, 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 images to be tested in the image set to be tested, wherein the distortion function is used to indicate particle size compensation values at multiple pixel positions; a distortion correction module, used to perform distortion correction on the particle size of at least some of the coffee particles in the images to be tested in the image set to be tested according to the pixel positions of the coffee particles and the corresponding particle size compensation values to obtain the particle size of the coffee particles after distortion correction; the first determination module is specifically used to determine the final identification information of the coffee particles based on the particle size of the coffee particles in at least some frames of the images to be tested in the image set to be tested after distortion correction.
  • a second acquisition module 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 images to be tested in the image set to be tested, wherein the
  • the initial identification information of the coffee particles includes the particle size of the coffee particles; before determining the final identification information of the coffee particles based on the initial identification information of at least part of the frames of the image to be tested in the image set to be tested, the method further includes: a third acquisition module for acquiring a particle size compensation function, wherein the particle size compensation function is used to indicate the particle size compensation value under multiple brightness levels; a fourth acquisition module for respectively acquiring the particle size compensation values under multiple brightness levels; The first determining module is used to determine the final identification information of the coffee particles according to the compensated particle size of the coffee particles in at least some of the frames of the images to be tested.
  • the initial identification information of the coffee particles includes the particle size of the coffee particles; the method also includes a calibration module for entering a calibration mode, wherein, in the calibration mode, the calibration module is further used to: capture an image of a calibration pattern with a preset area located at a preset position within the field of view to obtain a calibration image; obtain the number of pixels corresponding to the calibration pattern; determine a calibration size corresponding to one pixel based on the preset area and the number of pixels; the first acquisition module is specifically used to: respectively obtain the number of pixels of the coffee particles in the image to be tested in the image set to be tested; determine the particle size of the coffee particles based on the calibration size and the number of pixels.
  • the image to be tested is an image captured when the coffee particles are illuminated by an illumination light source; the device also includes: a fifth acquisition module, used to acquire at least one frame of raw image, the at least one frame of raw image comprising raw pixel values of the image captured when the coffee particles are illuminated by at least one light source different from the illumination light source; a sixth acquisition module, used to acquire a frame of representative chromaticity diagram based on the at least one frame of raw image; and a fifth determination module, used to determine the overall chromaticity value of the coffee particles based on the one frame of representative chromaticity diagram.
  • a fifth acquisition module used to acquire at least one frame of raw image, the at least one frame of raw image comprising raw pixel values of the image captured when the coffee particles are illuminated by at least one light source different from the illumination light source
  • a sixth acquisition module used to acquire a frame of representative chromaticity diagram based on the at least one frame of raw image
  • a fifth determination module used to determine the overall chromaticity value of the coffee
  • the present application also provides a coffee particle analysis device, as shown in Figure 12, which is an example diagram of an embodiment of the coffee particle analysis device of the present application.
  • the coffee particle analysis device 1200 includes a memory 1201 and a processor 1202, and the memory 1201 stores executable code. When the executable code is processed by the processor 1202, the coffee particle analysis device can perform any of the coffee particle analysis methods described in the coffee particle analysis device.
  • the coffee particle analysis device 1200 further includes a vibration source, a light source module, a photosensitive surface array, and a carrying surface for carrying the coffee particles.
  • the light source module includes an irradiation light source and a backlight light source respectively located on both sides of the carrying surface.
  • the photosensitive surface array is used to capture images to be measured of the coffee particles on the carrying surface when the irradiation light source and the backlight light source emit light beams.
  • Figure 13 is a schematic diagram of the structure of the vibration source, the bearing surface and the backlight source in one embodiment of the coffee particle analysis device of the present application
  • Figure 14 is an exploded view of the structure shown in Figure 13.
  • the vibration source 1301 includes a power amplifier, or the vibration source includes at least two linear vibration sources with different directions.
  • the description of the vibration source can refer to the description of the vibration source above, and will not be repeated here.
  • the vibration source 1301 is illustrated with a power amplifier.
  • the bearing surface 1302 is specifically a first light-homogenizing film; a second light-homogenizing film 1303 and a light guide plate 1304 are also provided between the power amplifier 1301 and the first light-homogenizing film 1302.
  • the first light-homogenizing film 1302, the light guide plate 1304 and the second light-homogenizing 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-homogenizing film 1302 and the second light-homogenizing film 1303.
  • the backlight source 1305 is located at the periphery of the light guide plate 1304.
  • the second light-homogenizing film 1303 and the light guide plate 1304 are respectively connected to the first light-homogenizing film 1302 by glue to form a closed air cavity.
  • the second light-homogenizing film 1303 is connected to the power amplifier 1301.
  • the vibration of the power amplifier 1301 is transmitted to the second light-homogenizing film 1303
  • the vibration of the second light-homogenizing film 1303 is transmitted to the first light-homogenizing film 1302 through the air cavity, thereby driving the vibration of the coffee particles.
  • at least one through hole 13041 is also provided on the light guide plate 1304 to facilitate the transmission of vibration through the air cavity.
  • Figure 16 is a schematic diagram of the image to be measured collected by the photosensitive array when the illumination light source and the backlight light source are turned on at the same time. It can be seen that the backlight light source can make it more accurate to distinguish the background and coffee particles, and improve the accuracy of the particle size analysis of coffee particles.
  • a light guide plate is also used in this example, and the light source is illuminated from the side of the light guide plate, which can improve the brightness uniformity of the image to be measured and improve the accuracy of the particle size analysis of coffee particles.
  • the light source module further includes at least two spectral light sources for emitting different wavelengths between 500 nm and 1100 nm.
  • the processor executes the above-mentioned coffee particle analysis method, when acquiring at least one frame of original image, specifically, the original image captured by the photosensitive array of the coffee particles when the at least two spectral light sources irradiate the coffee particles respectively.
  • a preset calibration color card is also provided inside the coffee particle analysis device, such as the preset calibration color card as described in FIG10.
  • the coffee particle analysis device also includes a hollow cylindrical structural member with an opening on one side, and a base that is detachably fixed to the opening of the structural member.
  • the above-mentioned light source module and photosensitive array are provided on the inner top of the structure, and the base includes a bearing surface and a vibration source.
  • the preset calibration color card is fixed on the inner side surface of the structural member, is located within the field of view of the photosensitive array, and does not block the coffee particles on the bearing surface.
  • the present application may also be implemented as a computer-readable storage medium (or a non-temporary machine-readable storage medium or a machine-readable storage medium) on which an executable code (or a computer program or a computer instruction code) is stored.
  • an executable code or a computer program or a computer instruction code
  • the processor executes part or all of the steps of the above-mentioned method according to the present application.

Landscapes

  • Chemical & Material Sciences (AREA)
  • Dispersion Chemistry (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

本申请提供一种咖啡颗粒的分析方法、装置、设备和计算可读存储介质,该方法包括:控制振动源驱动咖啡颗粒进行至少两次振动,分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集;分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息;根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息。

Description

咖啡颗粒的分析方法、装置、设备和计算可读存储介质 技术领域
本申请涉及咖啡测量领域,尤其涉及一种咖啡颗粒的分析方法、装置、设备和计算可读存储介质。
背景技术
在咖啡冲煮中,咖啡粉的研磨度,即咖啡粉径的粗细程度和均匀度,决定了咖啡粉与冲煮用水的接触面积,继而影响咖啡粉的萃取率。一般来说,咖啡粉越细,萃取率越高。因此,通过调整咖啡粉的研磨度,就可以调整咖啡的萃取率。粒径分析可以得到咖啡粉的粒径分布,帮助研究咖啡粉的粗细程度和均匀度,判断咖啡粉是否过粗或过细,进而通过调整咖啡粉的粗细来调整咖啡的萃取率。一种分析咖啡粉的粒径分布的方法,是通过对咖啡粉采集图像,通过图像分析来得到咖啡粉的粒径。
在通过图像分析咖啡粉的粒径的方法中,还存在可以改进的地方。
发明内容
本申请提供一种咖啡颗粒的分析方法、装置、设备和计算可读存储介质,可以提高咖啡颗粒的分析准确度。
本申请第一方面提供一种咖啡颗粒的分析方法,所述方法包括:
控制振动源驱动咖啡颗粒进行至少两次振动,分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集;
分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息;
根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息。
可选地,所述控制振动源驱动咖啡颗粒进行至少两次振动,分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集,包括:控制振动源以第一驱动方式驱动所述咖啡颗粒振动,得到具有第一分布的咖啡颗粒;对所述具有第一分布的咖啡颗粒采集图像,得到第一待测图像;控制所述振动源以第二驱动方式驱动所述具有第一分布的咖啡颗粒振动,得到具有第二分布的咖啡颗粒;对所述具有第二分布的咖啡颗粒采集图像,得到第二待测图像。
可选地,所述第一驱动方式和所述第二驱动方式不同;所述控制所述振动源以第二驱动方式驱动所述具有第一分布的咖啡颗粒振动,之后还包括:控制所述振动源至少一次以所述第二驱动方式驱动所述咖啡颗粒振动;分别对每一次以所述第二驱动方式驱动后的所述咖啡颗粒采集图像,得到至少一帧待测图像。
可选地,所述第一驱动方式和所述第二驱动方式中的以下至少一项不同:振动频率、振动幅度、振动时间、振动区域。
可选地,所述第一驱动方式中的振动频率为共振频率,所述第二驱动方式中的振动频率小于或大于所述共振频率;和/或,所述第一驱动方式中的振动幅度大于所述第二驱动方式中的振动幅度。
可选地,所述第一驱动方式中的振动幅度比所述第二驱动方式中的振动幅度大,且所述第二驱动方式中的振动时间比所述第一驱动方式中的振动时间长。
可选地,所述第二驱动方式是根据所述第一待测图像确定的。
可选地,所述方法还包括:根据所述第一待测图像的咖啡颗粒的初始识别信息确定所述第二驱动方式中的振动频率、振动幅度、振动时间或振动区域中的至少一项;所述第一待测图像的咖啡颗粒的初始识别信息包括所述第一待测图像中的咖啡颗粒的数量和/或面积。
可选地,所述待测图像的咖啡颗粒的初始识别信息包括咖啡颗粒的数量;所述方法还包括:根据所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中所述咖啡颗粒的数量确定所述咖啡颗粒的数量变化;根据所述数量变化确定所述振动源在所述第二待测图像之后的驱动方式。
可选地,所述根据所述数量变化确定所述振动源在所述第二待测图像之后的驱动方式,包括以下至少一项:当所述数量变化为数量下降或者变化数值小于阈值时,停止所述振动源对所述咖啡颗粒的下一次驱动或者以所述第二驱动方式继续对所述咖啡颗粒的下一次驱动;或者,当所述数量变化为数量上升且变化数值大于所述阈值时,以所述第一驱动方式继续对所述咖啡颗粒的下一次驱动。
可选地,所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中所述咖啡颗粒的数量,为所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中面积大于预设临界值的颗粒的数量。
可选地,所述初始识别信息包括所述咖啡颗粒的粒径、数量、面积、体积、质量、色度中的至少一项;和/或,极小咖啡颗粒的数量、面积、体积、质量、色度中至少一项,所述极小咖啡颗粒为粒径小于第一预设粒径,或者粒径小于第一预设粒径且大于预设临界值的咖啡颗粒,其中,所述第一预设粒径的取值小于所述多个粒径区间中的粒径的取值。
可选地,所述初始识别信息还包括:所述咖啡颗粒在不同的粒径区间内数量分布、面积分布、体积分布、质量分布、色度分布中的至少一项;和/或,所述极小咖啡颗粒在所有咖啡颗粒中的占比信息。
可选地,所述最终识别信息包括所述咖啡颗粒在不同的粒径区间内最终数量分布、最终面积分布、最终体积分布、最终质量分布、最终色度分布中的至少一项;所述方法还包括:在交互界面上显示所述咖啡颗粒在不同的粒径区间内最终数量分布、最终面积分布、最终体积分布、最终质量分布、最终色度分布中的至少一项。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息之前,还包括:获取畸变函数,所述畸变函数用于指示多个像素位置处的粒径补偿值;对所述待测图像集中的待测图像的至少部分咖啡颗粒的粒径,根据所述咖啡颗粒的像素位置和对应的粒径补偿值进行畸变校正,得到咖啡颗粒的畸变校正后的粒径;所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息,包括:根据所述待测图像集中至少部分帧待测图像的所述咖啡颗粒的畸变校正后的粒径确定所述咖啡颗粒的最终识别信息。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息之前,还包括:获取粒径补偿函数,所述粒径补偿函数用于指示在多个亮度下的粒径补偿值;分别获取所述待测图像集中至少部分帧待测图像中咖啡颗粒所在区域的亮度;对所述至少部分帧待测图像,根据所述待测图像中的咖啡颗粒所在区域的亮度和所述粒径补偿值对所述待测图像中的咖啡颗粒的粒径进行补偿,得到咖啡颗粒的补偿后的粒径;所述根据所述待测图像集中至少部分帧待测 图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息,包括:根据所述待测图像集中至少部分帧待测图像的所述咖啡颗粒的补偿后的粒径确定所述咖啡颗粒的最终识别信息。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;所述方法还包括:进入标定模式,其中,在所述标定模式中:对位于视场范围内预设位置处的、具有预设面积的标定图案采集图像,得到标定图像;获取所述标定图案所对应的像素数量;根据所述预设面积和所述像素数量确定一个像素所对应的标定尺寸;
所述分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息,包括:分别获取所述待测图像集中的待测图像的咖啡颗粒的像素数量;根据所述标定尺寸和所述像素数来确定所述咖啡颗粒的粒径。
可选地,所述待测图像是所述咖啡颗粒被照射光源照射时所采集的图像;所述方法还包括:获取至少一帧原始(raw)图像,所述至少一帧原始图像包含至少一种不同于所述照射光源的光源分别对咖啡颗粒照射时对所述咖啡颗粒所采集的图像的原始像素值;根据所述至少一帧原始图像获取一帧代表色度图;根据所述一帧代表色度图确定所述咖啡颗粒的整体色度值。
本申请第二方面提供一种咖啡颗粒的分析装置,包括:
控制模块,用于控制振动源驱动咖啡颗粒进行至少两次振动;
图像采集模块,用于分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集;
第一获取模块,用于分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息;
第一确定模块,用于根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息。
本申请第三方面提供一种咖啡颗粒的分析设备,包括存储器和处理器,所述存储器上存储有可执行代码,当可执行代码被所述处理器处理时,可以使所述处理器执行任一项所述的咖啡颗粒的分析方法。
可选地,所述咖啡颗粒的分析设备还包括:振动源、光源模块、感光面阵,以及用于承载所述咖啡颗粒的承载面;所述振动源位于所述承载面一侧;所述光源模块包括位于所述承载面用于承载所述咖啡颗粒的一侧的照射光源;所述感光面阵用于在所述照射光源发射光束时对所述承载面上的咖啡颗粒采集待测图像。
可选地,所述承载面具体为第一匀光薄膜;所述振动源和所述第一匀光薄膜之间还设置有第二匀光薄膜和导光板,所述第一匀光薄膜、所述导光板和所述第二匀光薄膜依次并列排布,所述导光板位于所述第一匀光薄膜和所述第二匀光薄膜所围成的气密空间内;所述导光板上还设置有至少一个通孔;所述光源模块还包括背光光源,位于所述导光板的周缘;所述感光面阵用于在所述照射光源和所述背光光源发射光束时对所述承载面上的咖啡颗粒采集待测图像。
可选地,所述振动源包括功率放大器,或者,所述振动源包括具有不同方向的至少两个线性振动源。
可选地,所述光源模块还包括用于分别出射位于500nm到1100nm之间的不同波长的至少两种光谱光源;所述处理器还用于:获取至少一帧原始(raw)图像,所述至少一帧原始图像包含所述至少两种光谱光源分别对咖啡颗粒照射时对所述咖啡颗粒所采集的图像的原始像素值;根据所述至少一帧原始图像获取一帧代表色度图;根据所述一帧代表色度图确定所述咖啡颗粒的整体色度值。
本申请第四方面提供一种计算机可读存储介质,其上存储有可执行代码,当所 述可执行代码被咖啡颗粒识别设备执行时,使所述咖啡颗粒识别设备执行如任意一项所述的方法。
在对咖啡颗粒的粒径分析中,保证咖啡颗粒的离散分布时提高测量精准度的前提条件,若较多咖啡颗粒粘连在一起会造成咖啡颗粒的粒径测量结果偏大;本申请实施例中,通过振动源驱动咖啡颗粒进行至少两次振动,来将粘连的咖啡颗粒振散,而且可以改变咖啡颗粒的分布,通过多帧不同分布的咖啡颗粒的识别信息来获取最终识别信息,能够提高对咖啡颗粒的识别准确度。
附图说明
图1是本申请的咖啡颗粒的分析方法的一个实施例的示意图;图2是本申请的咖啡颗粒的粒径分布直方图的一个实施例的示意图;图3是本申请的咖啡颗粒的粒径分布直方图的另一个实施例的示意图;图4是交互界面所显示的咖啡颗粒的最终识别信息中的数量分布直方图的一个示意图;图5和图6分别为咖啡颗粒在不同亮度区域上时的待测图像;图7是本申请的咖啡颗粒的分析方法的一个实施例的示意图;图8是本申请的一个交互界面的示意图;图9为一帧咖啡颗粒的采集图像的示意图;图10是本申请的预设标定色卡的一个实施例的示意图;图11为本申请的咖啡颗粒的分析装置的一个实施例的示例图;图12为本申请的咖啡颗粒的分析设备的一个实施例的示例图;图13是本申请的咖啡颗粒的分析设备的一个实施例中的振动源、承载面和背光光源的结构示意图;图14是图13所示结构的爆炸图;图15是照射光源和背光光源中仅有照射光源打开的情况下感光面阵所采集到的待测图像的一个示意图;图16是照射光源和背光光源同时打开的情况下感光面阵所采集到的待测图像的一个示意图。
具体实施方式
下面将参照附图更详细地描述本申请的实施方式。虽然附图中显示了本申请的实施方式,然而应该理解,可以以各种形式实现本申请而不应被这里阐述的实施方式所限制。相反,提供这些实施方式是为了使本申请更加透彻和完整,并且能够将本申请的范围完整地传达给本领域的技术人员。在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。应当理解,尽管在本申请可能采用术语“第一”、“第二”、“第三”等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。
如图1所示,图1是本申请的咖啡颗粒的分析方法的一个实施例的示意图。该咖啡颗粒的分析方法包括:
步骤S101,控制振动源驱动咖啡颗粒进行至少两次振动,分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集。
可选地,咖啡颗粒可以是指咖啡豆或者咖啡粉末或者其他形状和粒径的咖啡颗粒物体。可选地,本申请的咖啡颗粒的分析方法应用于咖啡颗粒的分析设备中。一个示例中,该咖啡颗粒的分析设备内设置有感光面阵,用于采集包含咖啡颗粒的图像,得到待测图像。感光面阵可以包括电荷耦合元件(Charge-coupled Device,CCD) 或者互补金属氧化物半导体(Complementary Metal Oxide Semiconductor,CMOS)。可选地,在该咖啡颗粒的分析设备内还设置有用于装载咖啡颗粒的承载面。例如,该咖啡颗粒的分析设备内还设置有预设样品盘,该承载面为该预设样品盘的底面。感光面阵具体用于采集位于该预设样品盘内的咖啡颗粒,得到多帧待测图像,所述待测图像集包括该多帧待测图像。可选地,该咖啡颗粒的分析设备内还设置有照射光源,用于在感光面阵对咖啡颗粒进行成像时对该咖啡颗粒照射。
可选地,该承载面背向咖啡颗粒的一侧还设置有振动源,该振动源可以驱动该承载面振动,以驱动承载面上的咖啡颗粒振动,进而改变咖啡颗粒的分布。可选地,在每一次采集咖啡颗粒的一帧待测图像之前,控制振动源驱动所述咖啡颗粒振动。
可选地,该承载面为振动膜,咖啡颗粒承载在该振动膜上,振动源通过驱动该振动膜振动来驱动咖啡颗粒振动。可选地,该振动源为功率放大器,用于发射声波以驱动振动膜振动。或者,该振动源可以是用于发射其他机械波的振动源,例如是水波、绳波等等。或者,该振动源不是通过发射机械波而是通过其他方式(例如机械冲击的方式)来驱动咖啡颗粒振动。一个示例中,振动源为与承载面连接的电磁线圈、电极、气锤、弹簧等,通过对承载面产生冲击,以驱动承载面上的咖啡颗粒振动。一个示例中,该振动源包括具有不同方向的至少两个线性振动源。可以通过控制各线性振动源的横波和纵波的频率,从而控制咖啡颗粒的振动运动方向和分离程度。一个示例中,可以在承载面背面设置多个振动源,以承载面表面中心为中心的笛卡尔坐标系中,该多个振动源可以包括振动方向分别平行于该笛卡尔坐标系中的X、Y、Z坐标轴的三个振动源。一个示例中,也可以在承载面的四个角布置振动方向垂直于承载面的音圈电机,通过控制该音圈电极的振幅和频率,利用共振和相干波的干涉原理达到控制。
在一个示例中,控制振动源以第一驱动方式驱动所述咖啡颗粒振动,得到具有第一分布的咖啡颗粒;对所述具有第一分布的咖啡颗粒采集图像,得到第一待测图像;控制所述振动源以第二驱动方式驱动所述具有第一分布的咖啡颗粒振动,得到具有第二分布的咖啡颗粒;对所述具有第二分布的咖啡颗粒采集图像,得到第二待测图像。第一驱动方式和第二驱动方式可以相同。例如,可以控制振动源以固定的方式多次驱动咖啡颗粒进行振动,在每一次振动停止后采集该次振动后的咖啡颗粒,得多帧具有不同咖啡颗粒分布的待测图像。
或者,第一驱动方式和第二驱动方式可以不同。可选地,第一驱动方式和所述第二驱动方式中的以下至少一项不同:振动频率、振动幅度、振动时间、振动区域。可选地,所述第一驱动方式中的振动频率为共振频率,所述第二驱动方式中的振动频率小于或大于所述共振频率;和/或,所述第一驱动方式中的振动幅度大于所述第二驱动方式中的振动幅度。由于振动源的振动频率为共振频率是能够达到最大或接近最大的振动幅度,采用共振频率或者较大的振动幅度先将咖啡颗粒振动至分离。例如,在第一次对咖啡颗粒采集图像之前,采用共振频率驱动咖啡颗粒振动,能够更好地分离咖啡颗粒,方便采集出的第一待测图像能够更好地测量到咖啡颗粒的粒径。而后在采集第二待测图像之前再用较小的振动幅度来对咖啡颗粒的分布进行微调,利用这样的第一待测图像和第二待测图像能够提高咖啡颗粒的粒径分析地准确度。
可选地,所述第一驱动方式中的振动幅度比所述第二驱动方式中的振动幅度大,且所述第二驱动方式中的振动时间比所述第一驱动方式中的振动时间长。这样,可以以较短的振动时间和较大的振动幅度先将咖啡颗粒完全震开后采集第一待测图像,然后以较长的振动时间和较小的振动幅度来进一步震开咖啡颗粒以及对该咖啡 颗粒的分布进行微调,方便获取到咖啡颗粒更多的粒径信息。例如,第一驱动方式中的振动时间可以是0.1s~0.5s中的一个时长,第二驱动方式中的振动时间可以是0.1s~1s中比第一驱动方式中的振动时间长的一个时长。或者,可选地,第二驱动方式中的振动时间和第一驱动方式中的振动时间也可以相同,或者第二驱动方式中的振动时间比所述第一驱动方式中的振动时间短。
可选地,在控制所述振动源以第二驱动方式驱动所述具有第一分布的咖啡颗粒振动之后,还控制所述振动源至少一次以所述第二驱动方式驱动所述咖啡颗粒振动;以及分别对每一次以所述第二驱动方式驱动后的所述咖啡颗粒采集图像,得到至少一帧待测图像。或者,也可以在振动源以第二驱动方式驱动咖啡颗粒的过程中,在不停止振动源对咖啡颗粒的驱动的情况下持续每隔预设时间对咖啡颗粒采集图像,得到多帧待测图像。
步骤S102,分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息。
可选地,该初始识别信息包括咖啡颗粒的粒径、数量、面积、体积、质量中的至少一项。可选地,该初始识别信息还包括咖啡颗粒的粒径、数量、面积、体积、质量中的至少一项的分布。
其中,获取咖啡颗粒的粒径的方法有多种。例如,检测待测图像中咖啡粉颗粒所占面积的大小,将该面积等效出具有相同面积的圆的直径,并将该直径作为咖啡粉颗粒的初始粒径。现有技术中对咖啡粉粒径的分析绝大部分使用筛粉法或激光散射法,筛粉法方法低成本但工作效率较低,激光散射法工作效率较高,但是价格昂贵。相比这两种方法,图像分析法具有识别速度快、分析效率高、成本较低等优点。
其中,在检测咖啡颗粒的面积时,可以通过机器学习方法来对待测图像中的咖啡颗粒的大小进行识别,并借助对咖啡颗粒的粘连和未粘连情况的标注,和/或借助对咖啡颗粒中的银皮的标注,来提高对咖啡颗粒的大小的识别效率和识别精度。其中,咖啡颗粒的体积可以根据咖啡颗粒的粒径和/或面积进行计算。咖啡颗粒的质量可以根据咖啡颗粒的体积和预设有咖啡颗粒的密度进行计算。
可选地,所述初始识别信息还包括咖啡颗粒在不同的粒径区间内的分布信息。该咖啡颗咖啡颗粒在不同的粒径区间内的分布信息分布信息可以包括咖啡颗粒在不同的粒径区间内的数量分布、面积分布、体积分布、质量分布和/或色度分布等等。例如,预先设置有200um-300um、300um-425um、425um-600um、600um-850um、850um-1180um、1180um-1400um、1400um-1700um,1700um-2360um、2360um-2500um这9个粒径区间。当然,预设粒径区间的数量和每个区间的长度大小可以有其他设置方式,在此不作限制。确定待测图像中各咖啡颗粒的粒径之后,咖啡颗粒在多个预设粒径区间内的数量分布可以是在每个预设粒径区间内的数量总和,或者是在每个预设粒径区间内的数量总和与所有预设粒径区间内的数量总和的比例。同理,咖啡颗粒在多个预设粒径区间内的面积/体积/质量分布可以是在每个预设粒径区间内的面积/体积/质量总和,或者是在每个预设粒径区间内的面积/体积/质量总和与所有预设粒径区间内的面积/体积/质量总和的比例。咖啡颗粒在多个预设粒径区间内的色度分布可以是在每个预设粒径区间内的色度值的平均值或中位线。
如图2所示,图2是本申请的咖啡颗粒的粒径分布直方图的一个实施例的示意图。该直方图中每个方块对应一个预设粒径区间,该直方图中的横坐标表示该预设粒径区间所对应的粒径大小,纵坐标表示该预设粒径区间中的咖啡颗粒的个数与所有预设粒径区间的总个数的比值。
如图3所示,图3是本申请的咖啡颗粒的粒径分布直方图的另一个实施例的示 意图。该直方图中每个方块对应一个预设粒径区间,该直方图中的横坐标表示该预设粒径区间所对应的粒径大小,纵坐标表示该预设粒径区间中的咖啡颗粒的面积总和与所有预设粒径区间内的咖啡颗粒的总面积的比例。
一个示例中,所述初始识别信息还包括极小咖啡颗粒的数量、面积、体积、质量中的至少一项。所述极小咖啡颗粒为粒径小于第一预设粒径的咖啡颗粒,或者为粒径小于第一预设粒径且大于预设临界值的咖啡颗粒。其中,所述第一预设粒径的取值小于所述多个预设粒径区间中的粒径的取值。例如,该极小咖啡颗粒为粒径小于200um的咖啡颗粒。在咖啡研磨过程中,颗粒大小的不同取决于不同冲煮方式的需求,但一般希望得到均匀度较高的咖啡颗粒,而该极小咖啡颗粒为在研磨过程中所产生的在期望粒径区间之外的颗粒,获取该极小咖啡颗粒的信息可以为用户提供研磨效果的参考;例如,若极小咖啡颗粒的数量或面积超过一定数值,或者数量比例或面积比例超过一定数值时,意味着研磨效果不佳。
可选地,所述初始识别信息还包括所述极小咖啡颗粒在所有咖啡颗粒中的占比信息。该占比信息可以是极小咖啡颗粒的总数量或者总面积或者总体积或者总质量分别在所有咖啡颗粒中的总数量或者总面积或者总体积或者总质量的占比。
可选地,在获取待测图像的咖啡颗粒的初始识别信息之前,还确定咖啡颗粒是咖啡粉还是咖啡豆。具体的,可通过用户输入确定咖啡颗粒是咖啡粉还是咖啡豆,或者通过对待测图像分析来确定咖啡颗粒是咖啡粉还是咖啡豆,例如可通过获取待测图像的梯度,根据梯度的分类结果来确定咖啡颗粒是咖啡粉还是咖啡豆。
步骤S103,根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息。
例如,可通过对待测图像集中的所有帧待测图像的咖啡颗粒的初始识别信息进行加权平均求和,得到咖啡颗粒的最终粒径信息。这样可以减少测量误差,提高测量精度。可选地,还判断待测图像集中的每一帧待测图像是否有效,可仅根据有效的待测图像的咖啡颗粒的初始识别信息来获取咖啡颗粒的最终识别信息。其中,确定待测图像中是否有效的方式有多种。一个示例中,待测图像中出现咖啡颗粒粘连情况严重时确定为无效。例如,检测待测图像中咖啡粉颗粒的面积的大小,若出现咖啡颗粒的面积超过第一阈值,或者面积超过第二阈值的咖啡颗粒的数量占比或面积占比超过预设占比时,确定该帧待测图像无效。该第一阈值和第二阈值可以相同或者不同。
在对待测图像集中的至少部分帧待测图像的咖啡颗粒的初始识别信息进行加权平均求和时,获取该至少部分帧待测图像中的每一帧待测图像分别在多个不同粒径区间内的分布信息,对该分布信息加权平均求和。具体的,对每一个粒径区间,获取多帧待测图像的数量、面积、体积、质量中的至少一项,对同类项进行加权平均求和。或者,对极小咖啡颗粒,获取多帧待测图像中的极小咖啡颗粒的数量、面积、体积、质量中的至少一项,对同类项进行加权平均求和。
可选地,各帧待测图像的加权值相同,对该多帧待测图像的同类项进行平均求和。可选地,还可以获取每个粒径区间内的总数量占所有粒径区间内的总数量的比例,或者每个粒径区间内的总面积占所有粒径区间内的总面积的比例,或者每个粒径区间内的总体积占所有粒径区间内的总体积的比例,或者每个粒径区间内的总质量占所有粒径区间内的总质量的比例。
可选地,还通过交互界面显示咖啡颗粒的最终识别信息。如图4所示,图4是交互界面所显示的咖啡颗粒的最终识别信息中的数量分布直方图的一个示意图。该最终识别信息包括咖啡颗粒分别在9个预设的粒径区间内的总数量占所有粒径区间 内的总数量的比例。其中,该9个预设的粒径区间分别为200um-300um、300um-425um、425um-600um、600um-850um、850um-1180um、1180um-1400um、1400um-1700um,1700um-2360um、2360um-2500um这9个粒径区间。图4中的x轴上分别为该9个粒径区间的中位数,y轴表示每个粒径区间内的数量占所有粒径区间内的总数量的比例。
可选地,还通过交互界面显示咖啡颗粒的中值粒径所在的粒径区间。该中值粒径指的是咖啡颗粒的累积粒径分布百分数达到50%时所对应的粒径,其物理意义是粒径大于中值粒径的颗粒占50%,小于中值粒径的颗粒也占50%。如图4所示,例如,中值粒径落在600um-850um的粒径区间内,通过将该粒径区间内的数量比例显示为与其他器件的数量比例显示具有不同颜色或图案,以指示中值粒径落在该粒径区间内。
在对咖啡颗粒的粒径分析中,保证咖啡颗粒的离散分布时提高测量精准度的前提条件,若较多咖啡颗粒粘连在一起会造成咖啡颗粒的粒径测量结果偏大。本申请实施例中,通过振动源驱动咖啡颗粒进行至少两次振动,来将粘连的咖啡颗粒振散,而且可以改变咖啡颗粒的分布,通过多帧不同分布的咖啡颗粒的识别信息来获取最终识别信息,能够提高对咖啡颗粒的识别准确度。
在一些示例中,在控制振动源驱动咖啡颗粒的多次振动中,至少一次驱动的驱动方式是根据该次驱动的最近一次或多次采集到的图像来确定的。例如,所述第二驱动方式是根据所述第一待测图像确定的。例如,获取所述第一待测图像中的咖啡颗粒的粘连程度,以及根据所述粘连程度确定所述第二驱动方式中的振动频率、振动幅度、振动时间或振动区域中的至少一项。
其中,所述粘连程度是根据所述第一待测图像中的咖啡颗粒的数量和/或面积确定的。例如,对第一待测图像中的部分区域或者全部区域,检测该区域中咖啡颗粒的数量和总面积,当该区域中的总面积与数量的比值超过位于不同的范围时对应不同的粘连程度;或者,检测该区域各咖啡颗粒的面积,当出现面积大于预设面积或者大于预设面积的咖啡颗粒的数量位于不同的范围时对应不同的粘连程度。可选地,不同的粘连程度对应着不同的振动频率,或对应着不同的振动幅度,或对应不同的振动时间,确定第一待测图像中的咖啡颗粒的粘连程度后,根据该粘连程度采用相应的振动频率、振动幅度或振动时间来作为第二驱动方式中的振动频率、振动幅度或振动时间。在振动源可以分区域驱动振动的示例中,还可以针对每个区域上的咖啡颗粒的粘连程度确定该区域对应的振动频率、振动幅度或振动时间。
可选地,对粘连程度比较高的区域,第二驱动方式相比第一驱动方式的振动频率、振动幅度、振动时间中的至少一项更高。可选地,可仅对其中一项提高,其他项可采用默认值。例如,在根据第一待测图像确定第二驱动方式时,振动频率和振动幅度均采用默认值,根据第一待测图像中咖啡颗粒的粘连程度确定振动时间。
可选地,第一待测图像按预设方式固定划分为多个区域,例如被均匀划分为四个区域。该区域的划分方式可以和振动源控制精度配合,使得振动源能够分别对不同的区域进行振动,例如可通过多个振动源分别对不同区域振动,或者通过移动振动源的振动位置来改变区域振动。对第一待测图像中的每个区域可按上述方式确定该区域的黏连程度。可将黏连程度高于预设程度的区域作为第二驱动方式中的振动区域。或者,可选地,第一待测图像也可以不是按预设方式固定划分为多个区域,在振动源可以控制驱动位置的示例中,在检测出咖啡颗粒粘连程度高于预设程度的位置后,振动源可以以该位置作为振动区域的中心进行驱动。
在一些示例中,获取所述第一待测图像中的咖啡颗粒的粘连程度,以及根据所 述粘连程度确定第二驱动方式中的振动频率。可以根据咖啡颗粒的粘连程度来确定出第一待测图像中的黏连情况,以确定采用相应的振动频率,例如粘连程度越高时采用的振动频率越高。
在一些示例中,所述待测图像的咖啡颗粒的初始识别信息包括咖啡颗粒的数量。在获取到待测图像的咖啡颗粒的初始识别信息后,根据所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中所述咖啡颗粒的数量确定所述咖啡颗粒的数量变化信息,以及根据所述数量变化信息确定所述振动源在所述第二待测图像之后的驱动方式。可选地,当所述数量变化信息指示在连续预设帧待测图像内,各待测图像中的咖啡颗粒的数量下降或者数量变化的绝对值小于阈值时,停止所述振动源对所述咖啡颗粒的下一次驱动或者以振动幅度小于预设振动幅度、振动频率小于预设振动频率或者振动时间小于预设振动时间的驱动方式来驱动咖啡颗粒振动。或者,当所述数量变化信息指示在连续预设帧待测图像内,各待测图像中的咖啡颗粒的数量上升且变化数值大于所述阈值时,以振动幅度大于预设振动幅度、振动频率大于预设振动频率或者振动时间大于预设振动时间的驱动方式来驱动咖啡颗粒振动。
在一个具体实施例中,振动源可以仅设置有不同的第一驱动方方式和第二驱动方式,其中所述第一驱动方式中的振动频率为共振频率,所述第二驱动方式中的振动频率小于或大于所述共振频率;和/或,所述第一驱动方式中的振动幅度大于所述第二驱动方式中的振动幅度。在对咖啡颗粒首次采集待测图像之前,通过第一驱动方式驱动咖啡颗粒振动,以将咖啡颗粒震散。首次采集待测图像后,可以在接下来至少两次采集待测图像之前还继续以第一驱动方式驱动咖啡颗粒振动。或者,也可以在接下来至少两次采集待测图像之前以第二驱动方式驱动咖啡颗粒振动。在获取到至少三帧待测图像之后,根据每一帧待测图像的咖啡颗粒的数量确认咖啡颗粒的数量变化。当在连续预设帧待测图像内,各待测图像中的咖啡颗粒的数量下降或者数量变化的绝对值小于阈值时,停止所述振动源对所述咖啡颗粒的下一次驱动或者以所述第二驱动方式继续对所述咖啡颗粒的下一次驱动。或者,当所述数量变化为数量上升且变化数值大于所述阈值时,以所述第一驱动方式继续对所述咖啡颗粒的下一次驱动。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径。而且,在步骤S103之前,还获取畸变函数,所述畸变函数用于指示多个像素位置处的粒径补偿值;对所述待测图像集中的待测图像的至少部分咖啡颗粒的粒径,根据所述咖啡颗粒的像素位置和对应的粒径补偿值进行畸变校正,得到咖啡颗粒的畸变校正后的粒径。在步骤S103中,具体根据所述待测图像集中至少部分帧待测图像的所述咖啡颗粒的畸变校正后的粒径确定所述咖啡颗粒的最终识别信息。由于相机的成像畸变,会导致对边缘的咖啡颗粒的粒径测量误差,通过畸变函数的校正可以减少该误差。其中,畸变函数可通过对设备出厂前都标定获取到并存储好。可选地,在标定过程中,可采用咖啡颗粒的分析设备中的感光面阵对一棋盘格图案进行成像,由此拟合得到各像素位置的畸变系数,也即畸变函数。
可选地,该畸变函数为像素位置与图像中心位置之间的距离,和该像素位置处的真实粒径与计算粒径之间的差值的关系曲线。在粒径分析中,得到咖啡颗粒的像素位置与图像中心位置之间的距离后,根据此距离和畸变函数,可以得到计算粒径与真实粒径之间的差值,将此差值补偿到计算粒径上,就可以校正畸变,得到更为精准的粒径结果。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;在步骤S103 之前,还获取粒径补偿函数,所述粒径补偿函数用于指示在多个亮度下的粒径补偿值。另外,还分别获取所述待测图像集中至少部分帧待测图像中咖啡颗粒所在区域的亮度。对所述至少部分帧待测图像,根据所述待测图像中的咖啡颗粒所在区域的亮度和所述粒径补偿值对所述待测图像中的咖啡颗粒的粒径进行补偿,得到咖啡颗粒的补偿后的粒径。在步骤S103中,具体根据所述待测图像集中至少部分帧待测图像的所述咖啡颗粒的补偿后的粒径确定所述咖啡颗粒的最终识别信息。在粒径分析中,由于照射光源的不均匀或承载面的不同背景,可能造成不同区域的亮度不同。而亮度不同可能会导致对同一咖啡颗粒的粒径计算结果不一致。
例如如图5和图6所示,图5和图6分别为咖啡颗粒在不同亮度区域上时的待测图像。在图5中,咖啡颗粒位于亮度适中的区域701中,咖啡颗粒的边缘比较清晰。而在图6中,咖啡颗粒位于亮度过亮的区域601中,可能会导致咖啡颗粒的边缘过曝,在待测图像中表现为咖啡颗粒的边缘被腐蚀,造成粒径分析的测量误差。因此,通过在出厂前的标定过程中,对不同亮度区域的同一咖啡颗粒的粒径分析,可得到不同亮度对咖啡颗粒的粒径计算的影响并存储好。在实际粒径分析中对不同亮度区域的咖啡颗粒的粒径进行补偿校准,提高测量精度。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径。本申请的咖啡颗粒的分析方法还包括:进入标定模式,其中,在所述标定模式中:对位于视场范围内预设位置处的、具有预设面积的标定图案采集图像,得到标定图像;获取所述标定图案所对应的像素数量;根据所述预设面积和所述像素数量确定一个像素所对应的标定尺寸。在步骤S102中确定咖啡颗粒的粒径时,分别获取所述待测图像集中的待测图像的咖啡颗粒的像素数量;根据所述标定尺寸和所述像素数来确定所述咖啡颗粒的粒径。
实际应用中,可以在用户的触发下进入标定模式,或者可以是默认每隔一段时间自动进入标定模式获取最新的标定尺寸,或者也可以由用用户设置如何触发标定模式。
一些示例中,本申请的咖啡颗粒的分析方法不仅包括分析咖啡颗粒的数量、粒径、面积、体积或者质量等等,还可以包括分析咖啡颗粒的色度。如图7所示,图7所示,图7是本申请的咖啡颗粒的分析方法的一个实施例的示意图。可选地,本实施例中的咖啡颗粒的色度分析方法包括:
步骤S701,获取至少一帧原始(raw)图像,所述至少一帧原始图像包含至少一种光源分别对咖啡颗粒照射时对所述咖啡颗粒所采集的图像的原始像素值。
可选地,所述至少一种光源包含出射光谱包含850nm的波长的光源。可选地,该至少一种光源均不同于上述所描述的咖啡颗粒的分析设备内的照射光源。为方便区分该至少一种光源和照射光源,下文中称该至少一种光源为光谱光源。
可选地,咖啡颗粒可以是指咖啡豆或者咖啡粉末或者其他形状和尺寸的咖啡颗粒物体。一个示例中,该咖啡颗粒的分析设备内仅设置有具有一种光谱光源。一个示例中,该咖啡颗粒的分析设备内设置有具有不同出射光谱的至少两种光谱光源。可选的,该至少两种光谱光源分别用于出射500nm到1100nm之间的不同波段的光束。经实验发现,咖啡颗粒对该范围内的光谱的反射更有利于计算咖啡颗粒的色度值。例如,咖啡颗粒的分析设备内设有出射光谱分别包含520nm、600nm、640nm、850nm、940nm、1100nm这六种波长的六种光谱光源中的至少部分光谱光源。由于同一烘焙色度的咖啡颗粒对不同光谱的光束的反射率不同,通过对不同光谱的多个光谱光源分别对咖啡颗粒照射的反射光形成不同原始图像,并利用算法融合不同光谱的光谱光源对应的原始图像来确定咖啡颗粒的色度值,可以有效避免利用单一光 谱采集带来的色度值检测结果稳定性较差的问题。
在咖啡颗粒的分析设备内设有一种光谱光源的示例中,咖啡颗粒的分析设备中的感光面阵用于在该光谱光源对咖啡颗粒照射时对所述咖啡颗粒采集图像,得到至少一帧初始原始图像。在咖啡颗粒的分析设备内设有n种光谱光源的示例中,n大于或等于2,该n种光谱光源分别用于在不同时刻对咖啡颗粒进行照射,该图像采集模块用于在每一种光谱光源对咖啡颗粒照射时对所述咖啡颗粒采集图像,得到至少n帧初始原始图像,其中该n帧的每帧初始原始图像对应一种光谱光源。
其中,对应每一种光谱光源的一帧原始图像,可以是在该光谱光源对咖啡颗粒照射时图像采集模块采集到的一帧初始原始图像,也可以是该光谱光源对咖啡颗粒照射时图像采集模块采集到的多帧初始原始图像进行融合得到的一帧原始图像。
其中,初始原始图像包括各像素位置的原始像素值,也称原始(raw)数据,该原始数据指的是由图像采集模块对咖啡颗粒采集图像是将光信号转换为电信号时的电平高低的原始记录,是没有经过处理的原始数据。原始数据在输出时一般按一定的顺序输出,例如按GRBG、RGGB、BGGR或者GBRG的顺序输出,其中R表示红色,G表示绿色,B表示蓝色。原始数据常见的格式有三种:raw8、raw10、raw12,分别表示一个像素点有8bit、10bit、12bit数据。
步骤S702,根据所述至少一帧原始图像获取一帧代表色度图。
步骤S102,根据所述至少一帧原始图像获取一帧代表色度图。
其中,代表色度图中的各像素位置上的色度值可以有多种,例如,该色度值具体可以是咖啡颗粒的烘焙度指标“艾格壮数值(Agtron)”或者其他可以反映咖啡颗粒的色度的数值。
根据所述至少一帧原始图像获取一帧代表色度图的方法有多种。在仅有一种出射光谱的光谱光源,也即该至少一帧原始图像具体为一帧原始图像的示例中,获取基函数,该基函数可以是预存储好的,该基函数为在该光谱光源的照射下所采集到的原始像素值和对应的色度值之间的函数;根据所述原始图像中的原始像素值和对应的所述基函数获取对应的色度值,得到所述原始图像对应的色度图。
在对应具有不同出射光谱的n种光谱光源,n大于或等于2,也即该至少一帧原始图像具体为n帧原始图像的示例中,可以通过线性模型方法获取一帧代表色度图。
在线性模型方法中,例如可以先将该n帧原始图像融合成一帧原始图像,然后再根据融合得到的一帧原始图像来获取对应的色度图。可选地,还可以获取所述n种光谱光源的权重,该n帧原始图像可以是该n种光谱光源的权重融合成一帧原始图像,例如通过加权求和的方式融合成一帧原始图像。或者,在线性模型方法中,可以先根据该n帧原始图像分别生成对应的色度图,得到n帧色度图,然后再将该n帧色度图融合成一帧代表色度图。可选地,还可以获取所述n种光谱光源的权重,根据所述n种光谱光源的权重和所述n帧色度图生成所述一帧代表色度图,例如通过加权求和的方式融合成一帧代表色度图。
例如,在一个示例中,设置有具有不同出射光谱的5种光谱光源,分别对应的权重为a1、a2、a3、a4和a5,对应该5种光谱光源获取到5帧色度图。对于该5个色度图上同一个像素位置处的色度值分别为Ag1、Ag2、Ag3、Ag4和Ag5,则该像素位置处的代表色度值=a1*Ag1+a2*Ag2+a3*Ag3+a4*Ag4+a5*Ag5。
其中,根据所述n帧原始图像分别生成对应的n帧色度图的方法有多种。例如,对于第k种光谱光源,获取所述第k种光谱光源对应的基函数,所述基函数为在所述第k种光谱光源的照射下所采集到的原始像素值和对应的色度值之间的关系函数, k为1到n中的任意一个整数。获取第k帧原始图像中的原始像素值,所述第k帧原始图像是所述咖啡颗粒在所述第k种光谱光源的照射下时所采集到的原始图像。根据所述第k帧原始图像中的原始像素值和所述第k种光谱光源对应的基函数获取对应的色度值,得到所述第k帧原始图像对应的色度图。
步骤S703,根据所述一帧代表色度图确定所述咖啡颗粒的整体色度值。
可选地,根据该帧代表色度图获取对应的代表色度分布,该代表色度分布包括不同代表色度值的像素个数与总像素个数的占比。可选地,将占比最高的代表色度值作为咖啡颗粒的整体色度值,或者将占比大于预设阈值的多个代表色度值的加权平均值作为咖啡颗粒的整体色度值,或者将代表色度分布中的平均值或者中位数作为咖啡颗粒的整体色度值。其中,在采用对占比高于预设阈值的多个色度值进行加权平均时,各色度值的权重可以根据其占比确定。例如,占比越高的色度值的权重越大。
相比现有技术通过感光面阵输出的灰度图来计算色度值,本申请实施例中获取感光面阵所采集的原始图像,该原始图像的精度要远远高于灰度图的精度,一般灰度图的数值范围是0到255,但原始图像的数值上限可达三四千甚至更高,通过该原始图像直接计算色度值能够大大提高色度值的精度,而且无需和灰度图的灰度值进行转换,能够提高色度值的精度。
一些示例中,在获取到至少一帧原始图像的代表色度图和咖啡颗粒的整体色度值之后,还在交互界面上显示该整体色度值。可选地,还在交互界面上显示所述代表色度分布。如图8所示,图8是本申请的一个交互界面的示意图。交互界面上显示有代表色度分布,具体为通过色度直方图形式显示不同的代表色度值区间中的像素面积总和或者像素面积总和与总面积的占比。另外还在交互界面上显示有整体色度值,具体为AG 73.2。可选地交互界面还通过在色度直方图中将整体色度值所在的代表色度值区间高亮,以表明整体色度值落在该代表色度值区间内。
在步骤S702中,不同光谱的光谱光源的基函数可通过标定获取到,并预先存储,在计算时直接读取预先存储的权重来进行计算。标定的方法有多种,例如,对于其中的第一光谱光源,可通过该第一光谱光源分别对多种具有不同色度值的预设色卡照射,获取到每一种所述预设色卡对应的原始像素值,由于每一种预设色卡的色度值是已知的,通过所述多种预设色卡的色度值和分别对应的所述原始像素值可以拟合得到该第一光谱光源对应的基函数。其他光谱光源的基函数的标定方法可以和该第一光谱光源的基函数的标定方法类似。
可选地,在获取每个光谱光源的基函数时,还根据所述多种预设色卡的色度值和分别对应的所述原始像素值之间的线性相关程度来确定该光谱光源的权重。可选地,在设置不同光谱的光谱光源的权重时,raw数据和色度值之间的线性相关程度越高的光谱光谱光源所对应的权重可以更高。可选地,所述n种光谱光源包括第一光谱光源和第二光谱光源,其中所述第一光谱光源的出射光谱包含850nm的波长,所述第二光谱光源的出射光谱的主波长为850nm以外的其他波长;其中,所述第一光谱光源的权重高于所述第二光谱光源的权重。经过发明人的多次实验,发现波长为850nm的光谱光源照射咖啡颗粒得到的原始数据和色度值之间的线性相关程度最高,将第一光谱光源的权重设置最高有利于提高计算的准确度。
由于红外光谱对浅色物体的测量比较敏感,在浅色物体的颜色发生微小变化时,成像得到的raw数据就会出现巨大变动,导致仅用红外光谱的光谱光源对咖啡颗粒的成像数据来获取的色度值的准确度很低。本申请实施例中,通过采用不同光谱的光谱光源来对咖啡颗粒成像获取原始图像,能够提供更多维度的信息来计算咖啡颗 粒的色度值,提高色度值的计算准确度。
可选地,在步骤S702中,还可以通过其他方法来根据所述至少一帧原始图像获取一帧代表色度图。例如通过高斯混合模型方法来获取该代表色度图。在该高斯混合模型方法中,高斯混合模型可以是预先存储好在该咖啡颗粒的分析设备内,通过读取存储的方式来获取高斯混合模型。该混合高斯模型包含已知的m个高斯模型的概率密度函数以及未知的所述m个高斯模型的权重,所述m个高斯模型分别为m种预设色卡中每一种预设色卡在所述n种光谱光源的照射下采集到的原始像素值的n维高斯分布,m为大于或等于2的整数。例如,m为10、12、13、15等等整数。
例如,该高斯混合模型可以是
其中,πk代表第k个高斯模型的权重,N(x|μk,∑k)代表第k个高斯模型的概率密度函数,x代表原始像素值,p(x)表示原始图像中的原始像素值的高斯分布。在该模型中,N(x|μk,∑k)为已知的。该N(x|μk,∑k)可以通过标定获得,在该标定中,采用所述n中光谱光源分别对所述m种预设色卡照射采集raw数据,根据该raw数据获取高斯分布并存储。
在获取到n帧原始图像后,还根据所述n帧原始图像获取第一像素位置的原始像素值的高斯分布,以及根据所述第一像素位置的原始像素值的高斯分布和所述混合高斯模型,获取所述m个高斯模型的权重的取值。例如,对第一像素位置,获取第一像素位置在所述n帧原始图像中的n个原始像素值组成的n维向量作为x,以该n个原始像素值的高斯分布作为p(x)代入上述高斯混合模型中,由于N(x|μk,∑k)为已知的,可以根据该高斯分布p(x)和N(x|μk,∑k)得到该第一像素位置处对应的该m个高斯模型的权重的取值πk
根据所述第一像素位置处对应的m个高斯分布的权重的取值,以及所述m种预设色卡的色度值,获取所述第一像素位置处的代表色度值。例如,可根据如下公式来计算该第一像素位置处的代表色度值:
其中,Ak代表第k个高斯模型所对应的预设色卡的色度值,各预设色卡的色度值分别为已知的。将πk代入上述公式后,可得到该第一像素位置出的代表色度值Ak
以此类推,分别计算多个像素位置处的代表色度值,得到代表色度图。
一些示例中,也可以是将所述n帧原始图像发送至服务器,以便所述服务器根据所述n帧原始图像和预设混合高斯模型生成所述n帧原始图像对应的一帧代表色度图,然后接收所述服务器发送的所述一帧代表色度图。其中所述飞去根据所述n帧原始图像和预设混合高斯模型生成所述n帧原始图像对应的一帧代表色度图的方法可参考上述描述,在此不再赘述。由于将运算移到服务器上,可以降低咖啡颗粒的分析设备的算力成本,同时保持色度值计算的准确度。
实际应用中,发明人发现,具体为AG值的色度值在大于预设阈值时,色度值和原始像素值之间的关系具有明显的非线性关系,在线性模型方法中,可以通过对不同波长的色度响应的加权平均来补偿该线性变化,提高色度值计算的准确度。其中,该预设阈值为位于95~105之间的艾格壮数值,例如为AG 100。具体为AG值的色度值在大于预设阈值时,不同波长下不同AG值的原始像素值的分布耦合度较 高,使用在混合高斯模型拟合可以较好的分辨各个分布。因此,可选地,在根据n帧原始图像获取一帧代表色度图时,根据所述n帧原始图像分别生成对应的n帧色度图;当所述n帧色度图中色度值大于预设阈值的面积大于预设面积时,或者,当所述n帧色度图中色度值大于预设阈值的面积的比重大于预设比重时,根据所述混合高斯模型方法获取所述一帧代表色度图。可选地,当所述n帧色度图中色度值大于预设阈值的面积不大于预设面积时,或者,当所述n帧色度图中色度值大于预设阈值的面积的比重不大于预设比重时,根据所述线性模型方法获取所述一帧代表色度图。
可选地,一些示例中,本申请的咖啡颗粒的色度分析方法中还包括:进入自动标定模式,在所述自动标定模式中:获取至少一帧标定用原始图像,所述至少一帧标定用原始图像包含至少一种光谱光源分别对位于预设位置处的预设标定色卡照射时对所述预设标定色卡所采集的图像的原始像素值;根据所述至少一帧标定用原始图像中的原始像素值计算所述预设标定色卡的色度值;根据所述预设标定色卡计算出的色度值和所述预设标定色卡的实际色度值计算色度补偿值。
其中,位于预设位置出的预设标定色卡,可以是指由用户将预设标定色卡放置在承载面上,然后启动光谱光源和图像采集模块来对该预设标定色达采集图像。或者,也可以是该预设标定色卡固定在咖啡颗粒的分析设备内,且固定在图像采集模块的视场范围内除承载面以外的位置处,例如固定在咖啡颗粒的分析设备的内壁上,以同时位于图像采集模块的视场范围内又不对承载面遮挡。在进入自动标定模式后,通过所采集到的原始图像中对应该预设标定色卡的图像区域来获取色度补偿值。又或者,该预设标定色卡固定在咖啡颗粒的分析设备内,且固定在图像采集模块的视场范围外;咖啡颗粒的分析设备内还设置有机械模块,用于在进入自动标定模式后,讲该预设标定色卡移动到图像采集模块的视场范围内,以便图像采集模块对该预设标定色卡采集原始图像。
可选地,上述描述的具有预设面积的标定图案可以位于该预设标定色卡上。如图10所示,图10是本申请的预设标定色卡的一个实施例的示意图。该预设标定色卡具有已知的色度值,且该预设标定色卡上设置有预设面积的标定图案(图10中以圆形为例示意)。这样,在采集到该预设标定色卡的图像之后,可以还利用上面的圆形来确定一个像素所对应的标定尺寸。
在实际应用中,由于产品的光谱光源使用损耗或者其他原因,会导致最终计算出的色度值和实际色度值有所出入。因此,通过自动标定模式获取到色度补偿值,在计算咖啡颗粒度的色度值时将该色度补偿值补偿到计算出的咖啡颗粒的色度值中,提高计算准确度。具体的,在步骤S702中,具体根据所述至少一帧原始图像获取一帧初始代表色度图;该获取初始代表色度图的方式可以和上文中所描述的获取代表色度图的方法一样。然后根据所述咖啡颗粒的初始代表色度图中的色度值和所述色度补偿值确定所述咖啡颗粒的代表色度图。例如,给初始代表色度图中每个像素位置的初始代表色度值加上或减去该色度补偿值,得到每个像素位置的代表色度值,也即代表色度图。
实际应用中,由于咖啡颗粒可能未能占满整个原始图像,存在一些非对应咖啡颗粒的像素。若在计算咖啡颗粒的色度值也根据该非对应咖啡颗粒的像素来计算,会降低咖啡颗粒的色度值的计算准确度。如图9所示,图9为一帧咖啡颗粒的采集图像的示意图。在该采集图像中,可以看到对应承载面的部分像素区域91。因此,可选地,步骤S701中获取至少一帧原始图像时,获取至少一帧初始原始图像,根据该至少一帧初始原始图像确定所述至少一帧原始图像。具体的,在获取到初始原 始图像后,可从该初始原始图像中确定无效像素值,所述无效像素值为所述初始原始图像中对应所述咖啡颗粒以外的其他物体的像素值;将所述至少一帧初始原始图像中的所述无效像素值去除,得到所述至少一帧原始图像。这样后续步骤S702中根据所述至少一帧原始图像得到的代表色度图能够更准确反映咖啡颗粒的色度值。
确定初始原始图像中的有效像素值或者非有效像素值的方式有多种。可选地,在原始图像为对装在在承载面上的咖啡颗粒进行成像的示例中,由于咖啡颗粒未能铺满承载面而导致原始图像中存在对应承载面底面的非有效像素值。这些非有效像素值的存在会影响对咖啡颗粒的色度值的测量。可通过将该承载面设置成具有与咖啡颗粒的颜色差距较大的颜色(例如白色)或者设置成具有与咖啡颗粒的表面纹理差距较大的纹理,或者设置成具有易识别的图案,这样,可通过原始图像的颜色、纹理或图案的识别,确认出非有效像素值。或者,也不需要去识别原始图像的颜色、纹理或图案,由于咖啡颗粒的相似性导致有效像素值具有一定的共性,且与非有效像素值的差异较大,可通过各像素位置上的raw数据的差异度和/或相似度可识别出有效像素值或非有效像素值。
一些示例中,步骤S701中获取至少一帧原始图像时,具体获取至少一帧初始原始图像;获取至少一帧初始原始图像;获取亮度补偿函数;根据所述亮度补偿函数和所述初始原始图像中的像素位置,确定所述像素位置的原始像素补偿值;根据所述像素位置的原始像素补偿值对所述至少一帧初始原始图像中的所述像素位置的原始像素值进行补偿,得到所述至少一帧原始图像。
在色度分析,由于光谱光源的不均匀,可能造成不同区域的亮度不同,继而造成亮度不同的区域中具有相同色度值的区域具有不同的原始像素值,导致分析误差。因此,通过咖啡颗粒的色度分析设备在出厂前的标定过程中,对整个视野范围内的色度分布均匀单一的样品咖啡颗粒的分析,可得到不同像素位置(对应不同亮度)的原始像素值分布,继而计算出不同像素位置下的原始像素补偿值,也即亮度补偿函数。例如,该亮度补偿函数可以是像素位置与图像中心位置的距离,与原始像素补偿值的关系。这样,在算法中对不同区域的像素点的亮度进行补偿校准,可以提高色度分析的测量精度。
可选地,一些示例中,承载面具体为预设样品盘的底面,通过将预设样品盘档深度设置为能够使得该预设样品盘中承载至少两层咖啡颗粒,以避免对咖啡颗粒进行成像时该预设样品盘的底面出现在原始图像中。
可选地,步骤S701中根据该至少一帧初始原始图像确定所述至少一帧原始图像时,还可以包括获取所述咖啡颗粒与所述图像采集模块的距离分布,根据所述距离分布对所述至少一帧初始原始图像中的像素值进行补偿,得到所述至少一帧原始图像。
实际应用中,图像采集模块在对咖啡颗粒进行成像时,该图像采集模块和咖啡颗粒的距离不同,得到的原始图像中的raw数据也会有些差异,这些差异会导致对原始图像中的不同咖啡颗粒的色度值的测量基准不统一而导致测量结果出现偏差。通过根据所述距离分布对所述至少一帧原始图像中的像素值进行补偿,根据补偿后的所述至少一帧原始图像来进行计算,能够进一步提高咖啡颗粒的色度值的准确度。
其中,获取所述咖啡颗粒与图像采集模块的距离分布的方法有多种。一些示例中,控制测距模块向所述咖啡颗粒发射光束以及接收所述咖啡颗粒反射回的回光,根据所述发射光束和所述回光获取所述咖啡颗粒与图像采集模块的距离分布。其中,原始图像被划分为至少一个区域,该距离分布指的是每个区域中的咖啡颗粒与图像采集模块的距离。可以理解的是,区域被划分的数量越多,则距离分布越精细。
可选地,该测距模块为与图像采集模块相邻设置的激光测距模块,用于对咖啡颗粒发射激光光束,接收被咖啡颗粒反射的激光光束,以及根据该发射的激光光束和接收的激光光束来测量咖啡颗粒与图像采集模块的距离。其中,测量的方法可以是脉冲法、相干法或者三角法等等。其中由于激光三角测距法对激光测距模块的要求较低而使得成本较低,优选采用激光三角测距法的激光测距模块。
一些示例中,承载面具体为预设样品盘的底面,通过图像采集模块拍摄获得所述咖啡颗粒位于预设样品盘中的图片;将所述图片划分为至少一个区域;确定每个所述区域中对应所述预设样品盘的底部的目标像素区域;根据所述目标像素区域在每个所述区域的占比获取所述咖啡颗粒与图像采集模块的距离分布。具体的,在一个划分的区域中,当预设样品盘的底面对应的目标像素区域的面积与该区域的面积的占比大于一定数值时,可以确定该区域中咖啡颗粒在预设样品盘中只铺了一层。根据预先标定的咖啡颗粒的高度以及预设样品盘与图像采集模块的距离,可以估算出在该区域中咖啡颗粒与图像采集模块的距离。当该区域中的预设样品盘的底部对应的目标像素区域的占比小于一定数值时,可认为咖啡颗粒铺满该区域的预设样品盘,将预先标定的预设样品盘与图像采集模块的距离作为该区域中咖啡颗粒与图像采集模块的距离。
其中,确定咖啡颗粒与图像采集模块的距离分布之后,根据所述距离分布对所述至少一帧原始图像中的像素值进行补偿,以将原始图像中的原始像素值补偿为所有咖啡颗粒和图像采集模块具有相同的距离下。例如,可以根据预先标定得到的距离和原始像素值之间的相关函数,然后根据所述获取到的距离分布分别对至少一帧的原始图片的至少一个区域内的原始像素值进行补偿,以原始图片的将该区域内原始像素值补偿到咖啡颗粒与图像采集模块之间的距离为预设距离时所对应的原始像素值。
可选地,预设样品盘的底面另一侧还设置有振动源,用于驱使该预设样品盘的底面振动,来使得预设样品盘内的咖啡颗粒分布均匀。可选地,在每一次获取原始图像之前,均采用该振动源对预设样品盘的底面振动,使得咖啡颗粒分布均匀,这样在通过测距模块获取咖啡颗粒与图像采集模块的距离时,无需获取预设样品盘中的不同区域的距离分布,只需要获取一处的咖啡颗粒和图像采集模块的距离即可。在对原始图像中的原始像素值进行补偿时,根据该获取到的一处的咖啡颗粒和图像采集模块的距离,将原始图像中的所有区域的原始像素值统一补偿到咖啡颗粒与图像采集模块之间的距离为预设距离时所对应的原始像素值。
或者,可选地,在获取咖啡颗粒与所述图像采集模块的距离分布的示例中,当检测到该距离分布满足预设条件时,才向所述预设样品盘发射机械波以振动所述预设样品盘,以改变所述预设样品盘内的咖啡颗粒的分布。该预设条件可以是咖啡颗粒与所述图像采集模块的距离分布中各距离的差异度大于预设差异度时,才向所述预设样品盘发射机械波,以使得预设样品盘内的咖啡颗粒的分布变得均匀。然后再对分布均匀的咖啡颗粒获取至少一帧原始图像。
其中,振动源的振动频率、振动幅度或者振动时间可以是固定的或者是可调的。可选的,咖啡颗粒的分析设备的显示界面上还设置有振动频率、振动幅度或者振动时间的调节选项,以便用户根据咖啡颗粒的大小来选择相应的振动频率、振动幅度或者振动时间。或者,咖啡颗粒的分析设备可以根据图像采集模块采集到的前一帧或几帧图像的分析结果初步确定咖啡颗粒的粒径,并自动调节相应的振动幅度或者振动时间。
实际应用中,咖啡颗粒的温度越高,自身向外辐射红外线的能量越高,进而对 图像探测造成一定的干扰,影响色度的测量。可选的,一些示例中,在步骤S702中,具体根据所述至少一帧原始图像获取一帧初始代表色度图;另外,咖啡颗粒的色度分析设备中设置有温度传感器,通过该温度传感器获取当前环境温度,以及从不同温度下的色度补偿方式中确定出所述当前环境温度对应的色度补偿方式;根据所述咖啡颗粒的初始代表色度图中的色度值和所述色度补偿方式确定所述咖啡颗粒的代表色度图。具体的,该当前环境温度可以是传感器的温度,或者是光源的温度,或者是咖啡颗粒的温度。
其中,该温度传感器可以靠近预设样品盘设置,以使得测出来的温度更加接近预设样品盘内的咖啡颗粒的温度。不同温度下的色度补偿方式可通过出厂前的标定中获取并存储在咖啡颗粒的分析设备中。具体的,可在标定中确定多个环境温度下计算得到的色度值和基准温度下计算得到的色度值的差作为色度补偿值。根据所述咖啡颗粒的初始代表色度图中的初始代表色度值和所述色度补偿方式确定所述咖啡颗粒的代表色度图,具体为将初始代表色度图中的各初始代表色度值加上或减去将当前环境温度对应的色度补偿值,作为代表色度值,得到代表色度图。
现有技术中,一般以咖啡颗粒的色度分析设备和咖啡颗粒达到温度平衡时的色度值为基准进行计算,当咖啡颗粒的温度高于设备的温度时,其二者之间的温差会造成色度值测量误差。本申请实施例中,通过预先获取咖啡颗粒的多点温度下分别对应的色度补偿方式,探测出非温度平衡下的色度补偿值来进行温度补偿。
本申请还提供一种咖啡颗粒的分析装置,如图11所示,图11为本申请的咖啡颗粒的分析装置的一个实施例的示例图。该咖啡颗粒的分析装置1100包括:
控制模块1101,用于控制振动源驱动咖啡颗粒进行至少两次振动;
图像采集模块1102,用于分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集;
第一获取模块1103,用于分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息;
第一确定模块1104,用于根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息。
可选地,所述控制模块1101用于控制振动源以第一驱动方式驱动所述咖啡颗粒振动,得到具有第一分布的咖啡颗粒;所述图像采集模块1102用于对所述具有第一分布的咖啡颗粒采集图像,用于得到第一待测图像;所述控制模块1101还用于控制所述振动源以第二驱动方式驱动所述具有第一分布的咖啡颗粒振动,得到具有第二分布的咖啡颗粒;所述图像采集模块1102还用于对所述具有第二分布的咖啡颗粒采集图像,得到第二待测图像。
可选地,所述第一驱动方式和所述第二驱动方式不同;所述控制模块1101还用于在所述控制所述振动源以第二驱动方式驱动所述具有第一分布的咖啡颗粒振动之后,还控制所述振动源至少一次以所述第二驱动方式驱动所述咖啡颗粒振动;所述图像采集模块1102还用于分别对每一次以所述第二驱动方式驱动后的所述咖啡颗粒采集图像,得到至少一帧待测图像。
可选地,所述第一驱动方式和所述第二驱动方式中的以下至少一项不同:振动频率、振动幅度、振动时间、振动区域。
可选地,所述第一驱动方式中的振动频率为共振频率,所述第二驱动方式中的振动频率小于或大于所述共振频率;和/或,所述第一驱动方式中的振动幅度大于所述第二驱动方式中的振动幅度。
可选地,所述第一驱动方式中的振动幅度比所述第二驱动方式中的振动幅度大, 且所述第二驱动方式中的振动时间比所述第一驱动方式中的振动时间长。
可选地,所述第二驱动方式是根据所述第一待测图像确定的。
可选地,所述装置1100还包括:第二确定模块,用于根据所述第一待测图像的咖啡颗粒的初始识别信息确定所述第二驱动方式中的振动频率、振动幅度、振动时间或振动区域中的至少一项;所述第一待测图像的咖啡颗粒的初始识别信息包括所述第一待测图像中的咖啡颗粒的数量和/或面积。
可选地,所述待测图像的咖啡颗粒的初始识别信息包括咖啡颗粒的数量;所述装置1100还包括:第三确定模块,用于根据所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中所述咖啡颗粒的数量确定所述咖啡颗粒的数量变化;第四确定模块,用于根据所述数量变化确定所述振动源在所述第二待测图像之后的驱动方式。
可选地,所述根据所述数量变化确定所述振动源在所述第二待测图像之后的驱动方式,包括以下至少一项:当所述数量变化为数量下降或者变化数值小于阈值时,停止所述振动源对所述咖啡颗粒的下一次驱动或者以所述第二驱动方式继续对所述咖啡颗粒的下一次驱动;或者,当所述数量变化为数量上升且变化数值大于所述阈值时,以所述第一驱动方式继续对所述咖啡颗粒的下一次驱动。
可选地,所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中所述咖啡颗粒的数量,为所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中面积大于预设临界值的颗粒的数量。
可选地,所述初始识别信息包括所述咖啡颗粒的粒径、数量、面积、体积、质量、色度中的至少一项;和/或,极小咖啡颗粒的数量、面积、体积、质量、色度中至少一项,所述极小咖啡颗粒为粒径小于第一预设粒径,或者粒径小于第一预设粒径且大于预设临界值的咖啡颗粒,其中,所述第一预设粒径的取值小于所述多个粒径区间中的粒径的取值。
可选地,所述初始识别信息还包括:所述咖啡颗粒在不同的粒径区间内数量分布、面积分布、体积分布、质量分布、色度分布中的至少一项;和/或,所述极小咖啡颗粒在所有咖啡颗粒中的占比信息。
可选地,所述最终识别信息包括所述咖啡颗粒在不同的粒径区间内最终数量分布、最终面积分布、最终体积分布、最终质量分布、最终色度分布中的至少一项;所述装置1100还包括:
显示模块,用于在交互界面上显示所述咖啡颗粒在不同的粒径区间内最终数量分布、最终面积分布、最终体积分布、最终质量分布、最终色度分布中的至少一项。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;
所述装置1100还包括:第二获取模块,用于在所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息之前,获取畸变函数,所述畸变函数用于指示多个像素位置处的粒径补偿值;畸变校正模块,用于对所述待测图像集中的待测图像的至少部分咖啡颗粒的粒径,根据所述咖啡颗粒的像素位置和对应的粒径补偿值进行畸变校正,得到咖啡颗粒的畸变校正后的粒径;所述第一确定模块具体用于根据所述待测图像集中至少部分帧待测图像的所述咖啡颗粒的畸变校正后的粒径确定所述咖啡颗粒的最终识别信息。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息之前,还包括:第三获取模块,用于获取粒径补偿函数,所述粒径补偿函数用于指示在多个亮度下的粒径补偿值;第四获取模块,用于分别获取所 述待测图像集中至少部分帧待测图像中咖啡颗粒所在区域的亮度;补偿模块,用于对所述至少部分帧待测图像,根据所述待测图像中的咖啡颗粒所在区域的亮度和所述粒径补偿值对所述待测图像中的咖啡颗粒的粒径进行补偿,得到咖啡颗粒的补偿后的粒径;所述第一确定模块具体用于根据所述待测图像集中至少部分帧待测图像的所述咖啡颗粒的补偿后的粒径确定所述咖啡颗粒的最终识别信息。
可选地,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;所述方法还包括标定模块,用于进入标定模式,其中,在所述标定模式中,所述标定模块还用于:对位于视场范围内预设位置处的、具有预设面积的标定图案采集图像,得到标定图像;获取所述标定图案所对应的像素数量;根据所述预设面积和所述像素数量确定一个像素所对应的标定尺寸;所述第一获取模块具体用于:分别获取所述待测图像集中的待测图像的咖啡颗粒的像素数量;根据所述标定尺寸和所述像素数来确定所述咖啡颗粒的粒径。
可选地,所述待测图像是所述咖啡颗粒被照射光源照射时所采集的图像;所述装置还包括:第五获取模块,用于获取至少一帧原始(raw)图像,所述至少一帧原始图像包含至少一种不同于所述照射光源的光源分别对咖啡颗粒照射时对所述咖啡颗粒所采集的图像的原始像素值;第六获取模块,用于根据所述至少一帧原始图像获取一帧代表色度图;第五确定模块,用于根据所述一帧代表色度图确定所述咖啡颗粒的整体色度值。
本申请还提供一种咖啡颗粒的分析设备,如图12所示,图12为本申请的咖啡颗粒的分析设备的一个实施例的示例图。该咖啡颗粒的分析设备1200包括存储器1201和处理器1202,所述存储器1201上存储有可执行代码,当可执行代码被所述处理器1202处理时,可以使所述咖啡颗粒的分析设备任一项所述的咖啡颗粒的分析方法。
可选地,咖啡颗粒的分析设备1200还包括振动源、光源模块、感光面阵,以及用于承载所述咖啡颗粒的承载面。其中,所述光源模块包括分别位于所述承载面两侧的照射光源和背光光源。所述感光面阵用于在所述照射光源和所述背光光源发射光束时对所述承载面上的咖啡颗粒采集待测图像。
如图13和图14所示,图13是本申请的咖啡颗粒的分析设备的一个实施例中的振动源、承载面和背光光源的结构示意图,图14是图13所示结构的爆炸图。可选地,所述振动源1301包括功率放大器,或者,所述振动源包括具有不同方向的至少两个线性振动源。对该振动源的描述可参考上文中对振动源的描述,在此不再赘述。图13和图14中以功率放大器对振动源1301进行示意。
所述承载面1302具体为第一匀光薄膜;所述功率放大器1301和所述第一匀光薄膜1302之间还设置有第二匀光薄膜1303和导光板1304。所述第一匀光薄膜1302、所述导光板1304和所述第二匀光薄膜1303依次并列排布,所述导光板1304位于所述第一匀光薄膜1302和所述第二匀光薄膜1303所围成的气密空间内。所述背光光源1305位于所述导光板1304的周缘。
可选地,第二匀光薄膜1303与导光板1304分别跟第一匀光薄膜1302通过胶水连接形成了一个密闭的气腔。第二匀光薄膜1303连接功率放大器1301,当功率放大器1301的振动传导到第二匀光薄膜1303后,该第二匀光薄膜1303的振动通过气腔传到到第一匀光薄膜1302,进而带动咖啡颗粒振动。可选地,所述导光板1304上还设置有至少一个通孔13041,以更方便振动通过该气腔传导。
在粒径分析中,若只打开照射光源,由于该照射光源和感光面阵位于承载面的同一侧,该照射光源的光束相对承载面来说是顶光,会造成拍摄到的待测图像的背 景会比较暗,如图15所示,图15是照射光源和背光光源中仅有照射光源打开的情况下感光面阵所采集到的待测图像的一个示意图。由于待测图像背景暗,在分辨背景与咖啡颗粒时可能会产生误差,降低咖啡颗粒的粒径分析的准确度。通过在承载面背向感光面阵的一侧设置有背光光源,在测量粒径时同时打开该背光光源和照射光源,能较好的解决背景较暗的问题。如图16所示,图16是照射光源和背光光源同时打开的情况下感光面阵所采集到的待测图像的一个示意图。可以看出,背光光源能够使得更为准确地分辨背景和咖啡颗粒,提高咖啡颗粒的粒径分析的准确度。进一步,为解决底部背光均匀问题,本示例中还采用导光板,并从导光板侧面打光源,能够提高待测图像的亮度均匀度,以及提高咖啡颗粒的粒径分析的准确度。
可选地,所述光源模块还包括用于分别出射位于500nm到1100nm之间的不同波长的至少两种光谱光源。处理器在执行上述咖啡颗粒的分析方法时,在获取至少一帧原始图像时,具体是在所述至少两种光谱光源分别对咖啡颗粒照射时感光面阵对所述咖啡颗粒所采集的原始图像。
可选地,咖啡颗粒的分析设备的内部还设置有预设标定色卡,例如如图10所述的预设标定色卡。例如,咖啡颗粒的分析设备还包括具有一侧开口的、呈中空筒状的结构件,以及与该结构件的开口以可拆卸式的方式相互固定的底座。该结构的内侧顶部设置有上述光源模块和感光面阵,该底座包括承载面和振动源。该预设标定色卡固定于结构件的内侧面上,位于感光面阵的视场范围内且不对承载面上的咖啡颗粒造成遮挡。
或者,本申请还可以实施为一种计算机可读存储介质(或非暂时性机器可读存储介质或机器可读存储介质),其上存储有可执行代码(或计算机程序或计算机指令代码),当可执行代码(或计算机程序或计算机指令代码)被电子设备(或服务器等)的处理器执行时,使处理器执行根据本申请的上述方法的各个步骤的部分或全部。以上已经描述了本申请的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其他普通技术人员能理解本文披露的各实施例。

Claims (25)

  1. 一种咖啡颗粒的分析方法,其特征在于,包括:
    控制振动源驱动咖啡颗粒进行至少两次振动,分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集;
    分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息;
    根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息。
  2. 根据权利要求1所述的方法,其特征在于,所述控制振动源驱动咖啡颗粒进行至少两次振动,分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集,包括:
    控制振动源以第一驱动方式驱动所述咖啡颗粒振动,得到具有第一分布的咖啡颗粒;
    对所述具有第一分布的咖啡颗粒采集图像,得到第一待测图像;
    控制所述振动源以第二驱动方式驱动所述具有第一分布的咖啡颗粒振动,得到具有第二分布的咖啡颗粒;
    对所述具有第二分布的咖啡颗粒采集图像,得到第二待测图像。
  3. 根据权利要求2所述的方法,其特征在于,所述第一驱动方式和所述第二驱动方式不同;
    所述控制所述振动源以第二驱动方式驱动所述具有第一分布的咖啡颗粒振动,之后还包括:
    控制所述振动源至少一次以所述第二驱动方式驱动所述咖啡颗粒振动;
    分别对每一次以所述第二驱动方式驱动后的所述咖啡颗粒采集图像,
    得到至少一帧待测图像。
  4. 根据权利要求2所述的方法,其特征在于,所述第一驱动方式和所述第二驱动方式中的以下至少一项不同:
    振动频率、振动幅度、振动时间、振动区域。
  5. 根据权利要求4所述的方法,其特征在于,所述第一驱动方式中的振动频率为共振频率,所述第二驱动方式中的振动频率小于或大于所述共振频率;和/或,
    所述第一驱动方式中的振动幅度大于所述第二驱动方式中的振动幅度。
  6. 根据权利要求5所述的方法,其特征在于,所述第一驱动方式中的振动幅度比所述第二驱动方式中的振动幅度大,且所述第二驱动方式中的振动时间比所述第一驱动方式中的振动时间长。
  7. 根据权利要求2至6任一项所述的方法,其特征在于,所述第二驱动方式是根据所述第一待测图像确定的。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    根据所述第一待测图像的咖啡颗粒的初始识别信息确定所述第二驱动方式中的振动频率、振动幅度、振动时间或振动区域中的至少一项;
    所述第一待测图像的咖啡颗粒的初始识别信息包括所述第一待测图像中的咖啡颗粒的数量和/或面积。
  9. 根据权利要求7所述的方法,其特征在于,所述待测图像的咖啡颗粒的初始识别信息包括咖啡颗粒的数量;
    所述方法还包括:
    根据所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中所述咖啡颗粒的数量确定所述咖啡颗粒的数量变化;
    根据所述数量变化确定所述振动源在所述第二待测图像之后的驱动方式。
  10. 根据权利要求9所述的方法,其特征在于,所述根据所述数量变化确定所述振动源在所述第二待测图像之后的驱动方式,包括以下至少一项:
    当所述数量变化为数量下降或者变化数值小于阈值时,停止所述振动源对所述咖啡颗粒的下一次驱动或者以所述第二驱动方式继续对所述咖啡颗粒的下一次驱动;或者,
    当所述数量变化为数量上升且变化数值大于所述阈值时,以所述第一驱动方式继续对所述咖啡颗粒的下一次驱动。
  11. 根据权利要求10所述的方法,其特征在于,所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中所述咖啡颗粒的数量,为所述第一待测图像之前的至少一帧待测图像、所述第一待测图像和所述第二待测图像中面积大于预设临界值的颗粒的数量。
  12. 根据权利要求1至6任一项所述的方法,其特征在于,所述初始识别信息包括所述咖啡颗粒的粒径、数量、面积、体积、质量、色度中的至少一项;和/或,极小咖啡颗粒的数量、面积、体积、质量、色度中至少一项,所述极小咖啡颗粒为粒径小于第一预设粒径,或者粒径小于第一预设粒径且大于预设临界值的咖啡颗粒,其中,所述第一预设粒径的取值小于所述多个粒径区间中的粒径的取值。
  13. 根据权利要求12所述的方法,其特征在于,所述初始识别信息还包括:
    所述咖啡颗粒在不同的粒径区间内数量分布、面积分布、体积分布、质量分布、色度分布中的至少一项;和/或,
    所述极小咖啡颗粒在所有咖啡颗粒中的占比信息。
  14. 根据权利要求13所述的方法,其特征在于,所述最终识别信息包括所述咖啡颗粒在不同的粒径区间内最终数量分布、最终面积分布、最终体积分布、最终质量分布、最终色度分布中的至少一项;
    所述方法还包括:
    在交互界面上显示所述咖啡颗粒在不同的粒径区间内最终数量分布、最终面积分布、最终体积分布、最终质量分布、最终色度分布中的至少一项。
  15. 根据权利要求1至6任一项所述的方法,其特征在于,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;
    所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息之前,还包括:
    获取畸变函数,所述畸变函数用于指示多个像素位置处的粒径补偿值;
    对所述待测图像集中的待测图像的至少部分咖啡颗粒的粒径,根据所述咖啡颗粒的像素位置和对应的粒径补偿值进行畸变校正,得到咖啡颗粒的畸变校正后的粒径;
    所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息,包括:
    根据所述待测图像集中至少部分帧待测图像的所述咖啡颗粒的畸变校正后的粒径确定所述咖啡颗粒的最终识别信息。
  16. 根据权利要求1至6任一项所述的方法,其特征在于,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;
    所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息之前,还包括:
    获取粒径补偿函数,所述粒径补偿函数用于指示在多个亮度下的粒径补偿值;
    分别获取所述待测图像集中至少部分帧待测图像中咖啡颗粒所在区域的亮度;
    对所述至少部分帧待测图像,根据所述待测图像中的咖啡颗粒所在区域的亮度和所述粒径补偿值对所述待测图像中的咖啡颗粒的粒径进行补偿,得到咖啡颗粒的补偿后的粒径;
    所述根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息,包括:
    根据所述待测图像集中至少部分帧待测图像的所述咖啡颗粒的补偿后的粒径确定所述咖啡颗粒的最终识别信息。
  17. 根据权利要求1至6任一项所述的方法,其特征在于,所述咖啡颗粒的初始识别信息包括所述咖啡颗粒的粒径;
    所述方法还包括:
    进入标定模式,其中,在所述标定模式中:
    对位于视场范围内预设位置处的、具有预设面积的标定图案采集图像,得到标定图像;
    获取所述标定图案所对应的像素数量;
    根据所述预设面积和所述像素数量确定一个像素所对应的标定尺寸;
    所述分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息,包括:
    分别获取所述待测图像集中的待测图像的咖啡颗粒的像素数量;
    根据所述标定尺寸和所述像素数来确定所述咖啡颗粒的粒径。
  18. 根据权利要求1至6任一项所述的方法,其特征在于,所述待测图像是所述咖啡颗粒被照射光源照射时所采集的图像;
    所述方法还包括:
    获取至少一帧原始(raw)图像,所述至少一帧原始图像包含至少一种不同于所述照射光源的光源分别对咖啡颗粒照射时对所述咖啡颗粒所采集的图像的原始像素值;
    根据所述至少一帧原始图像获取一帧代表色度图;
    根据所述一帧代表色度图确定所述咖啡颗粒的整体色度值。
  19. 一种咖啡颗粒的分析装置,其特征在于,包括:
    控制模块,用于控制振动源驱动咖啡颗粒进行至少两次振动;
    图像采集模块,用于分别对所述至少两次振动后的咖啡颗粒采集图像,得到具有不同分布的咖啡颗粒的待测图像集;
    第一获取模块,用于分别获取所述待测图像集中的待测图像的咖啡颗粒的初始识别信息;
    第一确定模块,用于根据所述待测图像集中至少部分帧待测图像的咖啡颗粒的初始识别信息确定所述咖啡颗粒的最终识别信息。
  20. 一种咖啡颗粒的分析设备,其特征在于,包括存储器和处理器,所述存储器上存储有可执行代码,当可执行代码被所述处理器处理时,可以使所述处理器执行权利要求1至18中任一项所述的咖啡颗粒的分析方法。
  21. 根据权利要求20所述的设备,其特征在于,还包括:振动源、光源模块、感光面阵,以及用于承载所述咖啡颗粒的承载面;
    所述振动源位于所述承载面一侧;
    所述光源模块包括位于所述承载面用于承载所述咖啡颗粒的一侧的照射光源;
    所述感光面阵用于在所述照射光源发射光束时对所述承载面上的咖啡颗粒采集待测图像。
  22. 根据权利要求21所述的设备,其特征在于,所述承载面具体为第一匀光薄膜;
    所述振动源和所述第一匀光薄膜之间还设置有第二匀光薄膜和导光板,所述第一匀光薄膜、所述导光板和所述第二匀光薄膜依次并列排布,所述导光板位于所述第一匀光薄膜和所述第二匀光薄膜所围成的气密空间内;所述导光板上还设置有至少一个通孔;
    所述光源模块还包括背光光源,位于所述导光板的周缘;
    所述感光面阵用于在所述照射光源和所述背光光源发射光束时对所述承载面上的咖啡颗粒采集待测图像。
  23. 根据权利要求21所述的设备,其特征在于,所述振动源包括功率放大器,或者,所述振动源包括具有不同方向的至少两个线性振动源。
  24. 根据权利要求21所述的设备,其特征在于,所述光源模块还包括用于分别出射位于500nm到1100nm之间的不同波长的至少两种光谱光源;
    所述处理器还用于:
    获取至少一帧原始(raw)图像,所述至少一帧原始图像包含所述至少两种光谱光源分别对咖啡颗粒照射时对所述咖啡颗粒所采集的图像的原始像素值;
    根据所述至少一帧原始图像获取一帧代表色度图;
    根据所述一帧代表色度图确定所述咖啡颗粒的整体色度值。
  25. 一种计算机可读存储介质,其特征在于,其上存储有可执行代码,当所述可执行代码被咖啡颗粒识别设备执行时,使所述咖啡颗粒识别设备执行如权利要求1至18中任意一项所述的方法。
PCT/CN2023/088295 2023-03-22 2023-04-14 咖啡颗粒的分析方法、装置、设备和计算可读存储介质 WO2024192831A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310319552.8 2023-03-22
CN202310319552 2023-03-22

Publications (1)

Publication Number Publication Date
WO2024192831A1 true WO2024192831A1 (zh) 2024-09-26

Family

ID=92840808

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/088295 WO2024192831A1 (zh) 2023-03-22 2023-04-14 咖啡颗粒的分析方法、装置、设备和计算可读存储介质

Country Status (1)

Country Link
WO (1) WO2024192831A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003042935A (ja) * 2001-07-27 2003-02-13 Kyocera Corp セラミック平均粒径測定装置
US20040151360A1 (en) * 2001-07-02 2004-08-05 Eric Pirard Method and apparatus for measuring particles by image analysis
CN105247342A (zh) * 2013-02-28 2016-01-13 尼尔·M·戴 用于确定颗粒尺寸的方法及设备
CN108489872A (zh) * 2018-03-23 2018-09-04 奥星制药设备(石家庄)有限公司 在线粒度监测方法和系统
CN112945808A (zh) * 2021-01-26 2021-06-11 中铁南方投资集团有限公司 一种渣土多级分离后骨料粒径的分析方法及系统
CN114324078A (zh) * 2021-12-24 2022-04-12 中煤科工清洁能源股份有限公司 一种颗粒粒径识别方法、装置、设备和介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040151360A1 (en) * 2001-07-02 2004-08-05 Eric Pirard Method and apparatus for measuring particles by image analysis
JP2003042935A (ja) * 2001-07-27 2003-02-13 Kyocera Corp セラミック平均粒径測定装置
CN105247342A (zh) * 2013-02-28 2016-01-13 尼尔·M·戴 用于确定颗粒尺寸的方法及设备
CN108489872A (zh) * 2018-03-23 2018-09-04 奥星制药设备(石家庄)有限公司 在线粒度监测方法和系统
CN112945808A (zh) * 2021-01-26 2021-06-11 中铁南方投资集团有限公司 一种渣土多级分离后骨料粒径的分析方法及系统
CN114324078A (zh) * 2021-12-24 2022-04-12 中煤科工清洁能源股份有限公司 一种颗粒粒径识别方法、装置、设备和介质

Similar Documents

Publication Publication Date Title
US8830227B2 (en) Depth-based gain control
TWI451291B (zh) 光學指向裝置內的光源控制
US6502984B2 (en) Radiographic apparatus
EP1463342A1 (en) Test system for camera modules
EP1171996B1 (en) Fast focus assessment system and method for imaging
CN210401431U (zh) 一种检测荧光免疫和胶体金试剂条的跨平台检测装置
CN111356913B (zh) 表面特性检查装置和记录介质
TW202021339A (zh) 用於相機之紅外光預閃光
CN113504185A (zh) 结合libs定标的多光谱农产品重金属含量检测建模系统
WO2024192831A1 (zh) 咖啡颗粒的分析方法、装置、设备和计算可读存储介质
CN100557385C (zh) 吻合器漏针检测系统
JP2005215712A (ja) 個体数カウント用の撮像装置及び制御手段
US5179597A (en) Method for determining an image point in an object image
US8805014B2 (en) Produce color data correction method and an apparatus therefor
US20240257317A1 (en) Optical image processing method, machine learning method, trained model, machine learning preprocessing method, optical image processing module, optical image processing program, and optical image processing system
US20200036877A1 (en) Use of ir pre-flash for rgb camera's automatic algorithms
KR101039423B1 (ko) 얼굴밝기 측정에 의한 카메라의 노출과 셔터스피드 제어방법 및 그 제어방법에 의한 카메라 장치
WO2006076397A2 (en) Image methods for determining contour of terrain
CN118688131A (zh) 咖啡颗粒的色度分析方法、装置、设备和可存储介质
US5055682A (en) Method for judging an irradiation field
KR100807845B1 (ko) 게임 인터페이스를 위한 적외선 엘이디 추적시스템 및추적방법
JP4860502B2 (ja) 顔判別装置および方法並びにプログラム
JP2003307493A (ja) 特徴抽出方法
CN118464813B (zh) 一种水下目标光谱反射率计算模型的构建方法
CN111277819B (zh) Tof模组的性能检测方法和检测系统