Method and apparatus for analyzing images of dairy microstructure
By performing monochrome channel separation and binarization on images of the microstructure of dairy products, and extracting image statistics, the problems of accuracy and consistency in the analysis of microstructure images of dairy products were solved, and automated determination of quality control indicators was achieved, thus improving the analysis efficiency.
Patent Information
- Application Number
- CN202510437525.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-04-09
AI Technical Summary
Existing technologies for analyzing the microstructure of dairy products suffer from poor accuracy and consistency, mainly due to the subjectivity and complexity of manual analysis.
By performing monochrome channel separation and binarization on microscopic images of dairy products, multiple image statistics are extracted. Based on the correlation between these statistics and quality control indicators, the quality control indicators of dairy products are automatically determined.
It improves the accuracy and consistency of microstructure image analysis of dairy products, reduces the subjectivity of manual interpretation, and increases analysis efficiency.
Smart Images

Figure CN119963550B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of dairy product processing, and in particular to a dairy product microstructure image analysis method and device. BACKGROUND
[0002] A dairy product microstructure image refers to an image of the internal structure of a dairy product obtained through various microscopic analysis techniques, which is used to show the organization, morphology, component distribution, and other characteristics of the dairy product at the microscale. Dairy product microstructure image analysis plays an important role in dairy product research and production. Through various advanced imaging techniques, the microstructure characteristics of dairy products can be deeply understood, thereby optimizing product formulations, improving processing techniques, improving product quality, and providing scientific basis for the research and development of new dairy products.
[0003] In related technologies, researchers need to observe the microstructure images of various dairy products by naked eye and manually analyze according to the observation results. Due to the different experiences, visual perception, and judgment standards of different researchers, there may be subjective differences in the interpretation of the same image, and the microstructure of dairy products is complex, so manual analysis is difficult to accurately quantify these structure characteristics.
[0004] Therefore, how to improve the accuracy and consistency of dairy product microstructure image analysis has become a technical problem to be solved in the industry. SUMMARY
[0005] The present application provides a dairy product microstructure image analysis method and device, which solves the technical problem of how to improve the accuracy and consistency of dairy product microstructure image analysis.
[0006] The present application provides a dairy product microstructure image analysis method, comprising:
[0007] Obtaining a microstructure image of a target dairy product;
[0008] Performing single-color channel separation on the microstructure image to obtain a gray-scale image of the microstructure image in a single color channel, and performing binaryzation processing on the gray-scale image to obtain a binaryzation image;
[0009] Determining a plurality of image statistics based on the gray-scale image and the binaryzation image;
[0010] Determining a quality control indicator of the target dairy product based on the plurality of image statistics and the correlation between each image statistic and the quality control indicator.
[0011] In some embodiments, the performing single-color channel separation on the microstructure image to obtain a gray-scale image of the microstructure image in a single color channel, and performing binaryzation processing on the gray-scale image to obtain a binaryzation image comprises:
[0012] performing single-channel separation on the microstructure image to obtain a gray image of the microstructure image under a target color channel; the target color channel is determined based on contrast of protein gel in the dairy product in each color channel;
[0013] determining a gray level in the gray image and a number of pixels of each gray level;
[0014] sequentially traversing each gray level, updating a cumulative probability and an average gray level corresponding to each gray level based on a ratio of the number of pixels of each gray level to a total number of pixels in the gray image, and determining an inter-class variance corresponding to each gray level;
[0015] determining a gray level corresponding to the maximum inter-class variance as a binarization threshold;
[0016] performing binarization on the gray image based on the binarization threshold to obtain a binarization image.
[0017] In some embodiments, the determining a plurality of image statistics based on the gray image and the binarization image comprises:
[0018] determining a plurality of boxes with different side lengths;
[0019] for the boxes with different side lengths, determining a minimum number of boxes required to cover white pixels in the binarization image;
[0020] establishing a logarithmic relationship between the minimum number of boxes and the side length;
[0021] fitting a scatter plot corresponding to the logarithmic relationship, and determining a fractal dimension based on a slope of the fitted straight line;
[0022] determining the fractal dimension as the image statistics.
[0023] In some embodiments, the determining a plurality of image statistics based on the gray image and the binarization image comprises:
[0024] performing two-dimensional discrete Fourier transform on the gray image to obtain a frequency spectrum of the gray image;
[0025] determining a power spectral density of the gray image based on the frequency spectrum of the gray image;
[0026] performing two-dimensional inverse discrete Fourier transform on the power spectral density to obtain a two-dimensional autocorrelation function of the gray image;
[0027] determining a radial autocorrelation function value based on the two-dimensional autocorrelation function;
[0028] determining the radial autocorrelation function value as the image statistic.
[0029] In some embodiments, the determining the plurality of image statistics based on the grayscale image and the binary image comprises:
[0030] determining a 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;
[0031] determining the porosity as the image statistic.
[0032] In some embodiments, the determining the plurality of image statistics based on the grayscale image and the binary image comprises:
[0033] performing connected component labeling on the binary image to determine a plurality of pores;
[0034] determining an area of each pore based on a number of pixels of the pore;
[0035] determining a maximum pore area, a mean pore area, and a standard deviation of pore area based on the area of each pore;
[0036] determining the maximum pore area, the mean pore area, and the standard deviation of pore area as the image statistics.
[0037] In some embodiments, the determining the plurality of image statistics based on the grayscale image and the binary image comprises:
[0038] determining boundary pixels in the binary image; the boundary pixels are white pixels and a neighbor pixel of the boundary pixel has a black pixel;
[0039] determining a foreground area perimeter-to-area ratio based on a ratio of a number of the boundary pixels to a number of white pixels in the binary image;
[0040] determining the foreground area perimeter-to-area ratio as the image statistic.
[0041] In some embodiments, the correlation between each image statistic and the quality control indicator is determined based on:
[0042] obtaining microstructure images of a plurality of sample dairy products, and a plurality of quality control indicators of each sample dairy product;
[0043] determining a plurality of image statistics of each sample dairy product based on the microstructure image of the sample dairy product;
[0044] determining a correlation coefficient between each image statistic and each quality control indicator.
[0045] In a case where a correlation coefficient between any image statistic and any quality control indicator is greater than a preset threshold, it is determined that the any image statistic and the any quality control indicator have a correlation.
[0046] The present application provides a kind of dairy product microstructure image analysis device, comprising:
[0047] The acquisition module is used to acquire the microstructure image of target dairy product;
[0048] The processing module is used to separate the microstructure image in a single color channel to obtain the gray image of the microstructure image in a single color channel, and to obtain the binary image by binarizing the gray image;
[0049] The statistical module is used to determine a plurality of image statistics based on the gray image and the binary image;
[0050] The analysis module is used to determine the quality control indicator of the target dairy product based on the plurality of image statistics and the correlation between each image statistic and the quality control indicator.
[0051] The present application provides an electronic device, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the dairy product microstructure image analysis method.
[0052] The present application provides a dairy product microstructure image analysis method and device, which acquires the microstructure image of target dairy product;Separate the microstructure image in a single color channel to obtain the gray image of the microstructure image in a single color channel, and to obtain the binary image by binarizing the gray image;Determine a plurality of image statistics based on the gray image and the binary image;Determine the quality control indicator of the target dairy product based on the plurality of image statistics and the correlation between each image statistic and the quality control indicator;By separating the microstructure image in a single color channel and binarizing, a plurality of image statistics can be extracted, the microstructure characteristics of dairy product can be quantified, the quality control indicator of target dairy product can be determined according to the correlation between image statistics and quality control indicators, without manual observation of the microstructure image of dairy product, and without manual analysis of the results of naked eye observation, avoiding the subjectivity of manual image interpretation, not only improving the accuracy of dairy product microstructure image analysis, but also improving the consistency of dairy product microstructure image analysis results;And the above process can be automatically executed by computer, improving the efficiency of dairy product microstructure image analysis. BRIEF DESCRIPTION OF DRAWINGS
[0053] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.
[0054] In order to make the technical solution of the present application or the prior art clearer, the accompanying drawings needed in the following embodiment or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0055] Figure 1 is a flowchart of the dairy product microstructure image analysis method provided by the present application.
[0056] Figure 2 is a structural schematic diagram of the dairy product microstructure image analysis device provided by the present application.
[0057] Figure 3 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0058] In order to make the technical solution of the present application or the prior art clearer, the accompanying drawings needed in the following embodiment or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0059] It should be noted that the terms "first", "second", and the like in the present application are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units or modules does not necessarily limit to those steps or units or modules clearly listed, but can include other steps or units or modules not clearly listed or inherent to these processes, methods, products or devices.
[0060] Figure 1 is a flowchart of the dairy product microstructure image analysis method provided by the present application, as Figure 1 shown, the method comprises steps 110, 120, 130 and 140.
[0061] Step 110, obtaining a microstructure image of the target dairy product.
[0062] Specifically, the execution subject of the dairy product microstructure image analysis method provided by the embodiments of the present application is a dairy product microstructure image analysis device. The device can be realized 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.
[0063] Dairy products refer to a class of foods made from animal milk as raw materials, such as milk, yogurt, cheese, etc. The target dairy product is a dairy product that needs to be analyzed by microstructure image.
[0064] The microstructure image of the target dairy product refers to the image of the internal structure of the dairy product obtained by microscopic techniques, which is used to study the composition distribution, structural characteristics, and changes during the processing. Microscopic techniques that can be used include optical microscopy, confocal laser scanning microscopy, electron microscopy, and cryogenic scanning electron microscopy, etc.
[0065] For example, in the case of the target dairy product being yogurt, 1 ml of yogurt can be mixed with 20 μl of staining agent, incubated at room temperature in the dark for 30 minutes, and observed using a laser scanning confocal microscope system with an excitation wavelength of 640 nm and an emission wavelength of 663-738 nm, using a 20X or 40X objective lens, adjusting the laser intensity, and taking pictures of the normal exposure field to obtain the microstructure image.
[0066] Step 120, separating the microstructure image into a single color channel to obtain a gray-scale image of the microstructure image in a single color channel, and performing binaryzation processing on the gray-scale image to obtain a binary image.
[0067] Specifically, considering that the features of some microstructures may be more obvious in a specific color channel, by separating the single color channel, these features can be more clearly observed and analyzed. And the gray-scale image can highlight the texture, shape and structure of the microstructure, making image processing tasks such as edge detection and feature extraction more effective.
[0068] The microscopic structure image can be separated into single color channels, and after gray scale processing, the gray scale image of the microscopic structure image in a single color channel can be obtained. The microscopic structure image can be separated into red, green and blue three channels, and red channel image, green channel image and blue channel image can be obtained 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 for retention, and the red channel image and the blue channel image can be discarded. Then, the green channel image is converted into a gray scale image. The gray scale image only needs one byte to represent the brightness value of each pixel, while the color image usually needs three bytes. This greatly reduces the storage space and transmission bandwidth.
[0069] On this basis, the gray scale image is binarized to convert the gray scale image into a binary image (an image including only black and white color pixels), which further simplifies the image content and facilitates morphological analysis, target detection and image segmentation. Through the binary image, specific microscopic structure features (such as pores, etc.) can be quickly identified and extracted, providing a basis for quantitative analysis.
[0070] Step 130, based on the gray scale image and the binary image, a plurality of image statistics are determined.
[0071] Specifically, the image statistics refer to a series of quantitative features extracted from the image, which are used 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.
[0072] A plurality of image statistics can be determined from the gray scale image and the binary image respectively, which can be used to describe the characteristics, texture, shape and other information of the image.
[0073] Step 140, based on the plurality of image statistics and the correlation between each image statistic and the quality control index, the quality control index of the target dairy product is determined.
[0074] Specifically, the quality control index refers to a parameter index used to control the safety, hygiene and quality of the dairy product, which can include shear viscosity, clarity index, particle size, etc. Shear viscosity is an important index to measure the flowability and texture of the dairy product. The clarity index is used to measure the transparency or turbidity of the dairy product. Particle size is an important index in the quality control of the dairy product, which affects the taste and stability of the product.
[0075] There is a correlation between the image statistics and the quality control indicators. For example, the distribution and aggregation state of ingredients such as fat, protein, etc. in the dairy product can be determined by the image statistics, and the distribution of ingredients such as fat and protein will affect the viscosity of the dairy product. The more uniform the distribution of ingredients such as fat and protein, the higher the clarity index, indicating that the quality of the dairy product is better. The size and shape of the particles in the dairy product, that is, the particle size, can be determined by the image statistics.
[0076] The correlation between the image statistics and the quality control indicators can be quantitatively represented by a correlation coefficient. For example, a large number of sample dairy products belonging to the same category as the target dairy product can be collected, and the microstructure images and the actual measured values of the quality control indicators of the sample dairy products can be collected. After processing the microstructure images of the sample dairy products, a plurality of image statistics can be obtained, and the functional relationship between each image statistic and the quality control indicator can be fitted, with the image statistic as the variable and the actual measured value of the quality control indicator as the dependent variable. The image statistics of the target dairy product are input into the function relationship obtained after fitting, and the predicted value of the quality control indicator of the target dairy product can be obtained.
[0077] The statistics extracted by the image processing technology can provide an important reference for the quality control of the dairy product, and help to optimize the production process and improve the product quality.
[0078] The dairy product microstructure image analysis method provided by the embodiments of the present application obtains the microstructure image of the target dairy product; separates the microstructure image into a single color channel to obtain a gray scale image of the microstructure image in a single color channel, and performs binaryzation processing on the gray scale image to obtain a binary image; determines a plurality of image statistics based on the gray scale image and the binary image; determines the quality control indicator of the target dairy product based on the plurality of image statistics and the correlation between each image statistic and the quality control indicator; by separating the microstructure image into a single color channel and performing binaryzation processing, a plurality of image statistics can be extracted, the microstructure characteristics of the dairy product can be quantified, the quality control indicator of the target dairy product can be determined according to the correlation between the image statistics and the quality control indicator, without manually observing the microstructure image of the dairy product or manually analyzing the results of naked eye observation, avoiding the subjectivity of manual image interpretation, improving the accuracy of the dairy product microstructure image analysis, and improving the consistency of the dairy product microstructure image analysis results; and the above process can be automatically executed by a computer, improving the efficiency of the dairy product microstructure image analysis.
[0079] It should be noted that each embodiment of the present application can be freely combined, the order can be changed, or each embodiment can be executed independently, and does not need to rely on or depend on a fixed execution order.
[0080] In some embodiments, monochrome channel separation is performed on the microstructure image to obtain a grayscale image of the microstructure image in a single color channel, and binarization processing is performed on the grayscale image to obtain a binary image, including:
[0081] Monochrome channel separation is performed on the microstructure image to obtain the grayscale image of the microstructure image in the target color channel; the target color channel is determined based on the contrast of the protein gel in dairy products in each color channel;
[0082] Determine the gray levels in a grayscale image and the number of pixels at each gray level;
[0083] Iterate through each gray level in turn, and update the cumulative probability and average gray level 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.
[0084] The gray level corresponding to the maximum inter-class variance is determined as the binarization threshold.
[0085] The grayscale image is binarized based on the binarization threshold to obtain a binarized image.
[0086] Specifically, monochrome channel separation can be performed on microstructure images to obtain grayscale images of the microstructure images in the target color channel. The target color channel can be determined based on the contrast of protein gels in dairy products across various color channels. For example, protein gels have high contrast in the green channel, making them easy to identify. The Otsu's method (Otsu's method) can be used to convert grayscale images into binary images.
[0087] First, we can calculate the image's grayscale histogram. Let the input grayscale image be represented as... . This represents the coordinates of a pixel within the image. The image size is [size missing]. (Horizontal dimensions, vertical dimensions). Grayscale range is... When the grayscale image is an 8-bit image. It is usually 256. It can count each gray level. The number of pixels that appear is used to generate a grayscale histogram. , .
[0088] Secondly, initialize the relevant parameters. The cumulative grayscale frequency can be defined. : Calculate the proportion of pixels at each gray level to the total number of pixels, i.e., there exists a relationship: .
[0089] This relationship reflects the gray level. The probability of occurrence in an image. This can be further represented as the cumulative probability of the foreground (the image region containing white pixels). Cumulative probability of background (the image area containing black pixels) Average gray level of the foreground average grayscale of the background Between-class variance .
[0090] Next, iterate through each gray level in turn, starting from the current gray level. arrive Perform a traversal, based on the ratio of the number of pixels at each gray level to the total number of pixels in the grayscale image. The cumulative probability and average gray level corresponding to each gray level are updated to determine the inter-class variance corresponding to each gray level.
[0091] The cumulative probability includes the foreground cumulative probability and the background cumulative probability. Updating the foreground cumulative probability can be expressed as... The cumulative probability of updating the background can be expressed as: .
[0092] Average grayscale includes foreground average grayscale and background average grayscale. Updating the foreground average grayscale can be expressed as: Updating the average grayscale of the background can be expressed as: .
[0093] At this point, the current gray level can be calculated. Inter-class variance .
[0094] Finally, during the traversal, the maximum inter-class variance at each gray level can be recorded. The maximum inter-class variance... Corresponding gray levels The binarization threshold is determined. This value is typically around the 30th percentile of the grayscale value. Pixels with brightness (pixel value) below the threshold are assigned a value of 0 (called black pixels), and pixels with brightness above the threshold are assigned a value of 1 (called white pixels). The resulting binarized image is then obtained.
[0095] The microstructure image analysis method for dairy products provided in this invention performs monochrome channel separation and binarization processing on the microstructure image, which can extract multiple image statistics and quantify the microstructure features of dairy products.
[0096] In some embodiments, image statistics include fractal dimension, radial autocorrelation function value, porosity, maximum pore area, mean pore area, standard deviation of pore area, and the ratio of foreground region perimeter to area.
[0097] By the image statistics, the microstructure characteristics of the dairy product can be quantified effectively. For example, the fractal dimension can quantify the filling degree of protein in the dairy product; the radial autocorrelation function value can quantify the continuity of the microstructure of the dairy product; the porosity, the maximum pore area, the mean pore area, and the standard deviation of the pore area can represent the density of the microstructure of the dairy product; and the ratio of the perimeter to the area of the foreground region can represent the complexity of the microstructure of the dairy product.
[0098] In some embodiments, based on the grayscale image and the binary image, a plurality of image statistics are determined, including:
[0099] determining a plurality of boxes with different side lengths;
[0100] for the boxes with different side lengths, determining the minimum number of boxes required to cover the white pixels in the binary image;
[0101] establishing a logarithmic relationship between the minimum number of boxes and the side length;
[0102] fitting the scatter plot corresponding to the logarithmic relationship, and determining the fractal dimension based on the slope of the fitted straight line;
[0103] determining the fractal dimension as the image statistics.
[0104] Specifically, the fractal dimension provides a quantitative measure of the change in detail of a fractal object at different scales, and can be used to quantify the filling degree of protein. The fractal dimension can be calculated using the box-counting dimension.
[0105] First, the number of boxes covering the image can be calculated. Boxes (grid cells) with different side lengths can be selected. For the selected box with side length , the minimum number of boxes required to cover the white part of the two-dimensional image is counted, denoted as . That is, different sizes of boxes are used to cover the target fractal, and the number of boxes that completely cover the fractal is counted. When is large, the number of required boxes is small; as becomes smaller, the number of boxes increases, because finer division is required to cover all the details of the fractal.
[0106] Second, a logarithmic relationship between the minimum number of boxes and the side length is established. According to the definition of the box-counting dimension, the fractal dimension satisfies the following relationship:
[0107] .
[0108] In actual calculation, since cannot truly tend to 0, a series of sufficiently small values are selected to obtain the corresponding Values are then plotted with respect to the scatter plot. A least squares fit can be applied to the scatter points, and the slope of the resulting fitted line is the box-counting dimension.
[0109] The milk microstructure image analysis method provided by the embodiment of the application determines the fractal dimension as the image statistic, and can be used for quantitatively representing the protein filling degree.
[0110] In some embodiments, based on the gray-scale image and the binary image, a plurality of image statistics are determined, including:
[0111] The gray-scale image is subjected to two-dimensional discrete Fourier transform to obtain a frequency spectrum of the gray-scale image;
[0112] Based on the frequency spectrum of the gray-scale image, a power spectral density of the gray-scale image is determined;
[0113] The power spectral density is subjected to two-dimensional inverse discrete Fourier transform to obtain a two-dimensional autocorrelation function of the gray-scale image;
[0114] Based on the two-dimensional autocorrelation function, a radial autocorrelation function value is determined;
[0115] The radial autocorrelation function value is determined as the image statistic.
[0116] Specifically, the two-dimensional autocorrelation function can be determined by using Fourier transform, and then the radial autocorrelation function value is determined, mainly based on the correlation properties of Fourier transform, which can simplify the calculation process.
[0117] First, the gray-scale image is subjected to two-dimensional discrete Fourier transform (2D DFT) to obtain a frequency spectrum of the gray-scale image:
[0118] .
[0119] wherein, and are the size of the image in the horizontal direction and the vertical direction respectively, is a complex number, , .
[0120] Secondly, the power spectral density can be obtained according to the square of the modulus of the frequency spectrum , and can be expressed as:
[0121] .
[0122] wherein, is the conjugate complex of.
[0123] performing a two-dimensional inverse discrete Fourier transform (2D IDFT) on the power spectral density to obtain a two-dimensional autocorrelation function of the gray-scale image
[0124]
[0125] Due to the periodicity of the discrete Fourier transform and its inverse transform, the calculation result presents the autocorrelation characteristics in the whole image range, which describes the correlation between pixels at different spatial displacements, and the greater the value, the stronger the correlation at the displacement; the smaller the value, the weaker the correlation.
[0126] Finally, the average value of the two-dimensional autocorrelation function in a certain direction, or the average value on the circular ring with the (0, 0) point as the center, is obtained to obtain the radial autocorrelation function value, which is used to express the correlation characteristics of the image texture in a certain direction (or radial direction).
[0127] The image analysis method for the microstructure of the dairy product provided by the embodiment of the application determines the radial autocorrelation function value as the image statistic quantity, and can quantitatively represent the continuity of the microstructure of the dairy product.
[0128] In some embodiments, based on the gray-scale image and the binary image, a plurality of image statistic quantities are determined, including:
[0129] Based on the ratio of the number of white pixels in the binary image to the total number of pixels in the binary image, the porosity is determined.
[0130] The porosity is determined as the image statistic quantity.
[0131] Specifically, the number of white pixels (representing pores) and the total number of pixels in the binary image can be counted to determine the number of white pixels and the total number of pixels of the image If the image size is , then . The porosity .
[0132] The image analysis method for the microstructure of the dairy product provided by the embodiment of the application determines the porosity as the image statistic quantity, and can quantitatively represent the density of the microstructure of the dairy product.
[0133] In some embodiments, based on the gray-scale image and the binary image, a plurality of image statistic quantities are determined, including:
[0134] The binary image is subjected to connected region labeling to determine a plurality of pores.
[0135] determine an area of each pore based on the number of pixels of each pore;
[0136] determine a maximum pore area, a mean pore area, and a standard deviation of pore area based on the area of each pore;
[0137] determine the maximum pore area, the mean pore area, and the standard deviation of pore area as image statistics.
[0138] Specifically, the binary image can be labeled with a connected region, and a 4-connected region labeling algorithm can be used.
[0139] White pixels can be defined as foreground pixels, and the pixels in the binary image can be traversed. When a current pixel is a foreground pixel (white pixel), the pixels marked in its four neighbors above, below, left, and right are checked. If there is no marked pixel in the neighborhood, it means that the pixel is the starting point of a new connected region, and it is assigned a new, unused positive integer label. If there are marked pixels in the neighborhood, the minimum value of these neighborhood labels is selected and assigned to the current pixel. This is because the current pixel is merged into an existing connected region.
[0140] During the labeling process, different neighborhoods may bring different label values (label conflicts). At this time, an equivalence table is maintained to record these equivalence relationships, which are uniformly processed later. The purpose is to ensure that the same connected region has only one label.
[0141] The above method can obtain each pore. By counting the number of pixels in each pore, the area of each unconnected pore (pixel count, which can be regarded as a unit area) can be obtained. Therefore, based on the area of each pore, the maximum pore area, the mean pore area, and the standard deviation of pore area can be determined.
[0142] The milk microstructure image analysis method provided by the embodiments of the present application determines the maximum pore area, the mean pore area, and the standard deviation of pore area as image statistics, which can quantitatively represent the density of the milk microstructure.
[0143] In some embodiments, based on the grayscale image and the binary image, a plurality of image statistics are determined, including:
[0144] determine a boundary pixel in the binary image; the boundary pixel is a white pixel, and there is a black pixel in the neighbor pixels of the boundary pixel;
[0145] determine 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;
[0146] determine the ratio of the perimeter to the area of the foreground region as an image statistic.
[0147] Specifically, a boundary pixel in the binary image can be defined. For example, a pixel which is a white pixel and has a black pixel among its 8 neighbors (up, down, left, right, four diagonal corners), is marked as a boundary pixel.
[0148] All pixels are traversed, and the ratio of the number of pixels located at the boundary to the total number of white pixels is obtained to obtain the ratio of the perimeter to the area of the foreground region.
[0149] The method for analyzing the microstructure image of the dairy product provided in the embodiments of the present application determines the ratio of the perimeter to the area of the foreground region as the image statistic quantity, which can quantitatively represent the complexity of the microstructure of the dairy product.
[0150] In some embodiments, the correlation between each image statistic quantity and the quality control indicator is determined based on the following steps:
[0151] Obtaining microstructure images of a plurality of sample dairy products and a plurality of quality control indicators of each sample dairy product;
[0152] Determining a plurality of image statistic quantities of each sample dairy product based on the microstructure image of the sample dairy product;
[0153] Determining the correlation coefficient between each image statistic quantity and each quality control indicator;
[0154] In the case where the correlation coefficient between any image statistic quantity and any quality control indicator is greater than a preset threshold, it is determined that there is a correlation between the image statistic quantity and the quality control indicator.
[0155] Specifically, the microstructure images of a large number of sample dairy products belonging to the same category as the target dairy product and the actual measurement values of a plurality of 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 embodiments to determine a plurality of image statistic quantities of each sample dairy product.
[0156] The Spearman correlation coefficient method can be used to determine the correlation coefficient between each image statistic quantity and each quality control indicator, which is used to measure the degree of correlation. For example, taking the clarity index as the quality control indicator, the correlation coefficients (absolute values) of the fractal dimension, the radial autocorrelation function value, the porosity, the maximum pore area, the average pore area, the standard deviation of the pore area, and the ratio of the perimeter to the area of the foreground region are 0.389, 0.041, 0.545, 0.546, 0.688, 0.601, and 0.504, respectively.
[0157] The preset threshold value can be set according to actual needs. The preset threshold value can be defined as 0.5, and 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 and the quality control indicator are correlated. That is, the image statistic can reflect the quality control indicator to a certain extent.
[0158] 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 region are correlated with the clarity index, and the corresponding correlation coefficient can be determined as the correlation coefficient, so as to determine the fitted function relationship.
[0159] The method for analyzing the microstructure image of the dairy product provided in the embodiments of the present application can determine whether the correlation exists between each image statistic and each quality control indicator according to the comparison result of the correlation coefficient between the two and the preset threshold value, so that the prediction efficiency of the quality control indicator can be improved.
[0160] The device provided in the embodiments of the present application will be described below, and the device described below can be referred to each other with the method described above.
[0161] Figure 2 is a structural schematic diagram of the device for analyzing the microstructure image of the dairy product provided in the present application, as shown in Figure 2 The device comprises:
[0162] The acquisition module 210 is configured to acquire the microstructure image of the target dairy product.
[0163] The processing module 220 is configured to separate the microstructure image into a gray-scale image in a single color channel, and perform binaryzation processing on the gray-scale image to obtain a binaryzation image.
[0164] The statistical module 230 is configured to determine a plurality of image statistics based on the gray-scale image and the binaryzation image.
[0165] The analysis module 240 is configured to determine the quality control indicator of the target dairy product based on the plurality of image statistics and the correlation between each image statistic and the quality control indicator.
[0166] The milk product microstructure image analysis device provided by the embodiment of the present application obtains a microstructure image of a target milk product; performs monochrome channel separation on the microstructure image to obtain a gray-scale image of the microstructure image under a single color channel, and performs binaryzation processing on the gray-scale image to obtain a binaryzation image; determines a plurality of image statistics based on the gray-scale image and the binaryzation image; determines a quality control index of the target milk product based on the plurality of image statistics and the correlation between each image statistic and the quality control index; through monochrome channel separation and binaryzation processing on the microstructure image, a plurality of image statistics can be extracted, the microstructure characteristics of the milk product can be quantified, the quality control index of the target milk product is determined according to the correlation between the image statistics and the quality control index, manual observation of the microstructure image of the milk product is not required, manual analysis of the naked-eye observation result is not required, the subjectivity of manual image interpretation is avoided, the accuracy of milk product microstructure image analysis is improved, and the consistency of milk product microstructure image analysis results is improved; and the above process can be automatically executed by a computer, thereby improving the efficiency of milk product microstructure image analysis.
[0167] Figure 3 is a structural schematic diagram of an electronic device provided by the present application, as shown in Figure 3 The electronic device can 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 can call the logic commands in the memory 330 to execute the methods described in the above embodiments, for example:
[0168] obtain a microstructure image of a target milk product; perform monochrome channel separation on the microstructure image to obtain a gray-scale image of the microstructure image under a single color channel, and perform binaryzation processing on the gray-scale image to obtain a binaryzation image; determine a plurality of image statistics based on the gray-scale image and the binaryzation image; determine a quality control index of the target milk product based on the plurality of image statistics and the correlation between each image statistic and the quality control index.
[0169] In addition, the logic commands in the memory described above can be realized in the form of a software function unit and sold or used as a separate product, and can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of commands to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0170] The processor in the electronic device provided by the embodiments of the present application can call the logic instructions in the memory to realize the above-mentioned method, and the specific implementation manners are consistent with the above-mentioned method implementation manners, and the same beneficial effects can be achieved, which will not be described here.
[0171] The embodiments of the present application further provide a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method provided by the above-mentioned embodiments.
[0172] The specific implementation manners are consistent with the above-mentioned method implementation manners, and the same beneficial effects can be achieved, which will not be described here.
[0173] The embodiments of the present application provide a computer program product, which includes a computer program. The computer program is executed by a processor to implement the above-mentioned method.
[0174] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the present embodiment scheme according to actual needs. Those skilled in the art can understand and implement it without creative labor.
[0175] Those skilled in the art can clearly understand the technical solutions of the various embodiments from the above description of the embodiments, and the various embodiments can be implemented by means of software with the necessary general hardware platforms, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that makes a contribution, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0176] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of analyzing a microstructure image of a dairy product, characterized by, The method comprises: acquiring a microstructure image of a target dairy product; performing single-color channel separation on the microstructure image to obtain a gray-scale image of the microstructure image in a single color channel, and performing binarization processing on the gray-scale image to obtain a binarization image; determining a plurality of image statistics based on the gray-scale image and the binarization image; the image statistics include at least one of a fractal dimension, a radial autocorrelation function value, a porosity, a maximum pore area, a pore area mean, a pore area standard deviation, and a ratio of a foreground region perimeter to an area; determining a quality control indicator of the target dairy product based on the plurality of image statistics and a correlation between each image statistic and the quality control indicator; the single-color channel separation on the microstructure image to obtain a gray-scale image of the microstructure image in a single color channel, and the binarization processing on the gray-scale image to obtain a binarization image, comprises: performing single-color channel separation on the microstructure image to obtain a gray-scale image of the microstructure image in a target color channel; the target color channel is determined based on the contrast of protein gels in the dairy product in each color channel; determining the gray levels in the gray-scale image and the number of pixels of each gray level; sequentially traversing each gray level, updating the cumulative probability and the average gray corresponding to each gray level based on the ratio of the number of pixels of each gray level to the total number of pixels in the gray-scale image, and determining the inter-class variance corresponding to each gray level; the cumulative probability includes a foreground cumulative probability and a background cumulative probability; the average gray includes a foreground average gray and a background average gray; the foreground is an image region where white pixels are located; the background is an image region where black pixels are located; determining the gray level corresponding to the maximum inter-class variance as a binarization threshold; performing binarization on the gray-scale image based on the binarization threshold to obtain the binarization image; the correlation between each image statistic and the quality control indicator is determined based on the following steps: acquiring microstructure images of a plurality of sample dairy products and a plurality of quality control indicators of each sample dairy product; the quality control indicators include shear viscosity, clarity index, and particle size; determining a plurality of image statistics of each sample dairy product based on the microstructure image of each sample dairy product; determining a correlation coefficient between each image statistic and each quality control indicator; in a case where the correlation coefficient between any image statistic and any quality control indicator is greater than a preset threshold, it is determined that the any image statistic and the any quality control indicator have a correlation.
2. The method according to claim 1, wherein the determination of a plurality of image statistics based on the gray-scale image and the binarization image, comprises: determining a plurality of 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 binarization 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 the slope of the fitting straight line; determining the fractal dimension as the image statistic.
3. The method according to claim 1, wherein The method comprises the following steps: performing two-dimensional discrete Fourier transform on the gray image to obtain a frequency spectrum of the gray image; determining a power spectral density of the gray image based on the frequency spectrum of the gray image; performing two-dimensional inverse discrete Fourier transform on the power spectral density to obtain a two-dimensional autocorrelation function of the gray image; determining a radial autocorrelation function value based on the two-dimensional autocorrelation function; determining the radial autocorrelation function value as the image statistic.
4. The method according to claim 1, wherein The method comprises the following steps: determining a 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; determining the porosity as the image statistic.
5. The method according to claim 1, wherein The method comprises the following steps: performing connected region labeling on the binary image to determine a plurality of pores; determining an area of each pore based on a number of pixels of each pore; determining a maximum pore area, a pore area mean and a pore area standard deviation based on the areas of the pores; determining the maximum pore area, the pore area mean and the pore area standard deviation as the image statistics.
6. The method according to claim 1, wherein The method comprises the following steps: determining boundary pixels in the binary image; the boundary pixels are white pixels and there is a black pixel in a neighbor pixel of the boundary pixels; determining a ratio of a foreground region perimeter to area based on a ratio of a number of the boundary pixels to a number of white pixels in the binary image; determining the ratio of the foreground region perimeter to area as the image statistic.
7. A dairy product microstructure image analysis device, characterized by, The method comprises the following steps: an acquisition module, configured to acquire a microstructure image of a target dairy product; a processing module, configured to perform single-color channel separation on the microstructure image to obtain a gray image of the microstructure image in a single color channel, and perform binaryzation processing on the gray image to obtain a binary image; a statistics module, configured to determine a plurality of image statistics based on the gray image and the binary image; the image statistics comprise at least one of a fractal dimension, a radial autocorrelation function value, a porosity, a maximum pore area, a pore area mean, a pore area standard deviation and a ratio of a foreground region perimeter to area; an analysis module, configured to determine a quality control indicator of the target dairy product based on the plurality of image statistics and a correlation between each image statistic and the quality control indicator. The method comprises the following steps: performing single-color channel separation on the microstructure image to obtain a gray image of the microstructure image in a target color channel; the target color channel is determined based on contrast of protein gels in the dairy product in each color channel; determining gray levels in the gray image and a number of pixels of each gray level; The cumulative probability includes a foreground cumulative probability and a background cumulative probability; the average gray level includes a foreground average gray level and a background average gray level; the foreground is an image region where white pixels are located; and the background is an image region where black pixels are located; The gray level corresponding to the maximum inter-class variance is determined as a binarization threshold value; The gray scale image is binarized based on the binarization threshold value to obtain a binarization image; The correlation between each image statistic and the quality control indicator is determined based on the following steps: Microstructure images of a plurality of sample dairy products and a plurality of quality control indicators of each sample dairy product are obtained; the quality control indicators include shear viscosity, clarity index, and particle size; Based on the microstructure images of each sample dairy product, a plurality of image statistics of each sample dairy product are determined; A correlation coefficient between each image statistic and each quality control indicator is determined; In a case where the correlation coefficient between any image statistic and any quality control indicator is greater than a preset threshold value, it is determined that the any image statistic and the any quality control indicator have a correlation.
8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the dairy product microstructure image analysis method of any one of claims 1 to 6.
Citation Information
Patent Citations
Activated sludge floc analysis method based on MATLAB
CN106442526A
Paper porosity measuring and pore diameter analyzing method based on digital image processing
CN108519314A
Nondestructive testing method for plastic deformation microstructure of metal material
CN115684171A