Coffee particle color value detection method and colorimeter
By measuring the parameter values of a preset function model using multiple color charts, the problem of inaccurate and inconsistent colorimetric values of coffee particles measured by colorimeters was solved, achieving higher measurement accuracy and consistency.
Patent Information
- Application Number
- CN202411272401.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2026-03-13
AI Technical Summary
Existing colorimeters have inaccuracies and inconsistencies when measuring the colorimetric values of coffee particles. These inaccuracies may be due to measurement errors caused by component aging or displacement, as well as inconsistencies in measurement results between different colorimeters.
By using multiple color charts of different colors for measurement, fitting the parameter values of a preset function model, and then using the fitted function model to calculate the colorimetric value of coffee particles, the accuracy and consistency of measurement are improved.
It improves the measurement accuracy of colorimeters and the consistency of measurement results of multiple colorimeters on the same coffee particles, and solves the measurement error problem caused by component aging or displacement.
Smart Images

Figure CN121656151A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of colorimetry, specifically to a method for detecting the color value of coffee particles and a colorimeter. Background Technology
[0002] In some production or competition scenarios, it is necessary to measure the color value of coffee powder. However, due to factors such as component aging or displacement during use, colorimeters may produce inaccurate color values when measuring coffee particles. Alternatively, different colorimeters may produce inconsistent color values when measuring coffee particles due to differences in structure or components. Summary of the Invention
[0003] The present invention aims to provide a method and colorimeter for detecting the color value of coffee particles, which can improve the accuracy and consistency of colorimetric value measurement.
[0004] Firstly, this application provides a method for detecting the color value of coffee particles, including:
[0005] The first spectral light source located inside the colorimeter illuminates n color cards of different colors, where n is an integer greater than 1;
[0006] The first type of image of the n color cards is formed by receiving the reflected light from the first spectral light source by the photodetector located in the colorimeter.
[0007] The image brightness values of the n color cards are obtained respectively based on the first type of images of the n color cards;
[0008] Obtain the color values of the n color cards;
[0009] Obtain a preset function model, which is a function model between chroma values and image brightness values;
[0010] Based on the image brightness values of the n color cards, the color card values of the n color cards, and the preset function model, the parameter values of the preset function model are fitted to obtain the parameter values of the preset function model;
[0011] The coffee particles are irradiated by the first spectral light source;
[0012] A first type of image of the coffee particles is formed by receiving the reflected light from the first spectral light source by the photodetector.
[0013] The image brightness value of the coffee particles is obtained based on the first type of image of the coffee particles;
[0014] The chromaticity value of the coffee particles is calculated based on the image brightness value of the coffee particles, the preset function model, and the parameter value.
[0015] Optionally, the step of illuminating the n color cards of different colors with the first spectral light source located in the colorimeter specifically means illuminating the n color cards of different colors simultaneously with the first spectral light source; the first type image of the n color cards is a single frame of the first type image;
[0016] The method further includes:
[0017] Based on the grayscale values in the first type of image, determine the positions of the n color cards in the first type of image;
[0018] Based on the positions of the n color cards in the first type of image, a first type of brightness value is obtained for each color card; wherein, the first type of brightness value for each color card is the brightness value of at least one pixel corresponding to the color card in the first type of image or the average brightness value of at least some pixels corresponding to the color card, and the image brightness value of each color card is determined based on the first type of brightness value of the color card.
[0019] Optionally, the n color cards are integrated on the same card, located in different areas of the same card, and the card is independent of the colorimeter;
[0020] The process of obtaining the color card values of the n color cards includes:
[0021] The color values of the n color cards input by the user are obtained through the interactive interface of the colorimeter or other devices connected to the colorimeter.
[0022] Optionally, the colorimeter further includes a sidewall surrounding the central axis of the outgoing light path of the first spectral light source, and the n color cards are different regions with different colors located on the inner surface of the sidewall;
[0023] The color values of the n color cards are pre-stored in the memory of the colorimeter;
[0024] The step of obtaining the color card values of the n color cards includes: obtaining the color card values of the n color cards stored in the memory.
[0025] Optionally, the n color cards and the colorimeter are independent of each other;
[0026] The step of illuminating n color cards of different colors with a first spectral light source located in the colorimeter specifically involves illuminating the n color cards of different colors with the first spectral light source at different time periods; the first type of image of the n color cards consists of n frames of first type images.
[0027] The process of obtaining the color card values of the n color cards includes:
[0028] Before or after each color card is irradiated by the first spectral light source, the user is prompted to input the color card value of the color card through the interactive interface of the colorimeter or other device connected to the colorimeter;
[0029] Obtain the color card value input by the user.
[0030] Optionally, the method further includes:
[0031] When the difference between the color values of any two color cards entered by the user is less than a preset value, the user is notified via the interactive interface that the entered color card value is incorrect; or,
[0032] When the parameter values of the fitted preset function model do not meet the preset numerical range, the user is notified through the interactive interface that the input color card value is incorrect.
[0033] Optionally, the method further includes:
[0034] The colorimeter illuminates n color cards of different colors using a second spectral light source located within it, wherein the first and second spectral light sources are used to emit light beams of different spectra between 500 nm and 1100 nm, respectively.
[0035] The photodetector located inside the colorimeter receives the reflected light from the second spectral light source from the n color cards respectively, forming a second type of image of the n color cards;
[0036] The coffee particles are irradiated by the second spectral light source;
[0037] The photodetector receives the reflected light from the coffee particles to the second spectral light source, forming a second type of image of the coffee particles;
[0038] The step of obtaining the image brightness values of the n color cards based on the first type of images of the n color cards includes:
[0039] Based on the first type of image of each color card, obtain the first type of brightness value of the color card;
[0040] Based on the second type of image of each color card, obtain the second type of brightness value of the color card;
[0041] The image brightness value of the color card is obtained by weighted summation of the first type of brightness value and the second type of brightness value of the color card;
[0042] as well as,
[0043] The step of obtaining the image brightness value of the coffee particles based on the first type of image of the coffee particles includes:
[0044] Based on the first type of image of the coffee particles, obtain the first type of brightness value of the coffee particles;
[0045] Based on the second type of image of the coffee particles, obtain the second type of brightness value of the coffee particles;
[0046] The image brightness value of the coffee particles is obtained by weighted summation of the first type of brightness value and the second type of brightness value of the coffee particles.
[0047] Optionally, the colorimeter pre-stores function models of different orders; obtaining the preset function model includes:
[0048] Identify the value of n;
[0049] The preset function model is selected from the function models of different powers based on the value of n, wherein the preset function model is an n-1 power function model.
[0050] Optionally, n can be 2 or 3.
[0051] Optionally, obtaining the image brightness value of the coffee particles based on the first type of image of the coffee particles includes:
[0052] Obtain the initial brightness value of the pixel corresponding to the coffee particle on the first type of image of the coffee particle;
[0053] Based on the position of the corresponding coffee particle's pixel, obtain the preset brightness compensation value corresponding to the position;
[0054] The compensated brightness value is calculated based on the initial brightness value of the pixel corresponding to the coffee particle and the corresponding preset brightness compensation value;
[0055] The compensated brightness value of at least one pixel of the corresponding coffee particle is used as the first type of brightness value of the coffee particle, or the average value of the compensated brightness values of the corresponding coffee particle is used as the first type of brightness value of the coffee particle.
[0056] The image brightness value of the coffee particles is determined based on the first type of brightness value of the coffee particles.
[0057] Optionally, obtaining the image brightness values of the n color cards based on the first type of images of the n color cards includes:
[0058] Obtain the initial brightness value of each pixel on the first type image of each color chart;
[0059] Based on the position of each pixel, a preset brightness compensation value corresponding to the position is obtained;
[0060] The compensated brightness value is calculated based on the initial brightness value of each pixel and the corresponding preset brightness compensation value;
[0061] The compensated brightness value of at least one pixel of the first type image of the color chart is used as the first type brightness value of the color chart, or the average value of the brightness values of at least some pixels of the first type image of the color chart is used as the first type brightness value of the color chart.
[0062] The image brightness value of the color card is determined based on the first type of brightness value of the color card.
[0063] Optionally, obtaining the image brightness value of the coffee particles based on the first type of image of the coffee particles includes:
[0064] Obtain the initial brightness value of the pixel corresponding to the coffee particle on the first type of image of the coffee particle;
[0065] Obtain the depth value of the pixel corresponding to the coffee particle, wherein the depth value indicates the distance between the surface of the coffee particle corresponding to the pixel and the photodetector or the light source;
[0066] Obtain the preset brightness compensation value corresponding to the depth value based on the depth value of the pixel;
[0067] The compensated brightness value is calculated based on the initial brightness value of the pixel and the preset brightness compensation value;
[0068] The compensated brightness value of at least one pixel of the corresponding coffee particle is used as the first type of brightness value of the coffee particle, or the average value of the compensated brightness values of the corresponding coffee particle is used as the first type of brightness value of the coffee particle.
[0069] The image brightness value of the coffee particles is determined based on the first type of brightness value of the coffee particles.
[0070] Optionally, obtaining the image brightness value of the coffee particles based on the first type of image of the coffee particles includes:
[0071] Obtain the initial brightness value of the pixel corresponding to the coffee particle on the first type of image of the coffee particle;
[0072] Based on the initial brightness value of the pixel, determine the preset brightness compensation value corresponding to the initial brightness value;
[0073] The compensated brightness value is calculated based on the initial brightness value of the pixel and the preset brightness compensation value;
[0074] The compensated brightness value of at least one pixel of the corresponding coffee particle is used as the first type of brightness value of the coffee particle, or the average value of the compensated brightness values of the corresponding coffee particle is used as the first type of brightness value of the coffee particle.
[0075] The image brightness value of the coffee particles is determined based on the first type of brightness value of the coffee particles.
[0076] Optionally, the colorimeter also has a pre-stored function relating the colorimetric compensation value and the particle size of the coffee particles;
[0077] The step of calculating the chromaticity value of the coffee particles based on the image brightness value of the coffee particles, the preset function model, and the parameter values, further includes:
[0078] The particle size of the coffee particles is obtained based on the first type of image of the coffee particles;
[0079] The chromaticity compensation value of the coffee particles is calculated based on the particle size of the coffee particles and the relationship function between the chromaticity compensation value and the particle size of the coffee particles.
[0080] Calculate the compensated chromaticity value of the coffee particles based on the chromaticity value of the coffee particles and the chromaticity value compensation value;
[0081] The compensated chromaticity value is displayed through the interactive interface of the colorimeter.
[0082] Optionally, the colorimeter has preset function models for different chromaticity value ranges and different luminance value ranges;
[0083] The step of obtaining the preset function model includes: selecting the corresponding preset function model based on the color card values of the n color cards;
[0084] The step of calculating the chromaticity value of the coffee particles based on the image brightness value of the coffee particles, the preset function model, and the parameter values includes:
[0085] Select the corresponding preset function model and parameter values based on the image brightness values of the coffee particles;
[0086] The chromaticity value of the coffee particles is calculated based on the selected preset function model and parameter values, as well as the brightness value of the coffee particles.
[0087] Secondly, this application provides a colorimeter, including a light source group and a photodetector, wherein the light source group includes a first spectral light source;
[0088] The colorimeter is used to perform any of the coffee particle color value detection methods described herein.
[0089] Optionally, the colorimeter includes:
[0090] The main structure is in the form of a hollow cylinder, including a first end and a second end opposite to each other, and a sidewall connecting the first end and the second end.
[0091] The light source group and the photodetector are disposed at the first end and face the second end. The sidewall surrounds the central axis of the outgoing light path of the light source group. The end face of the second end is provided with an opening, and the opening is covered with a light-transmitting glass that can transmit the outgoing light of the light source group.
[0092] Optionally, the colorimeter further includes a support base for detachable connection with the second end;
[0093] The support base includes a support groove for carrying coffee particles. The light-transmitting glass on the end face of the second end can be used to scrape the coffee particles in the support groove that are higher than the opening of the support groove. When the support base and the second end are connected, the light-transmitting glass is used to cover the opening of the support groove. The light emitted from the light source group is transmitted through the light-transmitting glass and reflected back to the first end by the coffee particles in the support groove, and is received by the photodetector.
[0094] Optionally, the n color cards are different regions with different colors located on the inner surface of the sidewall, and the inner surface of the sidewall is matte.
[0095] In this embodiment, by measuring with a color chart of at least two colors, the parameter values of a preset function model used to calculate chromaticity values can be refitted. Then, the chromaticity values of coffee particles are calculated using the preset function model with the fitted parameter values. This avoids inaccuracies in measuring the chromaticity values of coffee particles that may occur due to component aging, displacement, or other factors during use, thus improving the measurement accuracy of the colorimeter. Moreover, compared to using only one color chart for calibration, it improves the accuracy and stability of the fitting results of the parameter values of the preset function model. In addition, multiple colorimeters can be calibrated using the same set of color charts, which improves the consistency of measurement results of multiple colorimeters on the same coffee particle. Attached Figure Description
[0096] Figure 1a This is a schematic diagram of a structure of an embodiment of the coffee particle color value detection method of this application;
[0097] Figure 1b This is a schematic diagram of one embodiment of the color card in this application;
[0098] Figure 1c This is a schematic diagram of one embodiment of the color card in this application;
[0099] Figure 2 This is a schematic diagram of an embodiment of some steps in the coffee particle color value detection method of this application;
[0100] Figure 3 This is a schematic diagram of an embodiment of some steps in the coffee particle color value detection method of this application;
[0101] Figure 4 This is a schematic diagram of an embodiment of some steps in the coffee particle color value detection method of this application;
[0102] Figure 5 A schematic diagram of an embodiment of a photodetector acquiring an image of coffee beans corresponding to a spectral light source;
[0103] Figure 6 This is a schematic diagram of an embodiment of some steps in the coffee particle color value detection method of this application;
[0104] Figure 7 This is a schematic diagram of the logic framework of one embodiment of the colorimeter of this application;
[0105] Figure 8 This is a schematic diagram of the structure of one embodiment of the colorimeter of this application;
[0106] Figure 9 yes Figure 8 A schematic diagram of the cross-sectional structure of the colorimeter shown.
[0107] Figure 10 This is a schematic diagram of the structure of the support base of the colorimeter in one embodiment of this application;
[0108] Figure 11 This is a cross-sectional structural diagram of a colorimeter in one embodiment of this application. Detailed Implementation
[0109] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and 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, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of this application, and similarly, second information may also be referred to as first information. Therefore, features specified as "first" or "second" may explicitly or implicitly include one or more of those features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0110] Figure 1a This is a schematic diagram of one embodiment of the coffee particle color value detection method of this application. Figure 1a As shown, the method includes:
[0111] Step S101: Illuminate n color cards of different colors with the first spectral light source located in the colorimeter, where n is an integer greater than 1.
[0112] Optionally, the emitted beam spectrum of the first spectral light source is located between 500 nm and 1100 nm. Optionally, the first spectral light source is a near-infrared light source, for example, when the emitted beam spectrum is located between 780 nm and 940 nm.
[0113] Step S102: The light reflected from the first spectral light source by the n color cards is received by the photodetector located in the colorimeter, forming a first type of image of the n color cards.
[0114] Alternatively, the photodetector may include a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS).
[0115] In some examples, step S101, illuminating n color cards of different colors with a first spectral light source located within the colorimeter, specifically involves simultaneously illuminating n color cards of different colors with the first spectral light source; the first type image of the n color cards is a single frame of the first type image. For example, such as... Figure 1b As shown, Figure 1b This is a schematic diagram of one embodiment of the color chart in this application. The n color charts are integrated on the same card, located in different areas of the same card, and the card is independent of the colorimeter. Figure 1b The cards in the diagram are illustrated using color cards 11 and 12, which contain two different chromaticity values. Alternatively, the colorimeter may further include a sidewall surrounding the central axis of the outgoing light path of the first spectral light source, with the n color cards representing different regions of different colors located on the inner surface of the sidewall. A portion of the outgoing light from the first spectral light source can be directly incident on the n color cards, and the n color cards are located within the field of view of the photodetector.
[0116] In some examples, the n color charts are independent of the colorimeter. For example, as... Figure 1c As shown, Figure 1c This is a schematic diagram of one embodiment of the color chart in this application. Color chart 13 and color chart 14 are two isolated color charts. Optionally, the two color charts can be arranged side by side on a single card for easy storage by the user. The step S101, illuminating the n color charts of different colors with a first spectral light source located within the colorimeter, specifically involves illuminating the n color charts of different colors with the first spectral light source at different time periods; the first type of image of the n color charts consists of n frames of first type images.
[0117] Step S103: Obtain the image brightness values of the n color cards according to the first type of images of the n color cards respectively.
[0118] In an example where the light source within the colorimeter contains only a first spectral light source, a final brightness value, i.e., the image brightness value of the color chart, is determined based on the brightness values of each pixel in the first type image of each color chart. Optionally, in an example where the first type images of the n color charts are n frames of first type images, the image brightness value of each color chart can be the brightness value of at least one pixel in the first type image corresponding to that color chart, or it can be the average of the brightness values of at least some pixels. Optionally, in an example where the first type images of the n color charts are one frame of first type image, the image brightness value of each color chart can be the brightness value of at least one pixel in a portion of the first type image corresponding to that color chart, or it can be the average of the brightness values of at least some pixels in that portion of the image.
[0119] In an example where the first type of image of the n color cards is a single frame of the first type of image, the coffee particle color value detection method of this application further includes identifying the position of each color card from that frame of the first type of image. For example, the grayscale value of the first type of image can be obtained, and the positions of the n color cards in the first type of image can be determined based on the grayscale value. A sudden change in grayscale value will occur at the boundary between two adjacent different color cards, and the boundary of the color cards can be determined by the gradient of the grayscale value, thereby confirming the different regions corresponding to different color cards. Furthermore, different color cards correspond to different grayscale value ranges, and the color card corresponding to each region can be identified by the grayscale value.
[0120] Step S104: Obtain the color card values of the n color cards.
[0121] Each color card already has its corresponding color value (i.e., chromaticity value), eliminating the need for a colorimeter to test the color cards. In the example where the n color cards are fixed to the inner side wall of the colorimeter, the color values of the n color cards are pre-stored in the colorimeter's memory; by retrieving the chromaticity values stored in the memory, the color values of the n color cards can be obtained.
[0122] In the example where the n color cards are independent of the colorimeter, the color card values input by the user can be obtained through the interface of the colorimeter or another device connected to the colorimeter. This other device can be a terminal device with a colorimeter application (APP), such as a mobile phone or tablet. This terminal device can connect to the colorimeter wirelessly or via Bluetooth to receive instructions from the colorimeter or send data (e.g., the color card values input by the user) to the colorimeter. Optionally, in the example where the n color cards are independent of each other, before or after the user operates the colorimeter to illuminate a color card with its light source, the interface of the colorimeter or another device connected to the colorimeter prompts the user to input the color card value, and the color card value is obtained by acquiring the user-input color card value. Optionally, in the example where the n color cards are integrated into the same card, before or after the user operates the colorimeter to illuminate a card with its light source, the interface of the colorimeter or another device connected to the colorimeter prompts the user to continuously input the color card values of all color cards within that card.
[0123] Step S105: Obtain a preset function model, wherein the preset function model is a function model between chroma values and image brightness values.
[0124] Step S106: Based on the image brightness values of the n color cards, the color card values of the n color cards, and the preset function model, fit the parameter values of the preset function model.
[0125] In some examples, the colorimeter has a pre-stored preset function model y = f(x), where x is the image luminance value and y is the chrominance value. This preset function model can be a linear, quadratic, cubic, or other power function; no restrictions are placed here. By substituting the image luminance value x and chrominance value y corresponding to each color chart obtained in the previous steps into the model y = f(x), the parameter values of the preset model can be fitted.
[0126] In some examples, the colorimeter pre-stores function models of different orders. For instance, the colorimeter pre-stores preset function models for linear functions (y = f1(x), quadratic functions (y = f2(x)), and cubic functions (y = f3(x)). After acquiring the image luminance and chromaticity values based on the n color cards, the colorimeter also identifies the value of n, and then selects an (n-1)th power function model from the different order function models as the preset function model for fitting to obtain the parameter values. For example, after identifying that the number of color cards is 3, the colorimeter selects the quadratic function y = f2(x) for fitting.
[0127] Step S107: Irradiate coffee particles with the first spectral light source.
[0128] Optionally, the colorimeter also includes a support base located on the output light path of the first spectral light source, the support base including a support groove for holding coffee particles. After the user uses the colorimeter to measure a color chart to fit the parameter values of a preset function model within the colorimeter, coffee particles are loaded into the support groove, and the colorimeter is used to measure the coffee particles. Based on this measurement command, the first spectral light source outputs a light beam onto the coffee particles. In this text, coffee particles can refer to coffee beans, coffee powder, or other coffee particle objects of different shapes and sizes.
[0129] Step S108: The coffee particles are received by the photodetector to receive the reflected light from the first spectral light source, forming a first type of image of the coffee particles.
[0130] Step S109: Obtain the image brightness value of the coffee particles based on the first type of image of the coffee particles.
[0131] In some examples, the image brightness value of the coffee particles can be an overall brightness value corresponding to the first type of image. In examples where the light source in the colorimeter only contains a first spectral light source, a final brightness value, i.e., the image brightness value of the coffee particles, is determined based on the brightness values of each pixel in the first type of image of the coffee particles. Optionally, the average of the brightness values of at least one pixel or at least a portion of the brightness values of the pixels in the first type of image of the coffee particles is used as the image brightness value. Optionally, pixels corresponding to coffee particles are also identified from the first type of image of the coffee particles, and the brightness value of one pixel or the average of the brightness values of multiple pixels is selected from those pixels as the image brightness value of the coffee particles.
[0132] Alternatively, in some examples, the image brightness value of the coffee particles can be the brightness value of the pixels corresponding to multiple coffee particles in the first type of image.
[0133] Step S1010: Calculate the chromaticity value of the coffee particles based on the image brightness value of the coffee particles, the preset function model, and the parameter value.
[0134] By substituting the image brightness value x of the coffee particles into the preset function model with fitted parameter values, the chromaticity value y of the coffee particles can be calculated. In the example where the image brightness value of the coffee particles can be the brightness values of multiple corresponding pixels of coffee particles in the first type of image, the chromaticity value of each corresponding pixel of the coffee particles can be calculated according to the preset function model and the parameter values. The chromaticity value of the coffee particles can be the chromaticity value of these multiple pixels, or the chromaticity value that appears most frequently among these multiple pixels, or the average of the chromaticity values of these multiple pixels, etc., and is not limited here.
[0135] In this embodiment, colorimeters may experience component aging, displacement, or other factors during use, leading to inaccuracies in measuring the colorimetric values of coffee particles. Alternatively, different colorimeters may have different structures or components, resulting in inconsistent measurement results when measuring the colorimetric values of coffee particles. These problems cannot be solved by simply adding an offset to the colorimetric values of coffee particles measured by the colorimeter. In this application, the measurement accuracy of the colorimeter is improved by refitting the parameter values of a preset function model for calculating colorimetric values using measurements with at least two color charts. The colorimetric values of coffee particles are then calculated using the preset function model with the fitted parameter values. Furthermore, calibrating multiple colorimeters using the same set of color charts improves the consistency of measurements of the same coffee particle by multiple colorimeters.
[0136] Optionally, steps S101 to S106 are performed in the calibration mode of the colorimeter, and steps S107 to S1010 are performed in the measurement mode of the colorimeter. The parameter values in the preset function model used in each measurement mode are determined based on the parameter values fitted in the most recent calibration mode. In the example where the color chart is independent of the colorimeter, the calibration mode of the colorimeter may be entered only upon user triggering. In the example where the color chart is fixed inside the colorimeter, optionally, the calibration mode of the colorimeter may be entered only upon user triggering, or the calibration mode of the colorimeter may be executed automatically at fixed intervals, or the calibration mode of the colorimeter may be executed automatically before each measurement mode, or automatically after every preset number of measurement modes.
[0137] In some examples, the light source within the colorimeter may also include a second spectral light source with an emission spectrum different from that of the first spectral light source. The number of spectral light sources within the colorimeter may be greater than or equal to two. Optionally, different spectral light sources within the colorimeter are used to emit beams of light in different wavelength bands between 500 nm and 1100 nm. Experiments have shown that the reflection of the spectrum from coffee particles within this range is more beneficial for calculating the chromaticity value of the coffee particles. For example, the colorimeter may be equipped with at least a portion of six light sources whose emission spectra include wavelengths of 520 nm, 600 nm, 640 nm, 850 nm, 940 nm, and 1100 nm. At least two spectral light sources within the colorimeter are used to emit beams of light at different times, and the emitted light from each spectral light source is reflected by the coffee particles and received by the photodetector to form different images. Because coffee particles of the same roasting color have different reflectivities to light beams of different spectra, by generating different images from the reflected light emitted by coffee particles from multiple light sources of different spectra, and then using an algorithm to fuse the images corresponding to the light sources of different spectra to determine the colorimetric value of the coffee particles, the problem of poor stability in colorimetric value detection results caused by using a single spectrum can be effectively avoided. Optionally, the light source in the colorimeter includes a light source with an emission spectrum containing a wavelength of 850nm.
[0138] In some examples, the coffee particle color value detection method of this application further includes, before step S103: illuminating n color cards of different colors with a second spectral light source located within the colorimeter; receiving the reflected light from the second spectral light source by the n color cards respectively through a photodetector located within the colorimeter, forming a second type image of the n color cards. Correspondingly, step S103, when obtaining the image brightness value of the n color cards based on the first type image of the n color cards, specifically includes: obtaining the first type brightness value of the color card based on the first type image of each color card; obtaining the second type brightness value of the color card based on the second type image of each color card; and obtaining the image brightness value of the color card by weighted summation of the first type brightness value and the second type brightness value of the color card.
[0139] In some examples, each color chart has a first-class luminance value and a second-class luminance value, each representing a numerical value that characterizes the overall luminance of the first-class and second-class images of the color chart, respectively. The method for obtaining the first-class luminance value of the color chart based on its first-class image, and the method for obtaining the second-class luminance value based on its second-class image, can refer to the method for obtaining the image luminance value of the color chart based on its first-class image described in step S103 above. Then, the first-class and second-class luminance values of each color chart are weighted and summed to obtain an image luminance value characterizing the color chart. It is understood that if the colorimeter also includes other spectral light sources, such as a third spectral light source, a similar method can be used to obtain the third-class image of the color chart, and a third luminance value can be obtained based on this third-class image. Then, the first-class, second-class, and third-class luminance values of each color chart are weighted and summed to obtain an image luminance value characterizing the color chart. This process continues.
[0140] In some examples, the first and second type brightness values of each color chart are each represented by an array, characterizing the brightness of each pixel in the first type image and each pixel in the second type image of the color chart, respectively. When obtaining the image brightness value of the color chart by weighted summation of the first and second type brightness values, this specifically includes weighted summation of the brightness of pixels at the same position in the first and second type images of the color chart, resulting in a brightness array. For example, in one example, the colorimeter has five light sources with different emission spectra, corresponding to weights a1, a2, a3, a4, and a5, respectively. Each color chart acquires images of the first to fifth types corresponding to these five light sources. If the brightness values at the same pixel position in these five images are X1, X2, X3, X4, and X5, then the weighted summation of the brightness value at that pixel position is = a1*X1 + a2*X2 + a3*X3 + a4*X4 + a5*X5. Then, one of the brightness values in the brightness array is used as the image brightness value of the color chart, or the average value of at least some of the brightness values in the brightness array is used as the image brightness value of the color chart.
[0141] In some examples, the coffee particle color value detection method of this application further includes, before step S109: illuminating the coffee particles with the second spectral light source; receiving the reflected light from the coffee particles to the second spectral light source through the photodetector to form a second type image of the coffee particles. Correspondingly, step S109, when obtaining the image brightness value of the coffee particles based on the first type image of the coffee particles, specifically includes: obtaining a first type brightness value of the coffee particles based on the first type image of the coffee particles; obtaining a second type brightness value of the coffee particles based on the second type image of the coffee particles; and obtaining the image brightness value of the coffee particles by weighted summation of the first type brightness value and the second type brightness value.
[0142] The method for obtaining the image brightness value of the coffee particles by weighted summation of the first type of brightness value and the second type of brightness value can refer to the method described above for obtaining the image brightness value of the color card by weighted summation of the first type of brightness value and the second type of brightness value, and will not be repeated here.
[0143] Optionally, the raw data in the nth type image of the color chart and / or coffee particles used when acquiring the nth type brightness value of the color chart and / or coffee particles is calculated.
[0144] In some examples, the uneven distribution of the emitted beam from the light source within the colorimeter may cause variations in brightness in different areas of the image formed by the photodetector of the color chart and coffee particles, leading to errors in the analysis of their colorimetric values. Alternatively, in some examples, the colorimeter has a transparent glass element in the light path from the light source, with the color chart and coffee particles located on the side of the glass facing away from the light source. This transparent glass exhibits a degree of reflection, causing variations in brightness in different areas of the image formed by the photodetector of the color chart and coffee particles.
[0145] Optionally, brightness compensation based on pixel location is also performed on the images of the color chart and the coffee particles acquired by the photodetector. Specifically, for each spectral light source, the colorimeter pre-stores preset brightness compensation values for at least a portion of the pixel locations in the image corresponding to that spectral light source. After acquiring the initial brightness values of each pixel in the nth type of image corresponding to the nth spectral light source for each color chart or coffee particle, the preset brightness compensation values for each pixel corresponding to the nth spectral light source are also acquired based on the position of each pixel. The compensated brightness value is calculated based on the sum of the initial brightness value and the preset brightness compensation value. Then, the image brightness value of each color chart or coffee particle is calculated based on the compensated brightness values of each pixel in the nth type of image corresponding to the nth spectral light source.
[0146] Optionally, for each spectral light source, the colorimeter pre-stores a preset brightness compensation function L = f1(d) for each pixel, where d represents the Euclidean distance between the pixel and the center pixel of the image, and L represents the preset brightness compensation value for the pixel with that distance d. By obtaining the Euclidean distance between each pixel and the center pixel of the image, and the preset brightness compensation function, the preset brightness compensation value for that pixel can be calculated. Optionally, the preset brightness compensation function f1(d) can be a quadratic function, a cubic function, etc.
[0147] like Figure 2 As shown, Figure 2 This is a schematic diagram of an embodiment of some steps in the coffee particle color value detection method of this application. Taking the first type of image as an example, step S103, which obtains the image brightness values of the n color cards according to the first type of images of the n color cards, includes:
[0148] Step S201: Obtain the initial brightness value of each pixel on the first type image of each color card;
[0149] Optionally, the initial brightness value can be calculated based on the light intensity values of each pixel in a first-class image, which is specifically a raw image.
[0150] Step S202: Obtain the preset brightness compensation value corresponding to the position of each pixel.
[0151] Step S203: Calculate the compensated brightness value based on the initial brightness value of each pixel and the corresponding preset brightness compensation value.
[0152] Step S204: Use the compensated brightness value of at least one pixel of the first type image of the color card as the first type brightness value of the color card, or use the average value of the brightness values of at least some pixels of the first type image of the color card as the first type brightness value of the color card.
[0153] Step S205: Determine the image brightness value of the color card based on the first type of brightness value of the color card.
[0154] In an example where the light source within the colorimeter contains only a first spectral light source, the first type of brightness value for each color card can be the image brightness value of that color card. In an example where the light source within the colorimeter contains at least two different spectral light sources, the image brightness value of the color card is also calculated based on the brightness values of the color card corresponding to different spectral light sources, for example, by determining the image brightness value of the color card based on a weighted sum of the first type of brightness value and the second type of brightness value of the color card.
[0155] like Figure 3 As shown, Figure 3 This is a schematic diagram of an embodiment of some steps in the coffee particle color value detection method of this application. Taking a first type of image as an example, step S109, which obtains the image brightness value of the coffee particles based on the first type of image of the coffee particles, includes:
[0156] Step S301: Obtain the initial brightness value of the pixel corresponding to the coffee particle on the first type of image of the coffee particle;
[0157] Step S302: Obtain the preset brightness compensation value corresponding to the position of the corresponding coffee particle pixel;
[0158] Step S303: Calculate the compensated brightness value based on the initial brightness value of the pixel of the corresponding coffee particle and the corresponding preset brightness compensation value;
[0159] Step S304: Use the compensated brightness value of at least one pixel of the corresponding coffee particle as the first type of brightness value of the coffee particle, or use the average value of the compensated brightness values of the corresponding coffee particle as the first type of brightness value of the coffee particle.
[0160] Step S305: Determine the image brightness value of the coffee particles based on the first type of brightness value of the coffee particles.
[0161] In an example where the light source within the colorimeter contains only a first spectral light source, the first type of brightness value of the coffee particles can be the image brightness value of the coffee particles. In an example where the light source within the colorimeter contains at least two different spectral light sources, the image brightness value of the coffee particles is also calculated based on the brightness values of the coffee particles corresponding to different spectral light sources, for example, by determining the image brightness value of the coffee particles based on a weighted sum of the first type of brightness value and the second type of brightness value of the coffee particles.
[0162] In some examples, the colorimeter has a transparent glass in the light path of the light source, and the color chart is fixed on the inner wall of the transparent glass facing the light source. In examples where coffee particles are detected on the side of the transparent glass away from the light source, the brightness compensation values based on pixel positions in the images of the color chart and the coffee particles may differ. Therefore, for each spectral light source, the colorimeter pre-stores preset brightness compensation values for at least a portion of the pixel positions in the image corresponding to that spectral light source, as well as preset brightness compensation values for at least a portion of the pixel positions in the image corresponding to that spectral light source for the coffee particles. During brightness compensation, different preset brightness compensation values are used to compensate for pixels at the same position in the color chart image and the coffee particle image obtained from the same spectral light source.
[0163] In scenarios where coffee particles are coffee beans, because coffee beans are elliptical objects, the distance from their surface to the sensor will not be perfectly uniform. Since colorimetry is measured by the intensity of light reflected to the sensor (i.e., image brightness), the distance to the sensor affects the received intensity value, leading to inaccurate colorimetry measurements of the coffee beans. In some examples, the coffee particle colorimetry detection method of this application also performs depth-based brightness compensation on the image of the coffee beans. For example... Figure 4 As shown, Figure 4 This is a schematic diagram of an embodiment of some steps in the coffee particle color value detection method of this application. Optionally, taking a first type of image as an example, step S109, which obtains the image brightness value of the coffee particles based on the first type of image of the coffee particles, includes:
[0164] Step S401: Obtain the initial brightness value of the pixel corresponding to the coffee particle on the first type of image of the coffee particle.
[0165] Step S402: Obtain the depth value of the pixel corresponding to the coffee particle, wherein the depth value indicates the distance between the surface of the coffee particle corresponding to the pixel and the photodetector or the light source.
[0166] Step S403: Obtain the preset brightness compensation value corresponding to the depth value based on the depth value of the pixel;
[0167] Step S404: Calculate the compensated brightness value based on the initial brightness value of the pixel and the preset brightness compensation value;
[0168] Step S405: Use the compensated brightness value of at least one pixel of the corresponding coffee particle as the first type of brightness value of the coffee particle, or use the average value of the compensated brightness values of the corresponding coffee particle as the first type of brightness value of the coffee particle.
[0169] Step S406: Determine the image brightness value of the coffee particles based on the first type of brightness value of the coffee particles.
[0170] In an example where the light source within the colorimeter contains only a first spectral light source, the first type of brightness value of the coffee particles can be the image brightness value of the coffee particles. In an example where the light source within the colorimeter contains at least two different spectral light sources, the image brightness value of the coffee particles is also calculated based on the brightness values of the coffee particles corresponding to different spectral light sources, for example, by determining the image brightness value of the coffee particles based on a weighted sum of the first type of brightness value and the second type of brightness value of the coffee particles.
[0171] In step S402, optionally, a distance detector, such as a monocular camera ranging device, a binocular camera ranging device, a structured light ranging device, a TOF ranging device, or radar, is also provided in the colorimeter near the photodetector or the light source to measure the distance between each coffee particle and the distance detector. The colorimeter stores a preset brightness compensation function L = f2(d) for depth values, where d represents the depth value of the pixel, and L represents the preset brightness compensation value for the pixel with that depth value d. By obtaining the depth value of each pixel and the preset brightness compensation function, the preset brightness compensation value for that pixel can be calculated. Optionally, the preset brightness compensation function can be a linear function, a quadratic function, a cubic function, etc.
[0172] Alternatively, in step S402, the distance between the coffee particle surface and the photodetector or the light source can be estimated using an algorithm. For example, as... Figure 5 As shown, Figure 5This is a schematic diagram of an embodiment where a photodetector acquires an image of a coffee bean corresponding to a specific spectral light source. Since coffee beans are generally elliptical, a relationship function d2 = f3(d1) between the vertical distance d2 and the horizontal distance d1 between other locations on the surface and the center is obtained through testing a large number of coffee beans. This relationship function is pre-stored in the colorimeter. When the photodetector acquires an image of the coffee bean corresponding to each spectral light source, an image algorithm identifies the central and edge regions of the coffee bean in the image. Since the surface of the coffee bean is generally smoothed before colorimetric measurements are performed, it is assumed that the center of the coffee bean in the image is located on the same plane, denoted by xy, with the direction to the photodetector being the z-axis. The distance d0 between this plane and the photodetector or light source is known and pre-stored in the colorimeter. Therefore, the distance d3 = d0 + d2 = d0 + f3(d1) between a certain location on the coffee bean surface and the photodetector or light source. Thus, based on the projected distance d1 between a certain location on the coffee bean surface and the center in the xy plane, the projected distance d2 between that location and the center on the z-axis can be obtained. Then, the distance between that location and the photodetector or light source can be calculated. The colorimeter stores a preset brightness compensation function L = f3(d3) for depth values. Alternatively, the colorimeter stores a preset brightness compensation function L = f4(d2) for depth values. By estimating d2 or d3 for each pixel and using the preset brightness compensation function, the preset brightness compensation value for that pixel can be calculated. Optionally, the preset brightness compensation function can be a linear, quadratic, or cubic function, etc. For example, L = f4(d2) = a * d2, where a is a constant.
[0173] In some examples where brightness compensation is required due to different factors, the initial brightness can be compensated multiple times. For instance, in an example where the initial brightness value of the same pixel needs to be compensated based on both pixel position and pixel depth, the initial brightness value of the pixel can be simultaneously added to both the preset brightness compensation value obtained based on pixel position and the preset brightness compensation value obtained based on pixel depth to obtain the compensated brightness value.
[0174] In some examples, using different grind sizes yields coffee powder with different particle sizes, and these particle sizes affect the measurement of colorimetric values. Coffee powder with the same actual color value but different particle sizes will produce different measured colorimetric values. Optionally, the coffee particle colorimetric value detection method of this application also performs colorimetric value compensation on the coffee particle colorimetric values. For example... Figure 6 As shown, Figure 6This is a schematic diagram of an embodiment of some steps in the coffee particle color value detection method of this application. Optionally, the colorimeter also pre-stores a relationship function y = f5(x) between the colorimetric compensation value and the particle size of the coffee particles, where x represents the particle size of the coffee particles and y represents the colorimetric compensation value. Step S1010 calculates the colorimetric value of the coffee particles based on the image brightness value of the coffee particles, the preset function model, and the parameter values, and then further includes:
[0175] Step S1011: Obtain the particle size of the coffee particles based on the first type of image of the coffee particles;
[0176] Step S1012: Calculate the chromaticity compensation value of the coffee particles based on the particle size of the coffee particles and the relationship function between the chromaticity compensation value and the particle size of the coffee particles.
[0177] Step S1013: Calculate the compensated chromaticity value of the coffee particles based on the chromaticity value of the coffee particles and the chromaticity value compensation value;
[0178] Step S1014: Display the compensated chromaticity value through the interactive interface of the colorimeter.
[0179] The particle size of each coffee particle in the first type of image may vary. Optionally, the particle size of each coffee particle in the first type of image can be calculated, and a chromaticity compensation value for each particle size can be calculated. This chromaticity compensation value is then added to the chromaticity value of the pixel corresponding to the respective particle size. Alternatively, the average particle size of each coffee particle in the first type of image can be calculated, and a chromaticity compensation value for this average particle size can be calculated. This chromaticity compensation value is then added to the chromaticity value of each coffee particle. The interpretation of the chromaticity value of the coffee particles can be found in step S1010, and will not be repeated here.
[0180] In some examples, piecewise functions can be used to fit different color card value ranges. When measuring the colorimetric value of coffee particles, a corresponding segment of the piecewise function is also used for measurement, which makes the measurement results more stable. Optionally, the colorimeter has a preset function model for each segment of the piecewise function, and each preset function model is for different color card value ranges and different brightness value ranges. In step 105, when obtaining the preset function model, the corresponding preset function model is selected according to the color card values of the n color cards. For example, the n color cards are specifically four color cards with color card values of 30, 90, 110, and 140. During calibration, the 30 and 90 color cards are used to select the corresponding first preset function model for fitting to obtain the parameter values of the first preset function model; the 110 and 140 color cards are used to select the corresponding second preset function model for fitting to obtain the parameter values of the second preset function model. In step S1010, when calculating the chromaticity value of the coffee particles based on their image brightness value, the preset function model, and the parameter values, the corresponding preset function model and parameter values are selected based on the image brightness value of the coffee particles; the chromaticity value of the coffee particles is then calculated based on the selected preset function model and parameter values, and the brightness value of the coffee particles. For example, when the image brightness value of the coffee particles falls within a first numerical range, the corresponding first preset function model and its parameter values are selected to calculate the chromaticity value; when the image brightness value of the coffee particles falls within a second numerical range, the corresponding second preset function model and its parameter values are selected to calculate the chromaticity value. Optionally, different preset function models in the piecewise function can be of the same order or different orders. Alternatively, different preset functions in the piecewise function can be the same function, but the parameter values obtained by fitting segments may be the same or different. For example, the first preset function model and the second preset function model are the same function model, but when fitting, the color card values of 30 and 90 color cards and the image brightness values are used to fit the parameter values of the first preset function model, and the color card values of 110 and 140 color cards and the image brightness values are used to fit the parameter values of the second preset function model.
[0181] This application also provides a colorimeter. For example... Figure 7 As shown, Figure 7 This is a schematic diagram of the logical framework of one embodiment of the colorimeter of this application. The colorimeter 70 includes a light source group 71 and a photodetector 72, wherein the light source group 71 includes a first spectral light source 711. In some examples, the light source group 71 includes at least two different spectral light sources, which can be referred to the explanation of spectral light sources above, and will not be repeated here. The colorimeter 70 is used to perform the coffee particle color value detection method according to any one of claims 1 to 15.
[0182] Specifically, in one example, the colorimeter 70 further includes a processing module 73. A first spectral light source 711 is used to illuminate n color cards of different colors, where n is an integer greater than 1. A photodetector 72 is used to receive the reflected light from the first spectral light source from the n color cards, forming a first type of image of the n color cards. The processing module 73 is used to obtain the image brightness values of the n color cards based on the first type of images of the n color cards; obtain the color card values of the n color cards; obtain a preset function model, which is a function model between chromaticity values and image brightness values; and fit the parameter values of the preset function model based on the image brightness values of the n color cards, the color card values of the n color cards, and the preset function model. The first spectral light source 711 is also used to illuminate coffee particles. The photodetector 72 is also used to receive the reflected light from the coffee particles to the first spectral light source, forming a first type of image of the coffee particles. The processing module 73 is further configured to obtain the image brightness value of the coffee particles based on the first type of image of the coffee particles; and to calculate the chromaticity value of the coffee particles based on the image brightness value of the coffee particles, the preset function model, and the parameter value.
[0183] In some examples, the first spectral light source 711 illuminates n color cards of different colors, specifically, it illuminates n color cards of different colors simultaneously; the first type image of the n color cards is a single frame of the first type image. The processing module 73 is further configured to determine the positions of the n color cards in the first type image based on the grayscale values in the first type image; and to obtain the first type brightness value of each color card based on the positions of the n color cards in the first type image; wherein the first type brightness value of each color card is the brightness value of at least one pixel corresponding to the color card in the first type image or the average brightness value of at least some pixels corresponding to the color card, wherein the image brightness value of each color card is determined based on the first type brightness value of the color card.
[0184] In some examples, the n color cards are integrated on the same card, located in different areas of the same card, and the card is independent of the colorimeter. The colorimeter also includes an interactive interface 74. Obtaining the color card values of the n color cards includes: obtaining the color card values of the n color cards input by the user through the interactive interface of the colorimeter or other devices connected to the colorimeter.
[0185] In some examples, the colorimeter further includes a sidewall surrounding the central axis of the outgoing light path of the first spectral light source, and the n color cards are different regions with different colors located on the inner surface of the sidewall. The color card values of the n color cards are pre-stored in the memory of the colorimeter; obtaining the color card values of the n color cards includes: obtaining the color card values of the n color cards stored in the memory.
[0186] In some examples, the n color cards are independent of each other and independent of the colorimeter. The first spectral light source 711 illuminates the n color cards of different colors, specifically illuminating the n color cards of different colors at different time periods. The first type of image of the n color cards is n frames of the first type of image. The colorimeter also includes an interactive interface 74. Obtaining the color card values of the n color cards includes: before or after illuminating each color card by the first spectral light source, prompting the user to input the color card value of the color card through the interactive interface of the colorimeter or other devices connected to the colorimeter; and obtaining the color card value of the color card input by the user.
[0187] In some examples, the processing module 73 is also used to remind the user that the input color card value is incorrect through the interactive interface when the difference between the color card values of any two color cards input by the user is less than a preset value; or, when the parameter values of the fitted preset function model do not meet the preset value range, to remind the user that the input color card value is incorrect through the interactive interface.
[0188] In some examples, the light source group 71 further includes a second spectral light source 712. The second spectral light source 712 is used to illuminate n color cards of different colors, wherein the first spectral light source and the second spectral light source are used to emit light beams of different spectra located between 500nm and 940nm, respectively. The photodetector is also used to receive the reflected light from the n color cards onto the second spectral light source 712, forming a second type image of the n color cards. The second spectral light source 712 is also used to illuminate the coffee particles; the photodetector 72 is also used to receive the reflected light from the coffee particles onto the second spectral light source, forming a second type image of the coffee particles. When the processing module 73 obtains the image brightness values of the n color cards based on the first type images of the n color cards, it is also used to obtain the first type brightness value of each color card based on the first type image of each color card; obtain the second type brightness value of each color card based on the second type image of each color card; and obtain the image brightness value of the color card by weighted summation of the first type brightness value and the second type brightness value. When the processing module 73 obtains the image brightness value of the coffee particles based on the first type of image of the coffee particles, it is further configured to obtain the first type of brightness value of the coffee particles based on the first type of image of the coffee particles; obtain the second type of brightness value of the coffee particles based on the second type of image of the coffee particles; and obtain the image brightness value of the coffee particles by weighted summation of the first type of brightness value and the second type of brightness value.
[0189] In some examples, the colorimeter pre-stores function models of different orders; when acquiring the preset function model, the processing module 73 identifies the value of n; and selects the preset function model from the function models of different orders based on the value of n, wherein the preset function model is an n-1 power function model. Optionally, the value of n is 2 or 3.
[0190] In some examples, when the processing module 73 obtains the image brightness value of the coffee particles based on the first type of image of the coffee particles, it is configured to: obtain the initial brightness value of the pixel corresponding to the coffee particle in the first type of image of the coffee particles; obtain the preset brightness compensation value corresponding to the position of the pixel of the corresponding coffee particle; calculate the compensated brightness value based on the initial brightness value of the pixel of the corresponding coffee particle and the corresponding preset brightness compensation value; take the compensated brightness value of at least one pixel of the pixel of the corresponding coffee particle as the first type brightness value of the coffee particle, or take the average value of the compensated brightness values of the pixels of the corresponding coffee particle as the first type brightness value of the coffee particle; and determine the image brightness value of the coffee particles based on the first type brightness value of the coffee particles.
[0191] In some examples, when the processing module 73 obtains the image brightness values of the n color cards according to the first type images of the n color cards, it is configured to: obtain the initial brightness value of each pixel on the first type image of each color card; obtain a preset brightness compensation value corresponding to the position of each pixel; calculate the compensated brightness value according to the initial brightness value of each pixel and the corresponding preset brightness compensation value; take the compensated brightness value of at least one pixel of the first type image of the color card as the first type brightness value of the color card, or take the average value of the brightness values of at least some pixels of the first type image of the color card as the first type brightness value of the color card; and determine the image brightness value of the color card according to the first type brightness value of the color card.
[0192] In some examples, when the processing module 73 obtains the image brightness value of the coffee particles based on the first type image of the coffee particles, it is configured to: obtain the initial brightness value of the pixel corresponding to the coffee particle in the first type image of the coffee particles; obtain the depth value of the pixel corresponding to the coffee particle, the depth value indicating the distance between the surface of the coffee particle corresponding to the pixel and the photodetector or the light source; obtain a preset brightness compensation value corresponding to the depth value based on the depth value of the pixel; calculate the compensated brightness value based on the initial brightness value of the pixel and the preset brightness compensation value; use the compensated brightness value of at least one pixel of the pixel corresponding to the coffee particle as the first type brightness value of the coffee particle, or use the average value of the compensated brightness values of the pixels of the coffee particle as the first type brightness value of the coffee particle; and determine the image brightness value of the coffee particles based on the first type brightness value of the coffee particles.
[0193] In some examples, when the processing module 73 obtains the image brightness value of the coffee particles based on the first type of image of the coffee particles, it is configured to: obtain the initial brightness value of the pixel corresponding to the coffee particle in the first type of image of the coffee particles; determine the preset brightness compensation value corresponding to the initial brightness value based on the initial brightness value of the pixel; calculate the compensated brightness value based on the initial brightness value of the pixel and the preset brightness compensation value; and use the compensated brightness value of at least one pixel of the corresponding coffee particle as the first type of brightness value of the coffee particle, or use the average value of the compensated brightness values of the corresponding coffee particle as the first type of brightness value of the coffee particle.
[0194] The image brightness value of the coffee particles is determined based on the first type of brightness value of the coffee particles.
[0195] In some examples, the colorimeter also pre-stores a relationship function between the chromaticity compensation value and the particle size of the coffee particles. After calculating the chromaticity value of the coffee particles based on the image brightness value of the coffee particles, the preset function model, and the parameter values, the processing module 73 is further configured to: obtain the particle size of the coffee particles based on the first type of image of the coffee particles; calculate the chromaticity compensation value of the coffee particles based on the particle size of the coffee particles and the relationship function between the chromaticity compensation value and the particle size of the coffee particles; calculate the compensated chromaticity value of the coffee particles based on the chromaticity value of the coffee particles and the chromaticity compensation value; and display the compensated chromaticity value through the interactive interface of the colorimeter.
[0196] In some examples, the colorimeter has preset function models for different chromaticity value ranges and different luminance value ranges. When acquiring the preset function model, the processing module 73 selects the corresponding preset function model based on the color values of the n color charts. When calculating the chromaticity value of the coffee particles based on the image luminance value of the coffee particles, the preset function model, and the parameter values, the processing module 73 performs the following: selects the corresponding preset function model and parameter values based on the image luminance value of the coffee particles; and calculates the chromaticity value of the coffee particles based on the selected preset function model and parameter values, and the luminance value of the coffee particles.
[0197] For an explanation of the coffee particle detection method, please refer to the explanation of the coffee particle device above, which will not be repeated here.
[0198] like Figure 8 and Figure 9 As shown, Figure 8 This is a schematic diagram of the external structure of one embodiment of the colorimeter of this application. Figure 9 yes Figure 8 The diagram shows a cross-sectional view of the colorimeter. The colorimeter 80 includes a hollow cylindrical structure 81. This hollow cylindrical structure 81 can be cylindrical, square, or other shapes; no limitation is made herein.
[0199] The hollow cylindrical structure 81 includes a first end 811 and a second end 812 facing each other, and a sidewall 813 connecting the first end 811 and the second end 812. The light source group and the photodetector are disposed at the first end and face the second end. The sidewall surrounds the central axis of the light path emitted by the light source group. The end face of the second end has an opening 8121, and the opening is covered with a transparent glass capable of transmitting the emitted light from the light source group.
[0200] In this colorimeter, the light source group 83 and the photodetector 84 are disposed at the first end 811 and face the second end 812. The sidewall surrounds the central axis of the outgoing light path of the light source group 83. The end face of the second end 812 has an opening, and the opening is covered with a transparent glass 85 capable of transmitting the outgoing light from the light source group 83. The light source group 83 includes at least one spectral light source. In an example where the light source group 83 includes at least two spectral light sources 12, these at least two spectral light sources 12 are respectively used to emit light beams in different wavelength bands between 500nm and 1100nm. For example, the colorimeter is provided with at least a portion of six light sources whose outgoing spectra respectively include wavelengths of 520nm, 600nm, 640nm, 850nm, 940nm, and 1100nm. Optionally, each light source of the light source group 83 is disposed around the photodetector 84 at the first end 811. Optionally, the receiving side of the photodetector 84 is also provided with a light homogenizer 86, which is used to transmit the emitted light beam of the light source group 83 and reflect light beams of other wavelengths to reduce interference from ambient light.
[0201] When a user needs to detect the colorimetric value of coffee particles, the hollow cylindrical structure 81 in the cap can be directly pressed against the surface of the coffee particles. Due to the transparent glass, when the hollow cylindrical structure 81 is pressed against the coffee particles, each coffee particle is in contact with the transparent glass, which can improve the consistency of the distance between the coffee particles and the photodetector, thereby improving the accuracy of the colorimetric value measurement, and also making it more convenient for the user to measure the coffee particles.
[0202] Or, in some examples, such as Figure 10 As shown, Figure 10 This is a schematic diagram of the support base of a colorimeter according to one embodiment of this application. The colorimeter also includes a support base 82, which is used for detachable connection with the second end 812. Figure 11 As shown, Figure 11 This is a cross-sectional structural diagram of a colorimeter according to one embodiment of this application. The support base 82 includes a support groove 821 for holding coffee particles. The light-transmitting glass 85 on the end face of the second end 812 can be used to smooth out coffee particles in the support groove 821 that are higher than the opening of the support groove 821. When the support base 82 and the second end 812 are connected, the light-transmitting glass 95 is used to cover the opening of the support groove 821. The emitted light from the light source group 83 is transmitted through the light-transmitting glass 95 and reflected back to the first end 811 by the coffee particles in the support groove 821, and is received by the photodetector 84. The setting of the light-transmitting glass 85 allows the user to easily smooth the surface of the coffee particles in the support groove 821, improves the consistency of the distance between the coffee particles and the photodetector, and thus improves the measurement accuracy of the colorimetric value.
[0203] Optionally, the n color cards are different regions with different colors located on the inner surface of the sidewall, and the inner surface of the sidewall is matte. The matte surface reduces the reflection of the light beam reflected by the coffee particles during the measurement of the coffee particle colorimetric value, thus reducing the impact on the measurement results. Optionally, the inner surface of the sidewall is made of plastic or metal. Optionally, the inner surface of the sidewall is a matte gray surface after aluminum alloy anodizing, for example, a matte gray aluminum alloy with a color value of 30 or 90 after anodizing.
[0204] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for detecting the color value of coffee particles, characterized in that, include: The first spectral light source located inside the colorimeter illuminates n color cards of different colors, where n is an integer greater than 1; The first type of image of the n color cards is formed by receiving the reflected light from the first spectral light source by the photodetector located in the colorimeter. The image brightness values of the n color cards are obtained respectively based on the first type of images of the n color cards; Obtain the color values of the n color cards; Obtain a preset function model, which is a function model between chroma values and image brightness values; Based on the image brightness values of the n color cards, the color card values of the n color cards, and the preset function model, the parameter values of the preset function model are fitted to obtain the parameter values of the preset function model; The coffee particles are irradiated by the first spectral light source; A first type of image of the coffee particles is formed by receiving the reflected light from the first spectral light source by the photodetector. The image brightness value of the coffee particles is obtained based on the first type of image of the coffee particles; The chromaticity value of the coffee particles is calculated based on the image brightness value of the coffee particles, the preset function model, and the parameter value.
2. The method for detecting the color value of coffee particles according to claim 1, characterized in that, The step of illuminating n color cards of different colors with a first spectral light source located in the colorimeter specifically means illuminating n color cards of different colors simultaneously with the first spectral light source; the first type image of the n color cards is a single frame of the first type image. The method further includes: Based on the grayscale values in the first type of image, determine the positions of the n color cards in the first type of image; Based on the positions of the n color cards in the first type of image, a first type of brightness value is obtained for each color card; wherein, the first type of brightness value for each color card is the brightness value of at least one pixel corresponding to the color card in the first type of image or the average brightness value of at least some pixels corresponding to the color card, and the image brightness value of each color card is determined based on the first type of brightness value of the color card.
3. The method for detecting the color value of coffee particles according to claim 2, characterized in that, The n color cards are integrated on the same card, located in different areas of the same card, and the card is independent of the colorimeter; The process of obtaining the color card values of the n color cards includes: The color values of the n color cards input by the user can be obtained through the interactive interface of the colorimeter or other devices connected to the colorimeter, or the color values of the n color cards sent by the device can be received.
4. The method for detecting the color value of coffee particles according to claim 2, characterized in that, The colorimeter also includes a sidewall surrounding the central axis of the outgoing light path of the first spectral light source, and the n color cards are different regions with different colors located on the inner surface of the sidewall; The color values of the n color cards are pre-stored in the memory of the colorimeter; The step of obtaining the color card values of the n color cards includes: obtaining the color card values of the n color cards stored in the memory.
5. The method for detecting the color value of coffee particles according to claim 1, characterized in that, The n color cards are independent of the colorimeter; The step of illuminating n color cards of different colors with a first spectral light source located in the colorimeter specifically involves illuminating the n color cards of different colors with the first spectral light source at different time periods; the first type of image of the n color cards consists of n frames of first type images. The process of obtaining the color card values of the n color cards includes: Before or after each color card is irradiated by the first spectral light source, the user is prompted to input the color card value of the color card through the colorimeter or the interactive interface of other devices connected to the colorimeter; Obtain the color card value input by the user.
6. The method for detecting the color value of coffee particles according to claim 3 or 5, characterized in that, The method further includes: When the difference between the color values of any two color cards entered by the user is less than a preset value, the user is notified via the interactive interface that the entered color card value is incorrect; or, When the parameter values of the fitted preset function model do not meet the preset numerical range, the user is notified through the interactive interface that the input color card value is incorrect.
7. The method for detecting the color value of coffee particles according to any one of claims 1 to 5, characterized in that, The method further includes: The colorimeter illuminates n color cards of different colors using a second spectral light source located within it, wherein the first and second spectral light sources are used to emit light beams of different spectra between 500 nm and 1100 nm, respectively. The photodetector located inside the colorimeter receives the reflected light from the second spectral light source from the n color cards respectively, forming a second type of image of the n color cards; The coffee particles are irradiated by the second spectral light source; The photodetector receives the reflected light from the coffee particles to the second spectral light source, forming a second type of image of the coffee particles; The step of obtaining the image brightness values of the n color cards based on the first type of images of the n color cards includes: Based on the first type of image of each color card, obtain the first type of brightness value of the color card; Based on the second type of image of each color card, obtain the second type of brightness value of the color card; The image brightness value of the color card is obtained by weighted summation of the first type of brightness value and the second type of brightness value of the color card; as well as, The step of obtaining the image brightness value of the coffee particles based on the first type of image of the coffee particles includes: Based on the first type of image of the coffee particles, obtain the first type of brightness value of the coffee particles; Based on the second type of image of the coffee particles, obtain the second type of brightness value of the coffee particles; The image brightness value of the coffee particles is obtained by weighted summation of the first type of brightness value and the second type of brightness value of the coffee particles.
8. The method for detecting the color value of coffee particles according to any one of claims 1 to 6, characterized in that, The colorimeter has pre-stored function models of different orders; obtaining the preset function model includes: Identify the value of n; The preset function model is selected from the function models of different powers based on the value of n, wherein the preset function model is an n-1 power function model.
9. The method for detecting the color value of coffee particles according to claim 8, characterized in that, The value of n is either 2 or 3.
10. The method for detecting the color value of coffee particles according to claim 1, characterized in that, The step of obtaining the image brightness value of the coffee particles based on the first type of image of the coffee particles includes: Obtain the initial brightness value of the pixel corresponding to the coffee particle on the first type of image of the coffee particle; Based on the position of the corresponding coffee particle's pixel, obtain the preset brightness compensation value corresponding to the position; The compensated brightness value is calculated based on the initial brightness value of the pixel corresponding to the coffee particle and the corresponding preset brightness compensation value; The compensated brightness value of at least one pixel of the corresponding coffee particle is used as the first type of brightness value of the coffee particle, or the average value of the compensated brightness values of the corresponding coffee particle is used as the first type of brightness value of the coffee particle. The image brightness value of the coffee particles is determined based on the first type of brightness value of the coffee particles.
11. The method for detecting the color value of coffee particles according to claim 1 or 10, characterized in that, The step of obtaining the image brightness values of the n color cards based on the first type of images of the n color cards includes: Obtain the initial brightness value of each pixel on the first type image of each color chart; Based on the position of each pixel, a preset brightness compensation value corresponding to the position is obtained; The compensated brightness value is calculated based on the initial brightness value of each pixel and the corresponding preset brightness compensation value; The compensated brightness value of at least one pixel of the first type image of the color chart is used as the first type brightness value of the color chart, or the average value of the brightness values of at least some pixels of the first type image of the color chart is used as the first type brightness value of the color chart. The image brightness value of the color card is determined based on the first type of brightness value of the color card.
12. The method for detecting the color value of coffee particles according to claim 1, characterized in that, The step of obtaining the image brightness value of the coffee particles based on the first type of image of the coffee particles includes: Obtain the initial brightness value of the pixel corresponding to the coffee particle on the first type of image of the coffee particle; Obtain the depth value of the pixel corresponding to the coffee particle, wherein the depth value indicates the distance between the surface of the coffee particle corresponding to the pixel and the photodetector or the light source; Obtain the preset brightness compensation value corresponding to the depth value based on the depth value of the pixel; The compensated brightness value is calculated based on the initial brightness value of the pixel and the preset brightness compensation value; The compensated brightness value of at least one pixel of the corresponding coffee particle is used as the first type of brightness value of the coffee particle, or the average value of the compensated brightness values of the corresponding coffee particle is used as the first type of brightness value of the coffee particle. The image brightness value of the coffee particles is determined based on the first type of brightness value of the coffee particles.
13. The method for detecting the color value of coffee particles according to claim 1, characterized in that, The step of obtaining the image brightness value of the coffee particles based on the first type of image of the coffee particles includes: Obtain the initial brightness value of the pixel corresponding to the coffee particle on the first type of image of the coffee particle; Based on the initial brightness value of the pixel, determine the preset brightness compensation value corresponding to the initial brightness value; The compensated brightness value is calculated based on the initial brightness value of the pixel and the preset brightness compensation value; The compensated brightness value of at least one pixel of the corresponding coffee particle is used as the first type of brightness value of the coffee particle, or the average value of the compensated brightness values of the corresponding coffee particle is used as the first type of brightness value of the coffee particle. The image brightness value of the coffee particles is determined based on the first type of brightness value of the coffee particles.
14. The method for detecting the color value of coffee particles according to claim 1, characterized in that, The colorimeter also has a pre-stored function relating the colorimetric compensation value and the particle size of the coffee particles; The step of calculating the chromaticity value of the coffee particles based on the image brightness value of the coffee particles, the preset function model, and the parameter values, further includes: The particle size of the coffee particles is obtained based on the first type of image of the coffee particles; The chromaticity compensation value of the coffee particles is calculated based on the particle size of the coffee particles and the relationship function between the chromaticity compensation value and the particle size of the coffee particles. Calculate the compensated chromaticity value of the coffee particles based on the chromaticity value of the coffee particles and the chromaticity value compensation value; The compensated chromaticity value is displayed through the interactive interface of the colorimeter.
15. The method for detecting the color value of coffee particles according to claim 1, characterized in that, The colorimeter has preset function models for different chromaticity value ranges and different luminance value ranges; The step of obtaining the preset function model includes: selecting the corresponding preset function model based on the color card values of the n color cards; The step of calculating the chromaticity value of the coffee particles based on the image brightness value of the coffee particles, the preset function model, and the parameter values includes: Select the corresponding preset function model and parameter values based on the image brightness values of the coffee particles; The chromaticity value of the coffee particles is calculated based on the selected preset function model and parameter values, as well as the brightness value of the coffee particles.
16. A colorimeter, characterized in that, It includes a light source group and a photodetector, wherein the light source group includes a first spectral light source; The colorimeter is used to perform the coffee particle color value detection method according to any one of claims 1 to 15.
17. The colorimeter according to claim 16, characterized in that, The colorimeter includes: The main structure is in the form of a hollow cylinder, including a first end and a second end opposite to each other, and a sidewall connecting the first end and the second end. The light source group and the photodetector are disposed at the first end and face the second end. The sidewall surrounds the central axis of the outgoing light path of the light source group. The end face of the second end is provided with an opening, and the opening is covered with a light-transmitting glass that can transmit the outgoing light of the light source group.
18. The colorimeter according to claim 17, characterized in that, The colorimeter also includes a support base, which is used for detachable connection with the second end; The support base includes a support groove for carrying coffee particles. The light-transmitting glass on the end face of the second end can be used to scrape the coffee particles in the support groove that are higher than the opening of the support groove. When the support base and the second end are connected, the light-transmitting glass is used to cover the opening of the support groove. The light emitted from the light source group is transmitted through the light-transmitting glass and reflected back to the first end by the coffee particles in the support groove, and is received by the photodetector.
19. The colorimeter according to claim 17, characterized in that, The n color cards are different areas with different colors located on the inner surface of the side wall, and the inner surface of the side wall has a matte finish.