A natural essential oil waxiness defect detection method based on image segmentation

CN122866077APending Publication Date: 2026-10-02GUANGZHOU SCENT-E TRADING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611048083.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-15
Publication Date
2026-10-02

AI Technical Summary

Technical Problem

[0004]然而,在实际检测应用中,上述方法大多局限于对光衰减或散射的单一维度测量,或依赖操作人员的主观经验判断,未充分考虑蜡质晶体与气泡、色素析出物等非蜡质浑浊源在物理性质上的本质差异,方法本身不具备区分两者的物理基础,例如,常规图像检测法虽能获取晶体形态信息,但因蜡质晶体与气泡、色素微粒等在普通亮场或暗场照明下缺乏灰度特征的根本性差异,图像分割和识别难以准确区分,易将非蜡质颗粒误判为蜡质晶体,因此,在样品基质复杂或干扰物并存的情况下,上述方法容易出现蜡质含量高估或误判,导致精油蜡质的定量准确性不足,难以支撑天然精油的品质分级和工艺调控需求

Benefits of technology

[0049]本申请通过构建正交透射图像数据与亮场透射图像数据的图像检测方法,并结合偏振响应与散射响应的联合表征,将蜡质晶体的双折射特征与光学散射特征映射至统一分析框架中,实现蜡质信号与气泡、色素微粒等干扰成分的物理维度分离,从而提升蜡质晶体识别的稳定性与准确性。同时,本申请通过引入基于类间方差优化的分割阈值方法,并结合连通域分析与区域级统计修正方法,将像素级偏振响应转换为具有空间拓扑结构的蜡质晶体连通域对象,实现由灰度信号检测向晶体结构识别的转化,在保证全局分割最优性的同时增强弱双折射晶体的检出能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122866077A_ABST
    Figure CN122866077A_ABST
Patent Text Reader

Abstract

The application provides a natural essential oil wax defect detection method based on image segmentation, applied to the technical fields of image detection and natural essential oil quality detection, obtains orthogonal transmission image data and bright field transmission image data under the condition of temperature-controlled cooling crystallization, constructs a candidate wax area based on the spatial alignment and response difference of the dual-mode images, realizes the identification and quantitative evaluation of wax crystals by combining the polarized bright field response ratio analysis and multi-scale feature extraction, and generates the wax content value, wax type and defect grade, so as to realize the accurate detection of the natural essential oil wax.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image detection and natural essential oil quality detection technology, and in particular to a method for detecting wax defects in natural essential oils based on image segmentation. Background Technology

[0002] With the increasingly widespread application of natural essential oils in high-end daily chemicals, food and beverages, and aromatherapy, product quality control has become a core focus of the industry. Waxes, as a common trace component in natural essential oils, can crystallize and precipitate during low-temperature storage or processing, leading to product turbidity or sedimentation, which seriously affects product appearance, consumer acceptance, and shelf stability. Therefore, accurate detection of the wax content and type in natural essential oils is a key technical link in achieving product quality grading, process optimization, and control of storage and transportation conditions.

[0003] In existing detection technologies, methods such as low-temperature turbidity method, sensory visual method, multi-wavelength spectroscopy and image detection method are commonly used to evaluate the degree of wax precipitation in natural essential oils. These methods can reflect the degree of wax precipitation to a certain extent by measuring light scattering signals, making empirical comparisons or image morphology analysis, and achieving simple quality judgment.

[0004] However, in practical testing applications, most of the above methods are limited to measuring light attenuation or scattering in a single dimension, or rely on the subjective experience of operators. They do not fully consider the essential differences in physical properties between wax crystals and non-waxy turbidity sources such as bubbles and pigment precipitates. The methods themselves do not have the physical basis to distinguish between the two. For example, although conventional image detection methods can obtain crystal morphology information, due to the fundamental difference between wax crystals and bubbles, pigment particles, etc., which lack grayscale characteristics under ordinary bright or dark field illumination, image segmentation and recognition are difficult to distinguish accurately. Non-waxy particles are easily misjudged as wax crystals. Therefore, when the sample matrix is ​​complex or there are interfering substances, the above methods are prone to overestimation or misjudgment of wax content, resulting in insufficient quantitative accuracy of essential oil waxes, which is difficult to support the quality grading and process control requirements of natural essential oils. Summary of the Invention

[0005] This application provides a method for detecting wax defects in natural essential oils based on image segmentation. The core of this method lies in: acquiring orthogonal transmission image data and bright-field transmission image data during the temperature-controlled wax precipitation process of essential oil samples; constructing a polarization-bright-field response ratio by utilizing the birefringence response characteristics of wax crystals under polarized transmission conditions and the transmission-scattering response characteristics under bright-field transmission conditions; jointly analyzing and screening candidate wax regions to distinguish between wax crystal regions and non-wax interference regions; further constructing a differential enhancement image by combining supplementary angle transmission images to extract weakly birefringent wax regions; and performing multi-scale structural feature analysis, segmented quantitative calibration, and wax type matching based on wax crystal image data to achieve comprehensive detection of wax content, wax type, and defect level in natural essential oils, thereby improving the anti-interference ability, quantitative accuracy, and quality grading reliability of natural essential oil wax detection.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] This application provides a method for detecting defects in the waxes of natural essential oils based on image segmentation. The method may include:

[0008] During the temperature-controlled cooling process of the essential oil sample, image data of the essential oil sample under a transmitted light source is acquired. The image data includes orthogonal transmission image data and bright field transmission image data.

[0009] Based on the orthogonal transmission image data, birefringence bright area detection is performed, threshold segmentation is performed on the orthogonal transmission image data to obtain a segmentation threshold, and pixels in the orthogonal transmission image data that are greater than the segmentation threshold are marked as candidate waxy regions.

[0010] The candidate wax region is mapped to the corresponding position in the bright field transmission image data to obtain the mapped region. Based on the image features of the mapped region, the candidate wax region is screened and eliminated to obtain wax crystal image data.

[0011] Multi-scale feature extraction is performed on the wax crystal image data to obtain the wax features of the essential oil sample. The wax features include coverage features, crystal size features, and morphological combination features.

[0012] The coverage feature is substituted into a preset segmented calibration function to calculate the wax content value. The crystal size feature and the morphological combination feature are matched with a preset wax type feature reference library to obtain the wax type.

[0013] The wax content value and the wax type are combined and output to obtain the wax test report of the essential oil sample.

[0014] In some possible implementations, the birefringence bright region detection based on the orthogonal transmission image data, and the threshold segmentation of the orthogonal transmission image data to obtain a segmentation threshold, include:

[0015] The orthogonal transmission image data is subjected to contrast-limited histogram equalization to obtain an enhanced polarization image;

[0016] The enhanced polarization image is subjected to inter-class variance processing to obtain an initial segmentation threshold. Based on the initial segmentation threshold, the enhanced polarization image is segmented into regions to obtain multiple bright response regions.

[0017] Based on the brightness distribution results corresponding to the high-brightness response region, the initial segmentation threshold is corrected to obtain the corresponding segmentation threshold.

[0018] In some possible implementations, marking pixels in the orthogonal transmission image data larger than the segmentation threshold as candidate waxy regions includes:

[0019] Based on the segmentation threshold, the polarization response intensity of each pixel in the orthogonal transmission image data is compared, and the bright pixels with a polarization response intensity greater than the segmentation threshold are extracted.

[0020] Based on the spatial adjacency relationship between the bright pixels, adjacent bright pixels are aggregated to obtain candidate waxy regions.

[0021] In some possible implementations, mapping the candidate wax region to the corresponding position in the bright-field transmission image data to obtain the mapped region includes:

[0022] The image acquisition parameters corresponding to the orthogonal transmission image data and the bright field transmission image data are obtained respectively. The image acquisition parameters include imaging center position parameters, image scaling parameters, and image rotation parameters.

[0023] Based on the imaging center position parameters, the orthogonal transmission image data and the bright field transmission image data are spatially aligned to obtain an initial aligned image.

[0024] Based on the image scaling parameters and the image rotation parameters, the initial aligned image is transformed to obtain the target aligned image;

[0025] Extract the region boundary coordinates of the candidate waxy region in the orthogonal transmission image data, and based on the coordinate mapping relationship in the target aligned image, map the region boundary coordinates to the corresponding position in the bright field transmission image data to obtain the mapped region boundary coordinates;

[0026] Based on the mapped region boundary coordinates, the corresponding mapped region is determined in the bright field transmission image data.

[0027] In some possible implementations, the step of filtering and eliminating candidate waxy regions based on image features of the mapped region to obtain waxy crystal image data includes:

[0028] The average brightness of the candidate waxy region in the orthogonal transmission image data is extracted as a first image feature, and the average transmission intensity of the corresponding position of the mapped region in the bright field transmission image data is extracted as a second image feature.

[0029] Based on the first image features and the second image features, the polarization brightness field response ratio of the candidate wax region is constructed;

[0030] Based on the polarization bright field response ratio, a response ratio sequence is constructed. According to the response ratio sequence, the candidate waxy regions are divided into a first response ratio category and a second response ratio category. The first response ratio category refers to the candidate region category in which the birefringence response is weaker than the bright field scattering response, corresponding to the non-waxy interference region. The second response ratio category refers to the candidate region category in which the birefringence response is stronger than the bright field scattering response, corresponding to the waxy crystal region.

[0031] The candidate wax region corresponding to the first response ratio category is taken as the non-wax interference region, the non-wax interference region is removed, and the candidate wax region corresponding to the second response ratio category is determined as wax crystal image data.

[0032] In some possible implementations, constructing the polarization brightness field response ratio of the candidate waxy region based on the first image features and the second image features includes:

[0033] Divide the first image feature of the candidate wax region by the second image feature of the mapped region to obtain the polarization brightness field response ratio of the candidate wax region.

[0034] In some possible implementations, the step of constructing a response ratio sequence based on the polarization brightness field response ratio, and dividing the candidate waxy region into a first response ratio category and a second response ratio category according to the response ratio sequence, includes:

[0035] Based on the polarization brightness field response ratio of the candidate wax region, a response ratio sequence is constructed;

[0036] The response ratio sequence is traversed and segmented to determine the segmentation threshold;

[0037] Candidate wax regions with a polarization brightness field response ratio less than the classification threshold are classified into a first response ratio category, and candidate wax regions with a polarization brightness field response ratio greater than the classification threshold are classified into a second response ratio category.

[0038] In some possible implementations, the multi-scale feature extraction of the wax crystal image data to obtain the wax features of the essential oil sample includes:

[0039] The coverage feature is obtained by calculating the ratio of the number of pixels in the connected regions of the wax crystal in the wax crystal image data to the number of pixels in the field of view of the essential oil sample.

[0040] The equivalent circle diameter is extracted from the connected components of the wax crystal in the wax crystal image data. Based on the equivalent circle diameter, a size frequency distribution is constructed. The first quantile, the second quantile, and the third quantile of the size frequency distribution are extracted to obtain the crystal size features.

[0041] Calculate the aspect ratio and gray-level co-occurrence matrix of the connected regions of the wax crystal in the wax crystal image data. Based on the aspect ratio, obtain the crystal shape distribution parameters. Based on the gray-level co-occurrence matrix, obtain the crystal internal texture parameters. Combine the crystal shape distribution parameters and the crystal internal texture parameters to form a morphological combination feature.

[0042] In some possible implementations, the coverage feature is substituted into a preset piecewise calibration function to calculate the wax content value, and the crystal size feature and the morphological combination feature are matched with a preset wax type feature reference library to obtain the wax type, including:

[0043] Based on the coverage characteristics, a corresponding calibration equation is selected from the preset segmented calibration functions, and the coverage characteristics are substituted into the calibration equation to calculate the wax content value.

[0044] Extract the crystal size features and the morphological combination features to construct a feature vector of the wax type to be tested. Match the feature vector of the wax type to be tested with the reference feature vector in the preset wax type feature reference library to determine the wax type of the essential oil sample.

[0045] Among some possible implementation methods, the following are also included:

[0046] Based on the coverage feature, the wax precipitation state of the essential oil sample is saturated. When the coverage feature meets the saturation determination condition, it is determined to be in a high concentration superposition state. The optical integral features of the wax crystal connected components in the image data are extracted.

[0047] Based on the coverage characteristics and the optical integral characteristics, a composite quantitative index is constructed. The composite quantitative index is then substituted into a preset piecewise calibration function to calculate the wax content value.

[0048] As can be seen from the above technical solution, this application has the following beneficial effects:

[0049] This application constructs an image detection method using orthogonal transmission image data and bright-field transmission image data. By combining the joint characterization of polarization response and scattering response, it maps the birefringence and optical scattering characteristics of wax crystals into a unified analysis framework. This achieves physical separation of the wax signal from interfering components such as bubbles and pigment particles, thereby improving the stability and accuracy of wax crystal recognition. Simultaneously, this application introduces a segmentation threshold method based on inter-class variance optimization, combined with connected component analysis and region-level statistical correction methods, to convert pixel-level polarization response into connected component objects of wax crystals with spatial topological structures. This achieves the transformation from grayscale signal detection to crystal structure recognition, enhancing the detection capability of weakly birefringent crystals while ensuring optimal global segmentation.

[0050] In addition, this application constructs a reference system of multi-scale features, including coverage features, crystal size features, and morphological combination features, and combines the polarization brightness field response ratio and the piecewise calibration function to achieve joint determination of wax content and wax type, so that quantitative results and category results form a unified output link, thereby improving the continuity and engineering applicability of wax quantitative analysis. Attached Figure Description

[0051] The present application will be further described below with reference to the accompanying drawings.

[0052] Figure 1 A flowchart of the first image segmentation-based method for detecting defects in natural essential oil waxes provided in this application;

[0053] Figure 2 A flowchart of the second image segmentation-based method for detecting defects in natural essential oil waxes provided in this application;

[0054] Figure 3 A flowchart of the third image segmentation-based method for detecting defects in natural essential oil waxes provided in this application;

[0055] Figure 4 An original image of actual operation in the third image segmentation-based method for detecting defects in natural essential oil waxes provided in this application;

[0056] Figure 5 This is a practical image to be processed in the third image segmentation-based method for detecting defects in natural essential oil waxes provided in this application. Detailed Implementation

[0057] The terms "first," "second," and "third," etc., used in this application specification, claims, and drawings are used to distinguish different objects, not to limit a specific order.

[0058] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.

[0059] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the related technologies is given first:

[0060] In existing methods for applying image processing technology to the detection of natural essential oil waxes, ordinary white light transmitted or reflected illumination is usually used as the imaging light source to acquire visible light images of transparent containers holding essential oil samples, and image processing algorithms are used to identify and quantitatively analyze turbid areas in the images.

[0061] At the image acquisition level, existing technologies typically use bright-field transmission imaging to acquire images of essential oil samples and use industrial cameras to capture particle distribution images in the wax-exposed state. Some solutions use dark-field illumination to enhance the contrast between particle scattering signals and the background in order to improve particle visibility in the low-concentration wax-exposed state. Some solutions further obtain particle scattering information from different directions by adjusting the illumination angle. Image resolution, illumination uniformity, and the contrast between particles and the background are important factors affecting the accuracy of subsequent detection.

[0062] At the image preprocessing level, existing technologies typically perform dark field correction, flat field correction, and filtering and denoising on the acquired images to reduce the impact of camera background noise and illumination inhomogeneity on image quality. At the same time, the visibility of low-contrast areas is improved by means of histogram equalization or local contrast enhancement to enhance the response intensity of wax particles in the image.

[0063] At the target segmentation level, existing technologies typically employ fixed threshold segmentation, adaptive threshold segmentation, or edge detection to extract bright or cloudy areas in the image and use these areas as candidate wax-exuding regions. Some schemes further employ morphological operations such as erosion and dilation to optimize region boundaries and improve the integrity of particle regions. However, under normal lighting conditions, there is a lack of stable and separable grayscale response differences between wax crystals, bubbles, pigment precipitates, and trace suspended impurities, which leads to the easy overlap of different types of particles in the threshold segmentation results. Candidate regions usually contain both wax particles and non-wax interference particles.

[0064] At the level of feature extraction and quantitative analysis, existing technologies typically extract morphological features such as area, perimeter, roundness, and texture of candidate regions, and quantitatively evaluate the degree of wax precipitation based on the proportion of the total particle area to the field of view, particle counting results, or coverage of turbid areas. Some schemes further combine color features or texture features to distinguish different types of particles and estimate the wax content through empirical calibration curves.

[0065] Research has revealed that existing image processing-based methods for detecting waxes in natural essential oils primarily rely on particle grayscale, scattering intensity, or geometric morphology for analysis. However, wax crystals and non-wax interference sources such as bubbles and pigment particles lack fundamental differences in image response under ordinary lighting conditions. This makes it difficult to specifically extract wax crystal regions, and the influence of non-wax scattering particles on the quantitative results of wax content is difficult to eliminate effectively. Consequently, the wax content calculation results are prone to deviation, making it difficult to meet the requirements of specificity and quantitative accuracy for the refined quality grading and process control of natural essential oils.

[0066] Example 1: This application provides a method for detecting defects in natural essential oil waxes based on image segmentation. Please refer to [link to example]. Figure 1 .

[0067] S101, During the temperature-controlled cooling process of the essential oil sample, the essential oil sample is obtained (see...). Figure 4 Image data under transmitted light source, including orthogonal transmission image data and bright field transmission image data.

[0068] The following is an introduction to the technical terms and technical extensions involved in this application:

[0069] Temperature-controlled cooling treatment: This refers to the process of controlling the cooling of essential oil samples based on the precipitation temperature characteristics of wax components in natural essential oils, so that the wax components originally dissolved in the essential oil system gradually undergo supersaturation precipitation and form wax crystals during the temperature reduction process.

[0070] In this application, temperature-controlled cooling treatment is used not only to induce the precipitation of waxes in natural essential oils, but also to control the formation rate, crystal size and crystal aggregation state of wax crystals, so that different types of waxes can form a stable crystal structure response during the wax precipitation process. During the temperature-controlled cooling treatment, the rate of temperature change, the target cooling temperature and the constant temperature holding time will affect the birefringence response intensity and spatial distribution characteristics of the wax crystals.

[0071] By using temperature-controlled cooling, trace wax components in natural essential oils can be transformed from a uniformly dissolved state into a wax crystal state that can be captured by the imaging system, thus providing a basis for subsequent image detection, crystal structure analysis, and quantitative analysis of wax.

[0072] Orthogonal transmission image data refers to image data acquired under orthogonal polarization transmission illumination conditions. Orthogonal polarization transmission illumination consists of a polarizer placed on the light source side and an analyzer placed on the image sensor side. The polarization directions of both are perpendicular to each other, resulting in an extinction state. Under this illumination condition, the transmitted light, after being polarized by the polarizer into linearly polarized light, passes through the essential oil sample. Optically isotropic substances (essential oil matrix, bubbles, water droplets, etc.) do not change their polarization direction; after being filtered by the analyzer, the transmission intensity approaches zero, appearing as a black background in the image. Optically anisotropic wax crystals, due to their birefringence, rotate the vibration direction of the polarized light by a certain angle. The rotated polarization component can pass through the analyzer and appears as bright spots in the image. The image feature of wax crystals specifically appearing on an extinct black background in orthogonal transmission image data is the core physical basis for achieving specific detection of wax crystals. The spatial distribution, brightness, and morphology of the bright spots in the image directly correspond to the spatial position, optical thickness, and shape characteristics of the wax crystals.

[0073] Among them, the polarizer is a polarization element set on the exit path of the transmitted light source, which is used to convert natural light into linearly polarized light with a definite vibration direction, so that the light wave incident on the essential oil sample has a uniform polarization state, thereby providing a stable incident light reference condition for subsequent polarization response analysis; the analyzer is a polarization element set on the incident light path of the image acquisition device, which is used to perform secondary polarization screening on the transmitted light after passing through the essential oil sample, allowing only the light component that meets the specific polarization direction condition to pass through and enter the image sensor, thereby realizing selective imaging of the optical anisotropic response of the essential oil sample.

[0074] Bright-field transmission image data refers to image data acquired under normal white light transmission illumination conditions, i.e., images acquired after rotating the analyzer to be parallel to the polarization direction of the polarizer or removing the analyzer and restoring the normal transmission illumination mode (e.g., images acquired under normal white light transmission illumination conditions). Figure 4 Image enhancement and other processing were performed on the essential oil samples to obtain Figure 5 Then by Figure 5 The image data is then processed to obtain... Figure 5 Bright-field transmission image data). Under bright-field transmission illumination, transmitted light passes uniformly through the essential oil sample. All optical inhomogeneities in the essential oil sample, including wax crystals, bubbles, and pigment particles, experience local transmission attenuation due to scattering or absorption, appearing as dark spots with reduced grayscale against a bright background. Bright-field transmission image data records the spatial distribution information of all optical scatterers and absorbers in the essential oil sample, forming a physically complementary image pair with orthogonal transmission image data: in orthogonal transmission image data, wax crystals are exclusively visible while isotropic interference sources are extinct; in bright-field transmission image data, both wax crystals and all interference sources respond, and the difference in their response modes carries key information for distinguishing wax crystals from non-waxy interference sources.

[0075] In some possible implementation methods, the essential oil sample is subjected to temperature-controlled cooling. The essential oil sample to be tested is placed in a temperature-controlled sample cell or a constant temperature cooling device, and the essential oil sample is continuously cooled or steppedly cooled according to a preset cooling rate until the target endpoint temperature is reached. This causes the wax components in the essential oil sample to gradually change from a dissolved state to a crystalline state. During the cooling process, wax crystals will gradually form and undergo size growth and spatial aggregation. Therefore, different cooling stages correspond to different wax precipitation structure states. The preset cooling rate is used to characterize the control gradient of the essential oil sample temperature decrease per unit time during the temperature-controlled cooling process, and the target endpoint temperature is used to characterize the stable observation temperature point corresponding to the transition of the wax system from a dissolved state to a stable crystalline state.

[0076] It should be noted that, for the preset cooling rate and target endpoint temperature, those skilled in the art can conduct comparative analysis of preliminary experiments on similar essential oil samples under different temperature control conditions, select the cooling slope corresponding to the optimal temperature change curve as the preset cooling rate based on the integrity of wax precipitation and the clarity and stability of the image, and take the temperature point or temperature range corresponding to the crystallization process when it tends to stabilize as the target endpoint temperature. No further restrictions are imposed here.

[0077] Specifically, during the temperature-controlled cooling process, image data of the essential oil sample is acquired. The sample cell is placed in the transmission light path, so that the transmitted light passes through the essential oil sample along the sample thickness direction to form a stable transmission light field. An image acquisition device set on the other side of the transmission light path performs image acquisition on the transmitted light signal, thereby obtaining image data.

[0078] In some possible implementations, a polarization modulation structure is introduced into the transmission optical path, allowing the same essential oil sample to be in both orthogonal polarization imaging and bright-field transmission imaging states under the same imaging field of view. In orthogonal polarization imaging, the polarizer and analyzer are orthogonally positioned, causing the optically isotropic components that have not undergone polarization state changes to be extinct, retaining only the optical response of the wax crystal with birefringence characteristics, thereby obtaining orthogonal transmission image data. In bright-field transmission imaging, the orthogonal extinction condition is removed, allowing the transmitted light to carry the overall absorption and scattering information of the sample, thereby obtaining bright-field transmission image data.

[0079] Furthermore, orthogonal transmission image data and bright field transmission image data are acquired alternately in a time-synchronous or time-adjacent manner, so that the two types of image data correspond to the same spatial region in the same wax evolution stage, thereby ensuring the spatial registration relationship and state consistency between different optical response data, and providing a basic data source for subsequent wax region identification based on dual-modal response differences.

[0080] S102, perform birefringent bright area detection based on orthogonal transmission image data, perform threshold segmentation on the orthogonal transmission image data to obtain a segmentation threshold, and mark pixels in the orthogonal transmission image data that are greater than the segmentation threshold as candidate waxy regions. (See also...) Figure 2 .

[0081] To ensure clarity and conciseness in the description of the following embodiments, a brief introduction to the relevant terms is given first.

[0082] The segmentation threshold is a numerical boundary used to divide pixels in orthogonal transmission image data according to their polarization response intensity, and is used to distinguish bright pixels with obvious birefringence response from background or weak response pixels.

[0083] Candidate waxy regions refer to a set of spatially continuous connected regions in orthogonal transmission image data, consisting of adjacent pixels with gray values ​​higher than the segmentation threshold. The pixels in this set correspond in physical space to the high birefringence response regions in the essential oil sample that may contain waxy crystals.

[0084] Birefringence bright area detection is a process of preliminary identification of target areas by utilizing the difference in polarization response of different materials under orthogonal transmission imaging conditions. In orthogonal polarization light paths, optically isotropic materials do not change their polarization direction and exhibit low transmission or extinction under the action of the analyzer. However, wax crystals with birefringence properties will cause polarization state rotation, causing some light signals to pass through the analyzer and form local bright spots. Therefore, by analyzing the local brightness enhancement areas in the orthogonal transmission image data, the preliminary location of the potential wax crystal area can be achieved. This process is based on the difference in light intensity after polarization state modulation to achieve physical separation of the target and the background.

[0085] Thresholding segmentation is a process of numerically dividing an image based on the statistical distribution of pixel grayscale or polarization response intensity in orthogonal transmission image data. Specifically, by statistically analyzing the grayscale distribution of the whole or local area of ​​the image, the boundary value that can distinguish the background extinction region from the birefringence response region is determined, and the boundary value is used as the segmentation threshold, thereby dividing the continuous grayscale response space in the image into high response region and low response region, realizing the conversion from continuous signal to discrete region.

[0086] Labeling is the process of assigning state values ​​to pixels in orthogonal transmission image data whose grayscale values ​​or polarization response intensities are greater than a segmentation threshold. In this process, pixels meeting the criteria are assigned the attribute label "candidate waxy region," and labeled pixels with connectivity are aggregated based on spatial adjacency relationships to form a spatially continuous set of candidate regions. This provides the input basis for subsequent interference removal and waxy crystal confirmation based on bright-field transmission image data.

[0087] In some possible implementations, contrast-limited histogram equalization (HQE) is performed on the orthogonal transmission image data. Under an extinction background, the overall grayscale of the orthogonal transmission image data is low. The bright spot signal of the weakly birefringent waxy microcrystals may be similar in grayscale to the background noise. Direct thresholding can easily miss the weak signal crystals. By dividing the image into several local blocks through contrast-limited HQE, and performing HQE independently within each block, the local grayscale dynamic range is stretched. After this processing, the grayscale value of the bright spot of the weakly birefringent waxy microcrystals is effectively increased relative to the background, improving the local contrast of the entire image and resulting in an enhanced polarization image.

[0088] An initial segmentation threshold is obtained by performing inter-class variance processing on the enhanced polarization image. The specific steps of inter-class variance processing are as follows: First, the frequency of occurrence of all pixels at each gray level in the enhanced polarization image is counted to obtain a gray-level histogram. Then, each gray level is sequentially selected as a candidate segmentation position in ascending order of gray level. For the current candidate segmentation position, pixels with gray values ​​less than or equal to that position are classified as the background class, and pixels with gray values ​​greater than that position are classified as the foreground bright area class. The proportion of the total number of pixels in the background and foreground bright area classes to the total number of pixels in the image, as well as the gray-level mean of the two classes, are counted. The difference between the gray-level means of the two classes is calculated, and the square of this difference multiplied by the product of the pixel proportions of the two classes is used as the inter-class variance corresponding to the current candidate segmentation position. After traversing all candidate segmentation positions, the maximum value among all inter-class variances is selected, and the gray value at the candidate segmentation position corresponding to the maximum inter-class variance is used as the initial segmentation threshold. When the inter-class variance reaches its maximum value, the grayscale difference between the background class and the foreground bright area class reaches its maximum, and the two classes are separated to the greatest extent in terms of grayscale distribution. Therefore, this grayscale value is the optimal segmentation point for distinguishing between the extinct background and the waxy crystal bright spot.

[0089] The enhanced polarization image is binarized and segmented using an initial segmentation threshold. Pixels with gray values ​​greater than the initial threshold are marked as highlight pixels, while pixels with gray values ​​less than or equal to the initial threshold are marked as background pixels. Connectivity analysis is then performed on the marking results, grouping spatially adjacent highlight pixels into the same connected component. Each connected component serves as an independent highlight response region, thus yielding a set of highlight response regions.

[0090] The initial segmentation threshold is adaptively corrected based on the brightness distribution results of the high-brightness response regions. The specific implementation method is as follows: Extract grayscale reference values ​​for each high-brightness response region. For each high-brightness response region, locate all pixels within that region in the enhanced polarization image, read the grayscale value of each pixel one by one, and select the minimum grayscale value as the grayscale reference value for that region. The minimum grayscale value directly reflects the grayscale level of the lowest-brightness real wax signal pixel in that region, without the need to introduce additional statistical estimation or adjustment parameters. Compile a set of grayscale reference values ​​for all high-brightness response regions. Summarize the grayscale reference values ​​of all high-brightness response regions into a one-dimensional set, the number of elements in which is equal to the total number of high-brightness response regions. Sort this set according to the grayscale value in ascending order to obtain an ordered sequence of grayscale reference values. For the sorted sequence of grayscale reference values, determine the first quartile position based on the number of regions. When the first quartile position corresponds to an integer index, directly select the grayscale reference value at that position; when the first quartile position is between two adjacent indices, determine the correction reference value based on the linear interpolation result between two adjacent grayscale reference values. The reason for using the first quartile instead of the global minimum is that a few high-brightness response regions may have abnormally low minimum grayscale values ​​due to local noise or crystal edge effects. If the global minimum is directly used as the correction reference value, the threshold will be lowered too much, significantly increasing the risk of introducing background noise. The first quartile retains the grayscale lower limit information of most regions while exhibiting good robustness to a few abnormally low values, effectively eliminating interference from individual regions. The initial segmentation threshold and the correction reference value are weighted and fused to obtain the corrected segmentation threshold. The fusion method is as follows: the initial segmentation threshold... With the corrected reference value By performing weighted fusion, the revised value of the divided countries is obtained. The fusion method uses equal weight allocation, and its calculation formula is as follows: ,in, In this embodiment, the preset fusion weighting coefficients are used. The initial segmentation threshold, set to 0.5, is determined by statistically analyzing the grayscale values ​​of all pixels in the image using the maximization of inter-class variance criterion. This threshold reflects the globally optimal segmentation point, representing the overall grayscale distribution of the image. The statistical sample size is the total number of pixels in the entire image, ensuring high statistical stability. The correction reference value is determined by statistically analyzing the lower grayscale limit of the bright response region, reflecting the local grayscale boundary of the actual waxy crystal bright spot. This information originates from the waxy signal region, offering strong signal specificity. Both have independent statistical sources and technical advantages, and their information sources are equally important; therefore, they are given equal fusion weights. The weighted fusion result is used as the segmentation threshold output, which is then used to mark the segmentation threshold for candidate waxy regions in subsequent steps. This segmentation threshold is moderately lower than the initial segmentation threshold, allowing weakly birefringent pixels with grayscale values ​​slightly lower than the initial threshold but belonging to the edge of the real waxy crystal to be included in the detection range. Simultaneously, because the correction reference value uses quantile values ​​and the fusion weights are fixed, the correction magnitude is subject to dual constraints. This avoids both excessively lowering the threshold due to individual abnormally low values ​​and introducing background noise due to excessively large correction magnitudes.

[0091] In some possible implementations, a segmentation threshold is used as the criterion to compare the polarization response intensity of each pixel in the orthogonal transmission image data. The gray value of each pixel in the orthogonal transmission image data represents the polarization response intensity at that location. The larger the gray value, the stronger the ability of the material at that location to rotate the vibration direction of the incident polarized light, i.e., the more significant the birefringence effect. The gray value of each pixel is compared with the segmentation threshold: if the gray value of a pixel is greater than the segmentation threshold, the pixel is marked as a waxy pixel, indicating the presence of a material with a birefringence response at that location, and is initially identified as the image signal corresponding to a waxy crystal; if the gray value of a pixel is less than or equal to the segmentation threshold, the pixel is marked as a background pixel, indicating that the material at that location does not produce a detectable birefringence response under orthogonal polarization conditions, and belongs to an isotropic essential oil matrix, bubble, or water droplet, etc. This comparison process transforms the orthogonal transmission image data into a binary labeled image, where waxy pixels are the foreground and background pixels are the background, and the spatial location information of the waxy crystals is initially extracted in the spatial distribution form of the waxy pixels.

[0092] After obtaining the set of wax-like pixels, region aggregation is performed based on the spatial adjacency relationships between them. The criteria for determining spatial adjacency are as follows: taking the current wax-like pixel as the center, check the adjacent pixels within its four or eight neighboring areas. If the adjacent pixels are also wax-like pixels, they are determined to belong to the same connected region and are spatially continuous. If the adjacent pixels are background pixels, the location is determined to be the boundary of the wax-like region. The aggregation process traverses all wax-like pixels, checking the pixel labeling status within the neighborhood of each wax-like pixel. A connected component labeling algorithm is used to merge spatially connected wax-like pixels into the same set, and a unique region identifier is assigned to each set. The connected component labeling algorithm automatically identifies all independent connected sets of highlighted pixels through operations such as scanning the image, establishing adjacency relationships, and passing equivalent identifiers. Each set corresponds to an independent aggregation region.

[0093] After traversal, all waxy pixels are divided into several non-overlapping aggregate regions. Each aggregate region is spatially continuous and has clear boundaries, representing the bright spot projection of an independent waxy crystal in an orthogonally polarized image. These bright aggregate regions are candidate waxy regions, which are output as a list of region identifiers. Each candidate waxy region contains at least the coordinate position information of all pixels within its region, providing input for subsequent mapping of candidate waxy regions to bright-field transmission image data for interference removal.

[0094] S103, the candidate waxy regions are mapped to their corresponding positions in the bright-field transmission image data to obtain the mapped regions. Based on the image features of the mapped regions, the candidate waxy regions are filtered and eliminated to obtain the waxy crystal image data. Please refer to [link to relevant documentation]. Figure 2 .

[0095] To ensure clarity and conciseness in the description of the following embodiments, a detailed introduction of the relevant terms is given first.

[0096] Mapping region: refers to the corresponding region obtained by mapping the spatial position of the candidate wax region in the orthogonal transmission image data to the bright field transmission image data through the spatial correspondence between the orthogonal transmission image data and the bright field transmission image data. The mapping region is the spatial corresponding projection region of the candidate wax region in different imaging modes, and is used to establish the regional correspondence between the orthogonal transmission imaging results and the bright field transmission imaging results.

[0097] Wax crystal image data refers to the set of image regions retained after candidate wax regions have been verified by bright-field transmission image data and non-wax interference regions have been removed. These regions are used to characterize the spatial distribution and morphological features of wax crystals. The pixel regions in the wax crystal image data simultaneously satisfy the joint criteria of birefringence response characteristics and bright-field transmission response characteristics. Therefore, the target material in the corresponding region has both polarization response capability and transmission and scattering characteristics consistent with wax crystals.

[0098] The wax crystal image data records information such as the spatial location, connectivity, size distribution, shape boundaries, and internal texture of the wax crystals within the image. This data serves as the foundation for subsequent tasks including coverage feature extraction, crystal size feature analysis, morphological combination feature construction, and quantitative calculation of wax content. The wax crystal image data has already excluded interference regions corresponding to bubbles, water droplets, pigment particles, and other non-wax scattering bodies, thus exhibiting higher wax specificity and quantitative reliability.

[0099] The following is a description of the technical terms used in this application:

[0100] Image acquisition parameters: These are the set of parameters used to describe and record the spatial correspondence between two images during the acquisition of orthogonal transmission image data and bright field transmission image data. They include imaging center position parameters, image scaling parameters, and image rotation parameters.

[0101] Imaging center position parameter: refers to the coordinate offset of the center point of the imaging area of ​​each of the orthogonal transmission image data and the bright field transmission image data in the pixel coordinate system.

[0102] Image scaling parameter: refers to the ratio between orthogonal transmission image data and bright field transmission image data in terms of imaging magnification.

[0103] Image rotation parameter: refers to the relative rotation angle between orthogonal transmission image data and bright field transmission image data within the imaging plane.

[0104] Before acquiring orthogonal transmission image data and bright-field transmission image data, the aforementioned parameters can be obtained by performing dual-mode imaging calibration on the same standard calibration sample to acquire the spatial mapping relationship between the two images. Specifically, while keeping the sample position, optical path structure, and image acquisition device position fixed, orthogonal transmission image data and bright-field transmission image data are acquired separately, and corresponding feature points or marker regions in the two images are extracted. The spatial offset relationship, scale change relationship, and rotation deviation relationship between the two images are determined by feature point matching, and then the imaging center position parameters, image scaling parameters, and image rotation parameters are calculated. After calibration, the above parameters are used as fixed image acquisition parameters for subsequent spatial coordinate transformation and region mapping between different mode images. If the image acquisition device or optical path structure changes, the calibration process is re-executed to update the corresponding parameters.

[0105] The technical solution of this application will be described below using technical terminology:

[0106] In some possible implementations, imaging spatial references are extracted from orthogonal transmission image data and bright-field transmission image data respectively. Based on the imaging center position parameters recorded during image acquisition, the spatial center coordinates of each type of image data are determined, and these center coordinates are used as a unified spatial reference origin. By translating the center coordinates of the orthogonal transmission image data to match the center coordinates of the bright-field transmission image data, the two images are initially aligned in the global coordinate system, resulting in an initial aligned image with only scale and rotation differences.

[0107] Based on the initial aligned image, image scaling and rotation parameters are introduced to further correct the spatial coordinate relationship. The correction operation uses the spatial scale and coordinate axis orientation of the orthogonal transmission image data containing candidate waxy regions as a reference to transform the bright-field transmission image data. The coordinate values ​​of each pixel in the bright-field transmission image data are multiplied by the ratio recorded by the image scaling parameters to transform the spatial scale of the bright-field transmission image data to be consistent with that of the orthogonal transmission image data. Then, the coordinate values ​​of each pixel in the bright-field transmission image data are substituted into a two-dimensional rotation matrix for rotation transformation. The rotation angle of this rotation matrix is ​​taken as the angle difference recorded by the image rotation parameters, and the rotation direction is from the coordinate axis orientation of the bright-field transmission image data to coincide with the coordinate axis orientation of the orthogonal transmission image data. After scale correction and rotation correction, the spatial scale and coordinate axis orientation of the bright-field transmission image data are consistent with those of the orthogonal transmission image data, resulting in the target aligned image.

[0108] The spatial boundaries of candidate waxy regions in orthogonal transmission image data are analyzed, and the set of boundary pixel coordinates for each candidate waxy region is extracted. This set of coordinates is then regarded as the geometric contour representation of the region in a unified spatial coordinate system. Based on the spatial mapping relationship established in the target aligned image, this set of boundary coordinates is mapped point by point to the corresponding coordinate positions in the bright field transmission image data, ensuring that each boundary pixel has a unique corresponding position in the bright field image.

[0109] After coordinate mapping, region filling and closure processing is performed on the bright-field transmission image data based on the mapped boundary coordinates. That is, the pixel set inside the region is determined by using the mapped boundary as a constraint, forming a bright-field projection region that corresponds one-to-one with the candidate wax region. This bright-field projection region is the mapped region, and its spatial range is consistent with the actual corresponding position of the candidate wax region in the essential oil sample, but the transmission and scattering characteristics of this region are re-characterized under bright-field transmission imaging conditions.

[0110] The following is a description of the technical terms used in this application:

[0111] The first image feature refers to the average gray value of the corresponding candidate wax region extracted in the orthogonal transmission image data. Specifically, it is the arithmetic mean obtained by summing all pixel gray values ​​within the pixel coordinate range corresponding to the candidate wax region. It is used to characterize the birefringence response intensity level of the candidate wax region under orthogonal polarization imaging conditions.

[0112] The second image feature refers to the average transmission intensity of the candidate wax region extracted from the corresponding mapped area in the bright field transmission image data. Specifically, it is the arithmetic mean obtained by summing all pixel gray values ​​within the pixel range of the mapped area. It is used to characterize the overall optical attenuation and scattering intensity level of the candidate wax region under normal transmission illumination conditions.

[0113] Polarization brightness-field response ratio: A composite characterization quantity constructed based on the first and second image features, defined as the ratio of the average brightness of a candidate waxy region in orthogonal transmission image data to the average transmission intensity of the corresponding mapped region in bright-field transmission image data. The physical meaning of this ratio is that the numerator reflects the birefringence response intensity of the candidate waxy region, and the denominator reflects the overall optical scattering attenuation of the candidate waxy region. The ratio eliminates the influence of absolute light intensity differences and directly characterizes the relative level of the birefringence response intensity of the candidate waxy region relative to its overall scattering response intensity. Waxy crystals possess both significant birefringence response and moderate scattering attenuation, resulting in a high polarization brightness-field response ratio; bubbles have no birefringence response but strong interface scattering attenuation, resulting in a polarization brightness-field response ratio close to zero; pigment particles have no birefringence response and strong absorption attenuation, also resulting in a polarization brightness-field response ratio close to zero. These differences naturally separate the polarization brightness-field response ratios of different types of candidate regions numerically.

[0114] Response ratio sequence: refers to a one-dimensional ordered data set formed by arranging the polarization brightness field response ratio values ​​of all candidate wax regions in ascending order of value.

[0115] First response ratio category: In the statistical distribution of polarization brightness field response ratios of all candidate wax regions, the set of regions with relatively low polarization brightness field response ratios corresponds to the region type with weak orthogonal polarization response and relatively dominant brightness field scattering response. Physically, this type of region mainly corresponds to the interference region formed by bubbles, pigment particles or other non-birefringent scatterers.

[0116] The second response ratio category refers to a set of regions with relatively high response ratios in the statistical distribution of polarization bright field response ratios across all candidate wax regions. This category corresponds to regions where the orthogonal polarization response is significantly stronger than the bright field scattering response. Physically, this type of region mainly corresponds to wax crystal regions with obvious birefringence characteristics and is used to characterize the spatial distribution of the real wax crystallization structure.

[0117] In some possible implementations, for each candidate waxy region, all pixels within that region are located in the orthogonal transmission image data. The grayscale values ​​of each pixel are read, and the arithmetic mean of these grayscale values ​​is calculated. This arithmetic mean is used as the first image feature of the candidate waxy region, i.e., the average brightness of the region. Simultaneously, for each mapped region corresponding to a candidate waxy region, all pixels within that mapped region are located in the bright-field transmission image data. The grayscale values ​​of each pixel are read, and the arithmetic mean of these grayscale values ​​is calculated. This arithmetic mean is used as the second image feature of the candidate waxy region, i.e., the average transmission intensity of the region.

[0118] For a candidate waxy region, its first image feature is divided by its second image feature; the resulting ratio is the polarization brightness response ratio of that candidate waxy region. The polarization brightness response ratios of all candidate waxy regions are aggregated into a one-dimensional set, sorted by numerical value from smallest to largest to obtain a response ratio sequence. This sequence is then used for traversal segmentation to determine the classification threshold. The specific traversal segmentation method is as follows: each polarization brightness response ratio value in the sequence is used as a candidate classification threshold. All candidate regions are divided into two groups based on this threshold: those less than the threshold and those greater than the threshold. The intra-group mean of each group is calculated, and the absolute value of the difference between the two group means is calculated as the inter-class distance corresponding to the current candidate threshold. After traversing all candidate segmentation positions in the sequence, the candidate classification threshold that maximizes the inter-class distance is selected as the classification threshold. The maximum inter-class distance means that the mean response ratios of the two groups differ the most, indicating the highest degree of separation between the waxy crystal population and the non-waxy interference population in terms of response ratio values, resulting in the most reliable classification result.

[0119] The aforementioned threshold is a value found in the response ratio sequence. Using this value as the boundary, all candidate waxy regions are divided into two groups, maximizing the inter-class distance between the two groups. This threshold represents the point of greatest separation between the waxy crystal population and the non-waxy interference population in the response ratio sequence. Candidate regions with a birefringence response lower than this value have relatively weaker responses and are classified into the first response ratio category, i.e., the non-waxy interference category; candidate regions with a birefringence response higher than this value have relatively stronger responses and are classified into the second response ratio category, i.e., the waxy crystal category.

[0120] All candidate wax regions corresponding to the first response ratio category are considered as non-wax interference regions and are removed from the candidate wax region set. All candidate wax regions corresponding to the second response ratio category are retained, and the retained candidate wax region set is the wax crystal image data.

[0121] In some possible implementation methods, ,in, This refers to the candidate splitting threshold. This refers to the sorted response ratio sequence. Indicates the polarization bright field response ratio, subscript Indicates the sorted position number. This represents the total number of candidate waxy regions.

[0122] For each candidate split threshold All candidate wax regions were divided into two groups: those with a polarization brightness field response ratio less than 1. The candidate regions are assigned to the first group, and the polarization bright field response ratio is greater than 1. The candidate regions were assigned to the second group;

[0123] Calculate the mean response ratios for the first and second groups respectively. , ,in It refers to When the segmentation threshold is set, the mean response ratio of all polarized bright field response ratios within the first group is... This represents the summation of the response ratios of all polarized bright fields within the first group. This indicates the number of candidate waxy regions within the first group. It refers to When the segmentation threshold is set, the mean response ratio of all polarized bright field response ratios within the second group is... This represents the summation of the response ratios of all polarized bright fields within the second group. This indicates the number of candidate wax regions in the second group.

[0124] Calculate candidate split threshold The corresponding inter-class distance, , Indicates Inter-class distance is the absolute value of the difference between the mean response ratios of the two groups when setting the candidate split threshold. The larger this value, the farther apart the two groups are in terms of response ratio values, and the better the classification effect.

[0125] Traverse all candidate partitioning thresholds, calculate the inter-class distance corresponding to each candidate distribution threshold, and select the candidate partitioning threshold that maximizes the inter-class distance as the partitioning threshold. Classify the candidate waxy regions with polarization brightness field response ratio less than the partitioning threshold into the first response ratio category; classify the candidate waxy regions with polarization brightness field response ratio greater than the partitioning threshold into the second response ratio category.

[0126] S104. Multi-scale feature extraction is performed on the wax crystal image data to obtain the wax features of the essential oil sample. The wax features include coverage features, crystal size features, and morphological combination features.

[0127] To ensure clarity and conciseness in the description of the following embodiments, a detailed introduction of the relevant terms is given first.

[0128] Wax characteristics: refers to the set of feature parameters extracted from the spatial distribution, size distribution and morphological structure of wax crystals in wax crystal image data. It is used to characterize the overall characteristics of wax crystallization in natural essential oils, including coverage characteristics, crystal size characteristics and morphological combination characteristics.

[0129] Coverage feature: refers to the proportion of the total number of pixels corresponding to all connected regions of wax crystals in the wax crystal image data to the total number of pixels in the field of view of the essential oil sample, and is used to characterize the spatial coverage of wax crystals in the current observation field of view.

[0130] Crystal size characteristics: These are statistical features constructed based on the spatial size parameters of the connected regions of each wax crystal in the wax crystal image data, used to characterize the grain size distribution of wax crystals during the crystallization process.

[0131] Morphological combination features refer to the composite features constructed by the spatial shape structure and internal texture structure of wax crystals in wax crystal image data, which are used to characterize the morphological properties of wax crystals.

[0132] Specifically, multi-scale feature extraction is a process of extracting corresponding image features at multiple spatial scales for wax crystal structures of different spatial sizes, aggregation states, and morphological levels in wax crystal image data. Because wax crystals in natural essential oils exhibit multiple structural morphologies during crystallization, including microcrystal nuclei, monomeric crystals, and aggregated crystals, the response characteristics of wax structures at different scales in the image show significant differences: at smaller scales, the main features are the number of microcrystal particles, local distribution density, and edge texture features; at larger scales, the main features are the crystal aggregation morphology, regional coverage, and spatial aggregation structure. If feature analysis is performed only at a single scale, it is easy to miss microcrystals or under-represent large-scale aggregation structures.

[0133] By extracting features at multiple scales, both the microscopic wax crystal structure and the macroscopic wax distribution can be preserved. This allows the wax features to reflect not only the local crystallization state of the wax crystals but also the spatial distribution pattern of the wax in the entire essential oil sample, thereby improving the accuracy and stability of subsequent wax content analysis, wax type identification, and wax grade determination.

[0134] The technical terms used in this application are explained below.

[0135] Wax crystal connected region: refers to an independent region in wax crystal image data composed of spatially adjacent pixels that are identified as wax crystals.

[0136] Essential oil sample field of view: refers to the spatial range of the essential oil sample that can be covered and imaged under the current imaging conditions.

[0137] Gray-level co-occurrence matrix: refers to a two-dimensional statistical matrix used to characterize the spatial joint distribution relationship between pixels of different gray values ​​in an image.

[0138] In some possible implementations, coverage features are extracted from the wax crystal image data. This involves traversing all connected regions of the wax crystals in the image data and counting the total number of wax pixels contained within each connected region. Simultaneously, all effective imaging pixels within the field of view of the essential oil sample are counted to obtain the total number of pixels corresponding to the essential oil sample's field of view. The coverage feature is then obtained by dividing the total number of wax pixels by the total number of pixels in the essential oil sample's field of view.

[0139] Crystal size features were extracted from wax crystal image data based on the D10 / D50 / D90 particle size characterization method, a common technique in particle size analysis. Specifically, for each connected region in the wax crystal image data, the number of pixels contained within that region was counted, and the equivalent circle diameter of that region was calculated. The calculation method is as follows: ,in, It refers to the diameter of the equivalent circle of the connected region. This refers to the number of pixels contained within the connected component. The equivalent circle diameter normalizes the connected components of irregularly shaped waxy crystals to a uniform circular size metric, making crystals of different shapes comparable in size.

[0140] The equivalent circle diameters of all connected domains of waxy crystals are aggregated into a one-dimensional dataset and sorted in ascending order of value to obtain the size frequency distribution. The first, second, and third quantiles are extracted from this sorted size frequency distribution as crystal size features. The first quantile characterizes the distribution level of small crystals, the second quantile characterizes the median distribution of overall crystal size, and the third quantile characterizes the distribution level of large crystals or crystal aggregates. By jointly characterizing multiple quantiles, the size distribution characteristics of microcrystals, conventional crystals, and aggregated crystals in the essential oil sample can be simultaneously reflected, thus avoiding distortion caused by the influence of extremely large or extremely small crystals on the single average size.

[0141] For example, in the size frequency distribution, the value at the 1 / 10 position is taken as the first quantile, i.e., D10, indicating that the equivalent circle diameter of 10% of the connected regions in all wax crystals is smaller than this value; the value at the 1 / 2 position is taken as the second quantile, i.e., D50, representing the median value of the equivalent circle diameter of all connected regions in all wax crystals; and the value at the 9 / 10 position is taken as the third quantile, i.e., D90, indicating that the equivalent circle diameter of 90% of the connected regions in all wax crystals is smaller than this value. D10, D50, and D90 together constitute the crystal size characteristics, reflecting the central tendency and dispersion of the size distribution of the wax crystal population on a statistical scale.

[0142] Furthermore, morphological feature extraction was performed on the wax crystal image data. For each connected region of the wax crystal, the major and minor axes of the bounding rectangle were extracted, and the ratio between the major and minor axes was calculated to obtain the aspect ratio of the corresponding connected region. After calculating the aspect ratios of all connected regions of the wax crystals, the distribution of all aspect ratios was statistically analyzed to obtain crystal shape distribution parameters. These parameters characterize the elongation, platy nature, and regularity of the wax crystals. Different types of waxes exhibit significant differences in their aspect ratio distributions.

[0143] Simultaneously, a gray-level co-occurrence matrix (GLCM) is constructed for the wax crystal region in the wax crystal image data. The construction process of the GLCM is as follows: a preset spatial offset direction and distance for pixel pairs are selected, and all pixels within the wax crystal region are traversed. The frequency of adjacent occurrences of pixels with gray level m and pixels with gray level n under the specified direction and distance is counted one by one. The statistical results are filled into the corresponding position in the m-th row and n-th column of a two-dimensional matrix to form a frequency matrix. The frequency matrix is ​​then normalized by dividing each element value in the matrix by the sum of all elements in the matrix to obtain a GLCM where each element represents the joint occurrence probability.

[0144] After constructing the gray-level co-occurrence matrix (GLCM), the following texture features are extracted based on the GLCM to obtain the internal texture parameters of the crystal: The sum of squares of each element in the GLCM is calculated as the texture energy. Texture energy reflects the uniformity of gray-level distribution within the wax crystal region; a higher energy value indicates a more uniform gray-level distribution and less texture variation within the region. The sum of the products of the squared differences between each element in the GLCM and its row and column indices is calculated as the texture contrast. Texture contrast reflects the severity of gray-level changes within the wax crystal region; a higher contrast value indicates a more significant gray-level difference between adjacent pixels within the region, and a clearer crystal edge. The sum of the products of the row and column indices of each element in the GLCM and their deviations from their mean is calculated as the texture correlation. Texture correlation reflects the degree of linear dependence of pixel gray-level in space within the wax crystal region; a higher correlation value indicates a stronger regularity in gray-level changes along a specified direction within the region. The negative value of the sum of the products of each element in the GLCM and its natural logarithm is calculated as the texture entropy. Texture entropy reflects the complexity and disorder of texture within a wax crystal region. The larger the entropy value, the richer the texture patterns and the more random the grayscale distribution within the region.

[0145] It should be noted that a preset pixel pair spatial offset direction and distance are selected. The offset distance is determined based on the crystal size and image resolution, typically ranging from 1 to 3 pixels, to achieve a balance between capturing texture details and suppressing noise. Multiple offset directions are uniformly selected within the range of 0 to 180 degrees. A gray-level co-occurrence matrix is ​​constructed for each direction, and texture features are extracted. The average value of each direction is then taken to eliminate the influence of the random orientation of the crystal in the image on the texture parameters. Those skilled in the art can determine suitable offset parameters based on the actual size of the wax crystal and the image magnification; no further limitations are imposed here.

[0146] Texture energy, texture contrast, texture correlation, and texture entropy are combined as internal texture parameters of the crystal and integrated with crystal shape distribution parameters to form morphological combination features. These morphological combination features simultaneously contain information about the external geometric structure and internal texture structure of the crystal, which can be used to further distinguish the crystallization modes and aggregation states of different types of wax crystals, improving the accuracy of subsequent wax type identification and wax content grading.

[0147] S105: Substitute the coverage feature into the preset piecewise calibration function to calculate the wax content value. Match the crystal size feature and morphological combination feature with the preset wax type feature reference library to obtain the wax type. Please refer to [link / reference]. Figure 3 .

[0148] The following is a description of the technical terms used in this application:

[0149] The pre-defined piecewise calibration function is a pre-established quantitative calculation model used to convert wax area coverage characteristics into wax content values. This function uses wax area coverage as the input variable and wax content as the output variable. Based on different numerical ranges of wax area coverage, it employs different forms of mathematical equations for piecewise fitting to compensate for the nonlinear relationship between coverage and content caused by overlap of wax crystals along the optical path. The piecewise calibration function is established during the system calibration phase after measuring a series of standard samples and is directly called during formal sample testing.

[0150] Optical integral features refer to the characteristic parameters used to characterize the cumulative optical effects of wax crystals along the optical axis under high-concentration superposition conditions. Specifically, they include the average brightness value and average transmission attenuation depth of wax crystal image data.

[0151] Specifically, a series of standard essential oil samples with wax content gradients covering the target detection range are precisely prepared using the gravimetric method. After processing each standard sample according to the complete detection process from S101 to S104, the corresponding coverage characteristic measured value is determined. A calibration curve is plotted with the measured coverage characteristic value as the abscissa and the known wax content as the ordinate. The segment node position is determined based on the response characteristics of the calibration curve in different content ranges. A linear equation is fitted in the low content linear response range, and a nonlinear equation is fitted in the high content nonlinear response range.

[0152] Preset wax type feature reference library: refers to a pre-established database containing wax feature vectors extracted from standard samples of known wax types under the same testing conditions.

[0153] Specifically, calibrated essential oil samples of known wax types are selected, and wax crystal image data are acquired under the unified temperature control and cooling and standard optical imaging conditions described in S101 to S104. Corresponding morphological combination parameters such as coverage features, D10 / D50 / D90 size features, aspect ratio, and texture features are extracted. Statistical analysis is performed on multiple samples of the same wax type to obtain the characteristic distribution range of that type of wax, and this range is used as the standard feature record of that wax type in the reference library.

[0154] In some possible implementation methods, the calculation of wax content is based on the mapping relationship between coverage characteristics and a preset piecewise calibration function. This preset piecewise calibration function consists of multiple coverage intervals and corresponding calibration equations. Each coverage interval corresponds to an independent function expression, used to describe the nonlinear correspondence between wax coverage and the actual wax content within that interval. In the actual calculation process, the interval range to which the coverage characteristics of the current essential oil sample belong is determined, and the calibration equation corresponding to that interval is selected from the preset piecewise calibration function. The coverage characteristics are then substituted into this calibration equation as input variables, and the corresponding wax content value is obtained through function calculation. This process adapts the nonlinear response to different wax precipitation stages through piecewise functions, enabling a high-sensitivity mapping relationship to be used in low-coverage areas and a saturated correction mapping relationship to be used in high-coverage areas, thereby improving the stability and consistency of wax content estimation under different wax precipitation levels.

[0155] The process of determining the wax type involves constructing a unified feature representation vector based on crystal size and morphological combination features, and matching it with a pre-defined wax type feature reference library. The crystal size features D10, D50, and D90 are used sequentially as input parameters for the size dimension. Simultaneously, the crystal shape distribution parameters and internal texture parameters from the morphological combination features are concatenated or spliced ​​to form a complete feature vector for the wax type to be tested. This feature vector simultaneously contains crystal size distribution information and structural morphology information, thus enabling the characterization of the wax crystallization structure from multiple dimensions.

[0156] The similarity between the feature vector of the wax type to be tested and each reference feature vector in the preset wax type feature reference library is calculated. During the similarity calculation, a distance-based method can be used, such as calculating the Euclidean distance between feature vectors, to obtain the degree of difference between the test sample and each reference wax type. The wax type corresponding to the reference feature vector with the smallest distance is taken as the determination result of the current essential oil sample. In this way, multi-dimensional crystal structure features are mapped to the wax type category space, thereby completing wax type identification.

[0157] In some possible implementations, before substituting the coverage feature into a preset piecewise calibration function to calculate the wax content value, a saturation analysis is performed on the wax precipitation state of the current essential oil sample to determine whether the coverage feature has entered the area saturation region caused by the overlap of wax crystals in the optical path direction.

[0158] The specific method of saturation analysis is as follows: the coverage characteristics of the current essential oil sample are compared with preset saturation criteria. The preset saturation criteria can be set when the coverage characteristics exceed a preset area saturation threshold. This area saturation threshold is determined by testing a series of standard samples with known wax content, plotting a coverage versus content calibration curve, and identifying the area saturation threshold when the slope of a point on the curve decreases by more than a preset percentage (e.g., 10%) compared to the slope of the linear segment. The coverage value corresponding to that point is the area saturation threshold. The slope of the coverage characteristics' response to wax content decreases to below a certain proportion of the slope of the low-content linear region. When the coverage characteristics meet any of the above saturation criteria, the current essential oil sample is determined to be in a high-concentration superposition state.

[0159] Once it is determined that the state is in a high concentration superposition state, the average brightness value of each wax crystal connected region in the wax crystal image data and the average transmission attenuation depth at the corresponding position in the bright field transmission image data are extracted as optical integral features.

[0160] The average brightness value is extracted as follows: For each connected region of the wax crystal, all pixels contained within that region are located in the orthogonal transmission image data. The grayscale values ​​of each pixel are read, and the arithmetic mean of these grayscale values ​​is calculated to obtain the regional average brightness of that connected region. The arithmetic mean of the regional average brightness of all connected regions of the wax crystal is then taken to obtain the average brightness value of the wax crystal image data. This average brightness value reflects the cumulative intensity of the birefringence effect of the wax crystal in the orthogonal polarization optical path direction. When the crystals overlap along the optical path direction, the more overlapping layers there are, the stronger the cumulative birefringence response, and the higher the average brightness value.

[0161] The average transmission attenuation depth is extracted as follows: For each connected region of the wax crystal, locate all pixels within the corresponding mapped region in the bright-field transmission image data, read the grayscale value of each pixel, and calculate the arithmetic mean of these grayscale values ​​to obtain the regional average transmission intensity of the connected region. Take the arithmetic mean of the regional average transmission intensities of all connected regions of the wax crystal to obtain the average transmission intensity of the wax crystal image data. Subtract the ratio of this average transmission intensity to the average grayscale value of the background in the sample-free region of the bright-field transmission image data from this value to obtain the average transmission attenuation depth. This average transmission attenuation depth reflects the cumulative degree of scattering and absorption of transmitted light by the wax crystal in the optical path direction. The more overlapping layers, the stronger the accumulated scattering attenuation, and the greater the average transmission attenuation depth.

[0162] By multiplying the coverage feature, average brightness value, and average transmission attenuation depth, a composite quantitative index is constructed. This composite quantitative index constitutes an approximate estimate of the three-dimensional volume of the wax crystal in a geometric sense. The coverage feature carries information about the transverse two-dimensional projected area of ​​the wax crystal in the field of view plane, while the average brightness value and average transmission attenuation depth together carry information about the longitudinal cumulative optical thickness of the wax crystal in the optical path direction. The product of the three can compensate for the information loss caused by the saturation of the single coverage feature due to the overlapping of crystal projections under high concentration superposition conditions, which cannot effectively reflect the information loss as the content continues to increase.

[0163] The constructed composite quantitative index is substituted into the nonlinear calibration equation corresponding to the high content range in the preset piecewise calibration function to calculate the wax content value. Since the composite quantitative index can still maintain a monotonic response to the increase in wax content after the coverage characteristic tends to saturate, its substitution into the calibration equation can effectively extend the upper limit of the linear response of wax content quantitative detection and improve the quantitative accuracy of high-concentration essential oil samples.

[0164] In some possible implementation methods, a pre-defined segmented calibration function is constructed in advance through standard essential oil sample calibration experiments to establish the correspondence between coverage characteristics and wax content values.

[0165] Specifically, multiple standard essential oil samples with known wax content values ​​are selected. Under the same temperature control and cooling conditions and image acquisition conditions as the essential oil samples to be tested, corresponding wax crystal image data are acquired. The coverage characteristics of each standard essential oil sample are then calculated using the aforementioned method. Subsequently, the known wax content value of each standard essential oil sample is used as the true calibration value, and the corresponding coverage characteristic is used as the input variable to construct a sample correspondence between the coverage characteristic and the wax content value.

[0166] Furthermore, based on the variation pattern between coverage characteristics and wax content values, the calibration samples are divided into intervals. Specifically, the variation range of coverage characteristics for all standard essential oil samples is statistically analyzed, and segmentation nodes are determined based on the response characteristics during the wax precipitation process. When the coverage characteristic is in a low range, the wax crystals are in the initial precipitation stage, and the coverage characteristic and wax content value maintain an approximately linear relationship; therefore, a linear calibration interval is set accordingly. When the coverage characteristic exceeds the preset segmentation node, as the number of wax crystals increases and the spatial superposition between crystals intensifies, the image coverage gradually approaches saturation. At this point, the coverage characteristic and the actual wax content value exhibit a non-linear relationship; therefore, a non-linear calibration interval is set accordingly.

[0167] After segmentation, corresponding calibration equations are established for different intervals, based on coverage characteristics. Less than or equal to segment node At that time, a linear calibration equation is used: ,in, This indicates the wax content value. Indicates coverage feature, and This represents the linear calibration parameters obtained by fitting calibration data from standard essential oil samples.

[0168] When coverage features Greater than segment node At this time, nonlinear calibration equations are used, for example: or ,in, , , , as well as All parameters are calibration parameters, obtained by least-squares fitting of the coverage characteristics and corresponding wax content values ​​of standard essential oil samples within the high coverage range.

[0169] The piecewise calibration function constructed in the above manner can be adapted to the variation law between the coverage characteristics and the actual wax content in different wax precipitation stages. It maintains a high linear response capability in the low-concentration wax precipitation stage and reduces the estimation deviation caused by coverage saturation through nonlinear compensation in the high-concentration wax precipitation stage, thereby improving the accuracy and stability of the wax content calculation results.

[0170] S106 combines the wax content value and wax type to output a wax test report for the essential oil sample.

[0171] In some possible implementation methods, after calculating the wax content and determining the wax type, a test report data record is created. This data record includes a content field and a type field. The wax content value is written to the content field, and the wax type is written to the type field. A sample number and a test timestamp are assigned to the data record. The completed data record is then formatted according to a preset output format to generate a readable or storable wax test report file. The output format can be any of the following: tabular text format, key-value pair text format, or structured data exchange format. The formatting process arranges the content field and type field in a specified order and adds corresponding field name labels, enabling the operator receiving the report or external system to identify the meaning of each field.

[0172] The formatted wax test report file is output to the preset storage path or transmission interface to complete the merged output of the wax test report. This wax test report is used to standardize the recording and quality traceability management of the wax precipitation state of essential oil samples. It is applied to scenarios such as production quality control, warehouse stability assessment and process parameter feedback adjustment.

[0173] Specifically, the wax content value in the wax test report is used to quantify the degree of wax precipitation in the essential oil sample, providing a continuous numerical basis for subsequent process control, such as serving as a key input parameter in cooling process optimization or filtration process design; the wax type is used to characterize the differences in crystal structure or composition of different waxes, providing a structural basis for raw material source analysis, formula structure optimization, and consistency comparison between different batches of samples; the sample number and test timestamp are used to establish a unique identifier and time correlation for the essential oil sample, so that the test results can correspond one-to-one with the specific production batch, storage period, and processing conditions, thereby supporting full-process traceability.

[0174] This application controllably excites the transformation process of waxes from a dissolved state to a crystalline state in essential oil samples under controlled-temperature cooling-induced crystallization conditions. By combining simultaneous acquisition and spatial alignment processing of orthogonal transmission imaging and bright-field transmission imaging, the wax crystals are synergistically expressed in both birefringence and scattering responses. Then, through threshold segmentation based on statistical optimization and connected-domain structure extraction, the transformation from pixel-level optical signals to crystal-level structural objects is achieved. Furthermore, polarization bright-field response comparison is introduced to normalize and distinguish waxes from non-wax scatterers. Combined with multi-scale feature extraction and composite quantitative index construction, wax content and wax type are jointly characterized and graded in a unified feature space. Since wax crystals and interfering components such as bubbles and pigment particles in natural essential oil systems exhibit highly similar grayscale or scattering performance under ordinary image detection methods, threshold segmentation methods based on single visible light images are difficult to achieve stable differentiation, easily leading to missed detections, false detections, and overestimation of quantitative results. This application addresses these issues by introducing a complementary method of polarization and bright-field information to enhance the birefringence characteristics of wax crystals. This allows for independent enhancement of expression, while the influence of background scattering is weakened through spatial mapping and feature ratio construction. Thus, stable identification and quantitative assessment of wax crystals can be achieved without relying on manual experience for parameter tuning. Therefore, this application can achieve highly reliable image detection of wax crystals under complex interference backgrounds, significantly improving the accuracy and repeatability of wax content measurement. At the same time, it enhances the adaptability to different wax types and different crystallization morphologies, so that the detection results can not only reflect the wax content level, but also reflect the wax structure type and distribution state, thereby effectively supporting the quality grading control, production process optimization and batch consistency management needs of essential oil products.

[0175] The foregoing has shown and described the basic principles, main features, and advantages of this application. Those skilled in the art should understand that this application is not limited to the above embodiments. The embodiments and descriptions in the specification are merely illustrative of the principles of this application. Various changes and modifications can be made to this application without departing from the spirit and scope thereof, and all such changes and modifications fall within the scope of this application as claimed. The scope of protection of this application is defined by the appended claims and their equivalents.

Claims

1. A method for detecting wax defects in natural essential oils based on image segmentation, characterized in that, The method includes: During the temperature-controlled cooling process of the essential oil sample, image data of the essential oil sample under a transmitted light source is acquired. The image data includes orthogonal transmission image data and bright field transmission image data. Based on the orthogonal transmission image data, birefringence bright area detection is performed, threshold segmentation is performed on the orthogonal transmission image data to obtain a segmentation threshold, and pixels in the orthogonal transmission image data that are greater than the segmentation threshold are marked as candidate waxy regions. The candidate wax region is mapped to the corresponding position in the bright field transmission image data to obtain the mapped region. Based on the image features of the mapped region, the candidate wax region is screened and eliminated to obtain wax crystal image data. Multi-scale feature extraction is performed on the wax crystal image data to obtain the wax features of the essential oil sample. The wax features include coverage features, crystal size features, and morphological combination features. The coverage feature is substituted into a preset segmented calibration function to calculate the wax content value. The crystal size feature and the morphological combination feature are matched with a preset wax type feature reference library to obtain the wax type. The wax content value and the wax type are combined and output to obtain the wax test report of the essential oil sample.

2. The method according to claim 1, characterized in that, The step of detecting birefringent bright areas based on the orthogonal transmission image data, and performing threshold segmentation on the orthogonal transmission image data to obtain a segmentation threshold, includes: The orthogonal transmission image data is subjected to contrast-limited histogram equalization to obtain an enhanced polarization image; The enhanced polarization image is subjected to inter-class variance processing to obtain an initial segmentation threshold. Based on the initial segmentation threshold, the enhanced polarization image is segmented into regions to obtain multiple bright response regions. Based on the brightness distribution results corresponding to the high-brightness response region, the initial segmentation threshold is corrected to obtain the corresponding segmentation threshold.

3. The method according to claim 2, characterized in that, The step of marking pixels in the orthogonal transmission image data that are larger than the segmentation threshold as candidate waxy regions includes: Based on the segmentation threshold, the polarization response intensity of each pixel in the orthogonal transmission image data is compared, and the bright pixels with a polarization response intensity greater than the segmentation threshold are extracted. Based on the spatial adjacency relationship between the bright pixels, adjacent bright pixels are aggregated to obtain candidate waxy regions.

4. The method according to claim 1, characterized in that, The step of mapping the candidate waxy region to the corresponding position in the bright field transmission image data to obtain the mapped region includes: The image acquisition parameters corresponding to the orthogonal transmission image data and the bright field transmission image data are obtained respectively. The image acquisition parameters include imaging center position parameters, image scaling parameters, and image rotation parameters. Based on the imaging center position parameters, the orthogonal transmission image data and the bright field transmission image data are spatially aligned to obtain an initial aligned image. Based on the image scaling parameters and the image rotation parameters, the initial aligned image is transformed to obtain the target aligned image; Extract the region boundary coordinates of the candidate waxy region in the orthogonal transmission image data, and based on the coordinate mapping relationship in the target aligned image, map the region boundary coordinates to the corresponding position in the bright field transmission image data to obtain the mapped region boundary coordinates; Based on the mapped region boundary coordinates, the corresponding mapped region is determined in the bright field transmission image data.

5. The method according to claim 4, characterized in that, The process of filtering and eliminating candidate waxy regions based on image features of the mapped region to obtain waxy crystal image data includes: The average brightness of the candidate waxy region in the orthogonal transmission image data is extracted as a first image feature, and the average transmission intensity of the corresponding position of the mapped region in the bright field transmission image data is extracted as a second image feature. Based on the first image features and the second image features, the polarization brightness field response ratio of the candidate wax region is constructed; Based on the polarization bright field response ratio, a response ratio sequence is constructed. According to the response ratio sequence, the candidate waxy regions are divided into a first response ratio category and a second response ratio category. The first response ratio category refers to the candidate region category in which the birefringence response is weaker than the bright field scattering response, corresponding to the non-waxy interference region. The second response ratio category refers to the candidate region category in which the birefringence response is stronger than the bright field scattering response, corresponding to the waxy crystal region. The candidate wax region corresponding to the first response ratio category is taken as the non-wax interference region, the non-wax interference region is removed, and the candidate wax region corresponding to the second response ratio category is determined as wax crystal image data.

6. The method according to claim 5, characterized in that, The step of constructing the polarization brightness field response ratio of the candidate wax region based on the first image features and the second image features includes: Divide the first image feature of the candidate wax region by the second image feature of the mapped region to obtain the polarization brightness field response ratio of the candidate wax region.

7. The method according to claim 5, characterized in that, The step of constructing a response ratio sequence based on the polarization brightness field response ratio, and dividing the candidate waxy region into a first response ratio category and a second response ratio category according to the response ratio sequence, includes: Based on the polarization brightness field response ratio of the candidate wax region, a response ratio sequence is constructed; The response ratio sequence is traversed and segmented to determine the segmentation threshold; Candidate wax regions with a polarization brightness field response ratio less than the classification threshold are classified into a first response ratio category, and candidate wax regions with a polarization brightness field response ratio greater than the classification threshold are classified into a second response ratio category.

8. The method according to claim 1, characterized in that, The step of performing multi-scale feature extraction on the wax crystal image data to obtain the wax characteristics of the essential oil sample includes: The coverage feature is obtained by calculating the ratio of the number of pixels in the connected regions of the wax crystal in the wax crystal image data to the number of pixels in the field of view of the essential oil sample. The equivalent circle diameter is extracted from the connected components of the wax crystal in the wax crystal image data. Based on the equivalent circle diameter, a size frequency distribution is constructed. The first quantile, the second quantile, and the third quantile of the size frequency distribution are extracted to obtain the crystal size features. Calculate the aspect ratio and gray-level co-occurrence matrix of the connected regions of the wax crystal in the wax crystal image data. Based on the aspect ratio, obtain the crystal shape distribution parameters. Based on the gray-level co-occurrence matrix, obtain the crystal internal texture parameters. Combine the crystal shape distribution parameters and the crystal internal texture parameters to form a morphological combination feature.

9. The method according to claim 1, characterized in that, The process involves substituting the coverage feature into a preset piecewise calibration function to calculate the wax content value, and then matching the crystal size feature and the morphological combination feature with a preset wax type feature reference library to obtain the wax type, including: Based on the coverage characteristics, a corresponding calibration equation is selected from the preset segmented calibration functions, and the coverage characteristics are substituted into the calibration equation to calculate the wax content value. Extract the crystal size features and the morphological combination features to construct a feature vector of the wax type to be tested. Match the feature vector of the wax type to be tested with the reference feature vector in the preset wax type feature reference library to determine the wax type of the essential oil sample.

10. The method according to claim 9, characterized in that, Also includes: Based on the coverage feature, the wax precipitation state of the essential oil sample is saturated. When the coverage feature meets the saturation determination condition, it is determined to be in a high concentration superposition state. The optical integral features of the wax crystal connected components in the image data are extracted. Based on the coverage characteristics and the optical integral characteristics, a composite quantitative index is constructed. The composite quantitative index is then substituted into a preset piecewise calibration function to calculate the wax content value.