Milk product microstructure image analysis method and device
By separating and binarizing the images of dairy products by monochrome channel and binarizing the image statistics, the accuracy and consistency of image analysis of dairy products are solved, and the automation and efficiency of dairy products quality control are achieved.
Patent Information
- Application Number
- CN202510437525.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-04-09
AI Technical Summary
In the prior art, there are accuracy and consistency problems in the analysis of image of microstructure of dairy products, which makes it difficult to achieve dairy product quality control.
By acquiring the microstructure images of dairy products, performing monochrome channel separation and binarization processing, multiple image statistics are determined, and the quality control indicators of dairy products are automatically determined based on the correlation between these statistics and quality control indicators.
It improves the accuracy and consistency of image analysis of microstructure of dairy products, reduces the subjectivity of manual interpretation, and improves the efficiency of dairy quality control.
Smart Images

Figure CN119963550A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dairy product processing, and in particular to a method and device for analyzing a dairy product microstructure image. Background Art
[0002] Dairy product microstructure images refer to images of the internal structure of dairy products obtained through various microscopic analysis techniques, which are used to show the organization, morphology, component distribution and other characteristics of dairy products at the microscopic scale. Dairy product microstructure image analysis plays an important role in dairy product research and production. Through a variety of advanced imaging technologies, we can deeply understand the microstructural characteristics of dairy products, thereby optimizing product formulas, improving processing technology, and improving product quality, and provide a scientific basis for the research and development of new dairy products.
[0003] In related technologies, researchers need to observe the microscopic structure images of various dairy products with the naked eye and perform manual analysis based on the observation results. Due to the different experiences, visual perceptions and judgment standards of different researchers, there may be subjective differences in the interpretation of the same image. In addition, the microstructure of dairy products is complex, and manual analysis is difficult to accurately quantify these structural features.
[0004] Therefore, how to improve the accuracy and consistency of image analysis of dairy product microstructure has become a technical problem that needs to be urgently solved in the industry. Summary of the invention
[0005] The present invention provides a method and device for analyzing the microstructure image of a dairy product, which are used to solve the technical problem of how to improve the accuracy and consistency of the analysis of the microstructure image of a dairy product.
[0006] The present invention provides a method for analyzing a microstructure image of a dairy product, comprising: Acquire microstructure images of target dairy products; Performing monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and performing binarization processing on the grayscale image to obtain a binarized image; Determining a plurality of image statistics based on the grayscale image and the binarized image; Based on the multiple image statistics and the correlation between each image statistic and the quality control indicator, the quality control indicator of the target dairy product is determined.
[0007] In some embodiments, the monochromatic channel separation of the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and binarization of the grayscale image to obtain a binarized image includes: Separating the microstructure image into single-color channels to obtain a grayscale image of the microstructure image in a target color channel; the target color channel is determined based on the contrast of the protein gel in the dairy product in each color channel; Determining the grayscale levels in the grayscale image and the number of pixels at each grayscale level; Traversing each gray level in turn, updating the cumulative probability and average grayscale corresponding to each gray level based on the ratio of the number of pixels at each gray level to the total number of pixels in the gray image, and determining the inter-class variance corresponding to each gray level; Determine the gray level corresponding to the maximum value of the inter-class variance as a binarization threshold; The grayscale image is binarized based on the binarization threshold to obtain the binarized image.
[0008] In some embodiments, the determining a plurality of image statistics based on the grayscale image and the binarized image comprises: Determine multiple boxes with different side lengths; For boxes with different side lengths, determining the minimum number of boxes required to cover the white pixels in the binary image; Establishing a logarithmic relationship between the minimum number of boxes and the side length; Fitting a scatter plot corresponding to the logarithmic relationship, and determining a fractal dimension based on a slope of a fitting straight line; The fractal dimension is determined as the image statistic.
[0009] In some embodiments, the determining a plurality of image statistics based on the grayscale image and the binarized image comprises: Performing a two-dimensional discrete Fourier transform on the grayscale image to obtain a frequency spectrum of the grayscale image; Determining a power spectral density of the grayscale image based on the frequency spectrum of the grayscale image; Performing a two-dimensional inverse discrete Fourier transform on the power spectral density to obtain a two-dimensional autocorrelation function of the grayscale image; Based on the two-dimensional autocorrelation function, determining a radial autocorrelation function value; The radial autocorrelation function value is determined as the image statistic.
[0010] In some embodiments, the determining a plurality of image statistics based on the grayscale image and the binarized image comprises: determining porosity based on a ratio of a number of white pixels in the binary image to a total number of pixels in the binary image; The porosity is determined as the image statistic.
[0011] In some embodiments, the determining a plurality of image statistics based on the grayscale image and the binarized image comprises: Marking connected areas on the binary image to determine a plurality of pores; Based on the number of pixels of each pore, the area of each pore is determined; Based on the area of each pore, the maximum pore area, the mean pore area, and the standard deviation of the pore area are determined; The maximum pore area, the pore area mean, and the pore area standard deviation are determined as the image statistics.
[0012] In some embodiments, the determining a plurality of image statistics based on the grayscale image and the binarized image comprises: Determine a boundary pixel in the binary image; the boundary pixel is a white pixel and there are black pixels in neighboring pixels of the boundary pixel; Determining a ratio of a perimeter to an area of a foreground region based on a ratio of the number of boundary pixels to the number of white pixels in the binary image; The ratio of the perimeter to the area of the foreground region is determined as the image statistic.
[0013] In some embodiments, the correlation between each image statistic and the quality control indicator is determined based on the following steps: Obtain microstructure images of multiple sample dairy products, as well as multiple quality control indicators of each sample dairy product; Determine multiple image statistics of each sample dairy product based on the microstructure image of each sample dairy product; Determine the correlation coefficient between each image statistic and each quality control indicator; When the correlation coefficient between any image statistic and any quality control indicator is greater than a preset threshold, it is determined that there is a correlation between the any image statistic and the any quality control indicator.
[0014] The present invention provides a dairy product microstructure image analysis device, comprising: An acquisition module, used for acquiring a microstructure image of a target dairy product; A processing module, used for performing monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and performing binarization processing on the grayscale image to obtain a binarized image; A statistical module, used for determining a plurality of image statistics based on the grayscale image and the binarized image; The parsing module is used to determine the quality control index of the target dairy product based on the multiple image statistics and the correlation between each image statistic and the quality control index.
[0015] The present invention provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for analyzing the microstructure image of dairy products when executing the computer program.
[0016] The method and device for analyzing the microstructure image of a dairy product provided by the present invention obtain the microstructure image of the target dairy product; perform monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and perform binarization processing on the grayscale image to obtain a binarized image; determine multiple image statistics based on the grayscale image and the binarized image; determine the quality control index of the target dairy product based on the multiple image statistics and the correlation between each image statistics and the quality control index; by performing monochrome channel separation and binarization processing on the microstructure image, multiple image statistics can be extracted, and the microstructure characteristics of the dairy product can be quantified; the quality control index of the target dairy product is determined according to the correlation between the image statistics and the quality control index, without the need to manually observe the microstructure image of the dairy product, and without the need to manually analyze the results of naked eye observation, thus avoiding the subjectivity of manual interpretation of the image, not only improving the accuracy of the analysis of the microstructure image of the dairy product, but also improving the consistency of the analysis results of the microstructure image of the dairy product; and the above process can be automatically executed by a computer, thereby improving the efficiency of the analysis of the microstructure image of the dairy product. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a schematic diagram of the process of the dairy product microstructure image analysis method provided by the present invention.
[0020] Figure 2 It is a schematic structural diagram of the dairy product microstructure image analysis device provided by the present invention.
[0021] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units or modules is not necessarily limited to those steps or units or modules that are clearly listed, but may include other steps or units or modules that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] Figure 1 Schematic diagram of the process of the microstructure image analysis method of dairy products provided by the present invention, such as Figure 1 As shown, the method includes step 110 , step 120 , step 130 and step 140 .
[0025] Step 110: Acquire a microstructure image of the target dairy product.
[0026] Specifically, the execution subject of the dairy product microstructure image analysis method provided in the embodiment of the present invention is a dairy product microstructure image analysis device. The device can be implemented by software, such as a dairy product microstructure image analysis program; or by hardware, such as a computer or server that executes the dairy product microstructure image analysis method.
[0027] Dairy products refer to a type of food made from animal milk, such as milk, yogurt, cheese, etc. The target dairy products are those that need to be analyzed through microstructure images.
[0028] The microstructure image of the target dairy product refers to the image of the internal structure of the dairy product obtained by microscopy, which is used to study its component distribution, structural characteristics and changes during processing. The microscopy techniques that can be used include optical microscopy, confocal laser scanning microscopy, electron microscopy and cryo-scanning electron microscopy.
[0029] For example, when the target dairy product is yogurt, 1 (ml) yogurt with 20 (μl) of dye was mixed and incubated at room temperature in the dark for 30 The samples were observed using a laser scanning confocal microscope with an excitation wavelength of 640 (nanometers), emission wavelengths from 663 to 738 , select 20X (times) or 40X (times) objective lens for observation, adjust the laser intensity, and take pictures of the normal exposure field of view to obtain microscopic structure images.
[0030] Step 120: performing monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image in a single color channel, and performing binarization processing on the grayscale image to obtain a binarized image.
[0031] Specifically, considering that the features of some microstructures may be more obvious in a specific color channel, these features can be observed and analyzed more clearly by separating the monochrome channel. Moreover, grayscale images can highlight the texture, shape and structure of the microstructure, making image processing tasks such as edge detection and feature extraction more effective.
[0032] The microstructure image can be separated into single-color channels, and grayscale processing can be performed to obtain a grayscale image of the microstructure image under a single color channel. The microstructure image can be separated into red, green, and blue channels to obtain a red channel image, a green channel image, and a blue channel image, respectively. The appropriate single-color channel image can be selected according to the contrast of the features to be observed in each color channel image. For example, the green channel image can be selected to be retained, and the red channel image and the blue channel image can be discarded. Then the green channel image is converted to a grayscale image. Grayscale images only require one byte to represent the brightness value of each pixel, while color images usually require three bytes. This greatly reduces storage space and transmission bandwidth.
[0033] On this basis, the grayscale image is binarized and converted into a binary image (an image consisting of only black and white pixels), which further simplifies the image content and facilitates morphological analysis, target detection, and image segmentation. Through the binary image, specific microstructural features (such as pores) can be quickly identified and extracted, providing a basis for quantitative analysis.
[0034] Step 130: Determine a plurality of image statistics based on the grayscale image and the binarized image.
[0035] Specifically, image statistics refer to a series of quantitative features extracted from an image to describe the characteristics, content, and distribution of the image. These statistics can provide global or local information about the image, help analyze the nature of the image, detect specific patterns in the image, and support image processing and computer vision tasks.
[0036] Multiple image statistics can be determined from grayscale images and binary images respectively, and these image statistics can be used to describe information such as image characteristics, texture, shape, etc.
[0037] Step 140: Determine the quality control index of the target dairy product based on multiple image statistics and the correlation between each image statistic and the quality control index.
[0038] Specifically, quality control indicators refer to parameter indicators used to control the safety, hygiene and quality of dairy products, such as shear viscosity, clarity index, particle size, etc. Shear viscosity is an important indicator for measuring the fluidity and texture of dairy products. Clarity index is used to measure the transparency or turbidity of dairy products. Particle size is an important indicator in dairy product quality control, affecting the taste and stability of the product.
[0039] There is a correlation between image statistics and quality control indicators. For example, image statistics can be used to determine the distribution and aggregation state of components such as fat and protein in dairy products. The distribution of components such as fat and protein will affect the viscosity of dairy products. The more uniform the distribution of components such as fat and protein, the higher the clarity index is, indicating better quality dairy products. Image statistics can be used to determine the size and shape of particles in dairy products, that is, the particle size.
[0040] The correlation between image statistics and quality control indicators can be quantified by correlation coefficients. For example, a large number of sample dairy products belonging to the same category as the target dairy product can be collected for microstructure images and actual measurement values of quality control indicators. After processing the microstructure images of the sample dairy products, multiple image statistics can be obtained. The functional relationship between each image statistic and the quality control indicator can be fitted, with the image statistics as the variable and the actual measurement value of the quality control indicator as the dependent variable. The image statistics of the target dairy product are input into the functional relationship obtained after fitting, and the predicted value of the quality control indicator of the target dairy product can be obtained.
[0041] The statistics extracted by image processing technology can provide important reference for the quality control of dairy products, help optimize the production process and improve product quality.
[0042] The dairy product microstructure image analysis method provided by the embodiment of the present invention obtains the microstructure image of the target dairy product; performs monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and performs binarization processing on the grayscale image to obtain a binarized image; based on the grayscale image and the binarized image, multiple image statistics are determined; based on the multiple image statistics and the correlation between each image statistics and the quality control index, the quality control index of the target dairy product is determined; by performing monochrome channel separation and binarization processing on the microstructure image, multiple image statistics can be extracted, and the microstructure characteristics of the dairy product can be quantified; according to the correlation between the image statistics and the quality control index, the quality control index of the target dairy product is determined, and there is no need to manually observe the microstructure image of the dairy product, and there is no need to manually analyze the results of naked eye observation, thereby avoiding the subjectivity of manual interpretation of the image, not only improving the accuracy of the dairy product microstructure image analysis, but also improving the consistency of the dairy product microstructure image analysis results; and the above process can be automatically executed by a computer, thereby improving the efficiency of the dairy product microstructure image analysis.
[0043] It should be noted that each implementation of the present invention can be freely combined, the order can be changed, or it can be executed separately, and does not need to rely on or depend on a fixed execution order.
[0044] In some embodiments, performing monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and performing binarization processing on the grayscale image to obtain a binarized image includes: The microstructure image is separated into single-color channels to obtain a grayscale image of the microstructure image under a target color channel; the target color channel is determined based on the contrast of the protein gel in the dairy product in each color channel; Determine the gray levels in a grayscale image and the number of pixels that appear at each gray level; Traverse each gray level in turn, update the cumulative probability and average grayscale corresponding to each gray level based on the ratio of the number of pixels at each gray level to the total number of pixels in the gray image, and determine the inter-class variance corresponding to each gray level; The gray level corresponding to the maximum value of the inter-class variance is determined as the binarization threshold; The grayscale image is binarized based on the binarization threshold to obtain a binarized image.
[0045] Specifically, the microstructure image can be separated into single-color channels to obtain a grayscale image of the microstructure image under the target color channel. The target color channel can be determined according to the contrast of the protein gel in the dairy product in each color channel. For example, the protein gel has a high contrast in the green channel and is easy to identify. The maximum between-class variance method (OTSU) can be used to convert the grayscale image into a binary image.
[0046] First, we can calculate the image grayscale histogram. Assume that the input grayscale image can be expressed as . Represents the coordinates of the pixel in the image. The image size is (horizontal size, vertical size). The grayscale range is In the case of an 8-bit grayscale image Usually 256. Each gray level can be counted The number of pixels that appear, generating a grayscale histogram , .
[0047] Secondly, initialize the relevant parameters. You can define the cumulative gray level frequency : Calculate the proportion of pixels of each gray level to the total pixels, that is, there is a relationship: .
[0048] This relationship reflects the gray level The probability of occurrence in the image. It can be further expressed as the cumulative probability of the foreground (the image area where the white pixels are located) , the cumulative probability of the background (the image area where the black pixels are located) Foreground average grayscale , background average grayscale The between-class variance .
[0049] Again, traverse each gray level in turn, starting from the current gray level arrive Traverse, based on the ratio of the number of pixels at each gray level to the total number of pixels in the grayscale image , update the cumulative probability and average grayscale corresponding to each gray level, and determine the inter-class variance corresponding to each gray level.
[0050] The cumulative probability includes the foreground cumulative probability and the background cumulative probability. The updated foreground cumulative probability can be expressed as The updated background cumulative probability can be expressed as .
[0051] The average grayscale includes the foreground average grayscale and the background average grayscale. The updated foreground average grayscale can be expressed as , the updated background average grayscale can be expressed as .
[0052] At this point, the current gray level can be calculated The between-class variance under .
[0053] Finally, during the traversal process, the maximum inter-class variance at each gray level can be recorded. The corresponding gray level The value is determined as the binarization threshold. This value is usually around the 30th percentile of the grayscale. Pixels with brightness (pixel value) lower than the threshold can be assigned a value of 0 (called black pixels), and pixels with brightness higher than the threshold can be assigned a value of 1 (called white pixels). After binarization processing, a binary image is obtained.
[0054] The dairy product microstructure image analysis method provided in the embodiment of the present invention performs monochrome channel separation and binarization processing on the microstructure image, can extract multiple image statistics, and can quantify the microstructure characteristics of the dairy product.
[0055] In some embodiments, the image statistics include fractal dimension, radial autocorrelation function value, porosity, maximum pore area, pore area mean, pore area standard deviation, and ratio of foreground region perimeter to area.
[0056] The above image statistics can effectively quantify the microstructural characteristics of dairy products. For example, the fractal dimension can quantitatively represent the filling degree of protein in dairy products; the radial autocorrelation function value can quantitatively represent the continuity of the microstructure of dairy products; the porosity, maximum pore area, pore area mean, and pore area standard deviation can represent the density of the microstructure of dairy products; and the ratio of the perimeter to the area of the foreground area can represent the complexity of the microstructure of dairy products.
[0057] In some embodiments, based on the grayscale image and the binarized image, a plurality of image statistics are determined, including: Determine multiple boxes with different side lengths; For boxes of different side lengths, determine the minimum number of boxes required to cover the white pixels in the binary image; Establish a logarithmic relationship between the minimum number of boxes and the side length; Fit the scatter plot corresponding to the logarithmic relationship and determine the fractal dimension based on the slope of the fitted line; Determine the fractal dimension as an image statistic.
[0058] Specifically, the fractal dimension provides a quantitative measure of the detail variation of a fractal object at different scales, and can be used to quantitatively represent the degree of protein filling. The fractal dimension can be calculated using the box-counting dimension.
[0059] First, we can calculate the number of covering boxes. We can choose boxes (grid cells) with different side lengths. Count the minimum number of boxes needed to cover the white part of the two-dimensional image, recorded as That is, try to cover the target fractal with boxes of different sizes and count the number of boxes that completely cover the fractal. When it is larger, fewer boxes are needed; Going smaller, the number of boxes increases, since finer divisions are needed to cover all the fractal details.
[0060] Secondly, we establish a logarithmic relationship between the minimum number of boxes and the side length. According to the definition of box counting dimension, fractal dimension The following relations are satisfied: .
[0061] In actual calculation, since we cannot really let tends to 0, a series of sufficiently small value, get the corresponding value, and then plot about The least squares method can be used to fit these scattered points, and the slope of the fitted straight line obtained after fitting is the required box counting dimension.
[0062] The dairy product microstructure image analysis method provided by the embodiment of the present invention determines the fractal dimension as an image statistic, which can be used to quantitatively represent the protein filling degree.
[0063] In some embodiments, based on the grayscale image and the binarized image, a plurality of image statistics are determined, including: Perform a two-dimensional discrete Fourier transform on the grayscale image to obtain the frequency spectrum of the grayscale image; Determine a power spectral density of the grayscale image based on the frequency spectrum of the grayscale image; Perform a two-dimensional inverse discrete Fourier transform on the power spectral density to obtain the two-dimensional autocorrelation function of the grayscale image; Based on the two-dimensional autocorrelation function, determining a radial autocorrelation function value; The radial autocorrelation function value is determined as the image statistic.
[0064] Specifically, the two-dimensional autocorrelation function can be obtained by using Fourier transform, and then the radial autocorrelation function value can be determined, which is mainly based on the correlation properties of Fourier transform and can simplify the calculation process.
[0065] First, for the grayscale image Perform a two-dimensional discrete Fourier transform (2D DFT) to obtain the spectrum of the grayscale image : .
[0066] in, and are the sizes of the image in the horizontal and vertical directions respectively. is plural, , .
[0067] Secondly, the spectrum The square of the modulus gives the power spectral density , which can be expressed as: .
[0068] in, yes The complex conjugate of .
[0069] Power Spectral Density Perform a two-dimensional inverse discrete Fourier transform (2D IDFT) to obtain the two-dimensional autocorrelation function of the grayscale image : .
[0070] Due to the periodicity of discrete Fourier transform and its inverse transform, the calculation results show autocorrelation characteristics in the entire image range, which describes the correlation between pixels of the image under different spatial displacements. The larger the value, the stronger the correlation at the corresponding displacement; the smaller the value, the weaker the correlation.
[0071] Finally, the average value of the two-dimensional autocorrelation function in a certain direction, or the average value on a circle with (0, 0) as the center, is calculated to obtain the radial autocorrelation function value, which is used to express the correlation characteristics of the image texture in a specific direction (or radial direction).
[0072] The dairy product microstructure image analysis method provided by the embodiment of the present invention determines the radial autocorrelation function value as the image statistic, which can quantitatively represent the continuity of the dairy product microstructure.
[0073] In some embodiments, based on the grayscale image and the binarized image, a plurality of image statistics are determined, including: determining the porosity based on a ratio of the number of white pixels in the binarized image to the total number of pixels in the binarized image; The porosity is determined as an image statistic.
[0074] Specifically, the number of white pixels (representing pores) and all pixels in the binary image can be counted to determine the number of white pixels. and the total number of pixels in the image If the image size is ,but . Porosity .
[0075] The dairy product microstructure image analysis method provided in the embodiment of the present invention determines the porosity as an image statistic, which can quantitatively represent the density of the dairy product microstructure.
[0076] In some embodiments, based on the grayscale image and the binarized image, a plurality of image statistics are determined, including: Mark the connected regions of the binary image and determine multiple pores; Based on the number of pixels of each pore, the area of each pore is determined; Based on the area of each pore, the maximum pore area, the mean pore area, and the standard deviation of the pore area are determined; The maximum pore area, the mean pore area, and the standard deviation of the pore area were determined as image statistics.
[0077] Specifically, the connected regions of the binary image may be marked, and specifically, a 4-connected region marking algorithm may be used.
[0078] You can define white pixels as foreground pixels, traverse the pixels in the binary image, and when the current pixel is a foreground pixel (white pixel), check the marked pixels in its four neighbors above, below, left and right. If there is no marked pixel in the neighborhood, it means that the pixel is the starting point of a new connected area, and assign it a new, unused positive integer label. If there is a marked pixel in the neighborhood, select the minimum value of these neighborhood labels and assign it to the current pixel. This is because the current pixel needs to be merged into the existing connected area.
[0079] During the labeling process, different neighborhoods may bring different label values (labeling conflicts). In this case, an equivalence table is maintained to record these equivalence relations and then processed uniformly to ensure that the same connected area has only one label in the end.
[0080] Each pore can be obtained by the above method. By counting the number of pixels in each pore, the area of each unconnected pore can be obtained (the number of pixels, one pixel can be regarded as one unit area). Therefore, according to the area of each pore, the maximum pore area, the mean pore area and the standard deviation of the pore area can be determined.
[0081] The dairy product microstructure image analysis method provided in the embodiment of the present invention determines the maximum pore area, the mean pore area and the standard deviation of the pore area as image statistics, which can quantitatively represent the density of the dairy product microstructure.
[0082] In some embodiments, based on the grayscale image and the binarized image, a plurality of image statistics are determined, including: Determine the boundary pixels in the binary image; the boundary pixels are white pixels and there are black pixels in the neighboring pixels of the boundary pixels; Determining a ratio of the perimeter to the area of the foreground region based on a ratio of the number of boundary pixels to the number of white pixels in the binary image; The ratio of the perimeter to the area of the foreground region is determined as an image statistic.
[0083] Specifically, the boundary pixels in the binary image can be defined. If the pixel itself is white and there are black pixels in its eight neighbors (up, down, left, right, and four diagonal corners), then the pixel are marked as boundary pixels.
[0084] Traverse all pixels, calculate the ratio of the number of pixels at the boundary to the number of all white pixels, and obtain the ratio of the perimeter to the area of the foreground area.
[0085] The dairy product microstructure image analysis method provided by the embodiment of the present invention determines the ratio of the perimeter to the area of the foreground region as the image statistic, which can quantitatively represent the complexity of the dairy product microstructure.
[0086] In some embodiments, the correlation between each image statistic and the quality control indicator is determined based on the following steps: Obtain microstructure images of multiple sample dairy products, as well as multiple quality control indicators of each sample dairy product; Determine multiple image statistics of each sample dairy product based on the microstructure image of each sample dairy product; Determine the correlation coefficient between each image statistic and each quality control indicator; When the correlation coefficient between any image statistic and any quality control indicator is greater than a preset threshold, it is determined that there is a correlation between any image statistic and any quality control indicator.
[0087] Specifically, microstructure images of a large number of sample dairy products belonging to the same category as the target dairy product and actual measurement values of multiple quality control indicators of each sample dairy product can be obtained. The microstructure images of each sample dairy product can be processed according to the method in the above embodiment to determine multiple image statistics of each sample dairy product.
[0088] The Spearman correlation coefficient method can be used to determine the correlation coefficient between each image statistic and each quality control index. The correlation coefficient is used to measure the degree of correlation. For example, taking the quality control index as an example, the correlation coefficients (absolute values) between the fractal dimension, radial autocorrelation function value, porosity, maximum pore area, pore area mean, pore area standard deviation and the ratio of the perimeter to the area of the foreground area and the index are 0.389, 0.041, 0.545, 0.546, 0.688, 0.601 and 0.504 respectively.
[0089] The preset threshold can be set according to actual needs. The preset threshold can be defined as 0.5. If the correlation coefficient between any image statistic and any quality control indicator is greater than 0.5, it can be determined that the image statistic is correlated with the quality control indicator. In other words, the image statistic can reflect the quality control indicator to a certain extent.
[0090] For example, through analysis, the porosity, the maximum pore area, the mean pore area, the standard deviation of the pore area and the ratio of the perimeter to the area of the foreground area are correlated with the clarification index, and the corresponding correlation coefficient can be determined as the correlation coefficient, thereby determining the fitting functional relationship.
[0091] The dairy product microstructure image analysis method provided in the embodiment of the present invention determines whether there is a correlation between each image statistic and each quality control indicator based on the comparison result of the correlation coefficient between the two and the preset threshold, which can improve the prediction efficiency of the quality control indicator.
[0092] The following describes an apparatus provided by an embodiment of the present invention. The apparatus described below and the method described above can refer to each other.
[0093] Figure 2 Schematic diagram of the structure of the dairy product microstructure image analysis device provided by the present invention. Figure 2 As shown, the device comprises: An acquisition module 210 is used to acquire a microstructure image of a target dairy product; The processing module 220 is used to perform monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and perform binarization processing on the grayscale image to obtain a binarized image; A statistics module 230, for determining a plurality of image statistics based on the grayscale image and the binarized image; The analysis module 240 is used to determine the quality control index of the target dairy product based on multiple image statistics and the correlation between each image statistic and the quality control index.
[0094] The dairy product microstructure image analysis device provided by the embodiment of the present invention obtains the microstructure image of the target dairy product; performs monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and performs binarization processing on the grayscale image to obtain a binarized image; based on the grayscale image and the binarized image, multiple image statistics are determined; based on the multiple image statistics and the correlation between each image statistics and the quality control index, the quality control index of the target dairy product is determined; by performing monochrome channel separation and binarization processing on the microstructure image, multiple image statistics can be extracted, and the microstructure characteristics of the dairy product can be quantified. According to the correlation between the image statistics and the quality control index, the quality control index of the target dairy product is determined, and there is no need to manually observe the microstructure image of the dairy product, and there is no need to manually analyze the results of naked eye observation, thereby avoiding the subjectivity of manual interpretation of the image, not only improving the accuracy of the analysis of the dairy product microstructure image, but also improving the consistency of the analysis results of the dairy product microstructure image; and the above process can be automatically executed by a computer, thereby improving the efficiency of the analysis of the dairy product microstructure image.
[0095] Figure 3 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 3 As shown, the electronic device may include: a processor (Processor) 310, a communication interface (Communications Interface) 320, a memory (Memory) 330 and a communication bus (Communications Bus) 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic command in the memory 330 to execute the method described in the above embodiment, for example: Acquire a microstructure image of a target dairy product; perform monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and perform binarization processing on the grayscale image to obtain a binary image; determine multiple image statistics based on the grayscale image and the binary image; determine the quality control index of the target dairy product based on the multiple image statistics and the correlation between each image statistic and the quality control index.
[0096] In addition, the logic commands in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several commands to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0097] The processor in the electronic device provided in the embodiment of the present invention can call the logic instructions in the memory to implement the above method. Its specific implementation method is consistent with the implementation method of the aforementioned method and can achieve the same beneficial effects, which will not be repeated here.
[0098] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method provided in the above embodiments is implemented.
[0099] Its specific implementation is consistent with the aforementioned method implementation and can achieve the same beneficial effects, so it will not be repeated here.
[0100] An embodiment of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the method described above is implemented.
[0101] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0103] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for analyzing the microstructure of dairy products, characterized in that: include: Acquire microstructure images of target dairy products; Performing monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and performing binarization processing on the grayscale image to obtain a binarized image; Determining a plurality of image statistics based on the grayscale image and the binarized image; Based on the multiple image statistics and the correlation between each image statistic and the quality control indicator, the quality control indicator of the target dairy product is determined.
2. The method for analyzing the microstructure of dairy products according to claim 1, characterized in that: The step of performing monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and performing binarization processing on the grayscale image to obtain a binarized image comprises: Separating the microstructure image into single-color channels to obtain a grayscale image of the microstructure image in a target color channel; the target color channel is determined based on the contrast of the protein gel in the dairy product in each color channel; Determining the grayscale levels in the grayscale image and the number of pixels at each grayscale level; Traversing each gray level in turn, updating the cumulative probability and average grayscale corresponding to each gray level based on the ratio of the number of pixels at each gray level to the total number of pixels in the gray image, and determining the inter-class variance corresponding to each gray level; Determine the gray level corresponding to the maximum value of the inter-class variance as a binarization threshold; The grayscale image is binarized based on the binarization threshold to obtain the binarized image.
3. The method for analyzing the microstructure of dairy products according to claim 1, characterized in that: The step of determining a plurality of image statistics based on the grayscale image and the binarized image comprises: Determine multiple boxes with different side lengths; For boxes with different side lengths, determining the minimum number of boxes required to cover the white pixels in the binary image; Establishing a logarithmic relationship between the minimum number of boxes and the side length; Fitting a scatter plot corresponding to the logarithmic relationship, and determining a fractal dimension based on a slope of a fitting straight line; The fractal dimension is determined as the image statistic.
4. The method for analyzing the microstructure of dairy products according to claim 1, characterized in that: The step of determining a plurality of image statistics based on the grayscale image and the binarized image comprises: Performing a two-dimensional discrete Fourier transform on the grayscale image to obtain a frequency spectrum of the grayscale image; Determining a power spectral density of the grayscale image based on the frequency spectrum of the grayscale image; Performing a two-dimensional inverse discrete Fourier transform on the power spectral density to obtain a two-dimensional autocorrelation function of the grayscale image; Based on the two-dimensional autocorrelation function, determining a radial autocorrelation function value; The radial autocorrelation function value is determined as the image statistic.
5. The method for analyzing the microstructure of dairy products according to claim 1, characterized in that: The step of determining a plurality of image statistics based on the grayscale image and the binarized image comprises: determining porosity based on a ratio of a number of white pixels in the binary image to a total number of pixels in the binary image; The porosity is determined as the image statistic.
6. The method for analyzing the microstructure of dairy products according to claim 1, characterized in that: The step of determining a plurality of image statistics based on the grayscale image and the binarized image comprises: Marking connected areas on the binary image to determine a plurality of pores; Based on the number of pixels of each pore, the area of each pore is determined; Based on the area of each pore, the maximum pore area, the mean pore area, and the standard deviation of the pore area are determined; The maximum pore area, the pore area mean, and the pore area standard deviation are determined as the image statistics.
7. The method for analyzing the microstructure of dairy products according to claim 1, characterized in that: The step of determining a plurality of image statistics based on the grayscale image and the binarized image comprises: Determine a boundary pixel in the binary image; the boundary pixel is a white pixel and there are black pixels in neighboring pixels of the boundary pixel; Determining a ratio of a perimeter to an area of a foreground region based on a ratio of the number of boundary pixels to the number of white pixels in the binary image; The ratio of the perimeter to the area of the foreground region is determined as the image statistic.
8. The method for analyzing the microstructure of dairy products according to claim 1, characterized in that: The correlation between each image statistic and the quality control indicator is determined based on the following steps: Obtain microstructure images of multiple sample dairy products, as well as multiple quality control indicators of each sample dairy product; Determine multiple image statistics of each sample dairy product based on the microstructure image of each sample dairy product; Determine the correlation coefficient between each image statistic and each quality control indicator; When the correlation coefficient between any image statistic and any quality control indicator is greater than a preset threshold, it is determined that there is a correlation between the any image statistic and the any quality control indicator.
9. A dairy product microstructure image analysis device, characterized in that: include: An acquisition module, used for acquiring a microstructure image of a target dairy product; A processing module, used for performing monochrome channel separation on the microstructure image to obtain a grayscale image of the microstructure image under a single color channel, and performing binarization processing on the grayscale image to obtain a binarized image; A statistical module, used for determining a plurality of image statistics based on the grayscale image and the binarized image; The parsing module is used to determine the quality control index of the target dairy product based on the multiple image statistics and the correlation between each image statistic and the quality control index.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the dairy product microstructure image analysis method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Program and calculation method for pore distribution and fractal of microstructure of soil mass
CN106053316A
Activated sludge floc analysis method based on MATLAB
CN106442526A
Paper porosity measuring and pore diameter analyzing method based on digital image processing
CN108519314A
Quantitative evaluation device and method for pore structure characteristics of two-dimensional porous medium
CN110992331A
CNN semantic segmentation self-learning detection method for color steel tile surface defects
CN111080636A