A method and system for butter processing control based on image processing

By using real-time image processing technology to acquire the characteristics of oil and impurities during the butter processing, and generating automated control commands, the problem of relying on human experience in butter processing is solved, and the consistency of product quality and the level of automation are improved.

CN122632788APending Publication Date: 2026-08-25GUANGHAN HANGJIA FOOD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611113628.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-27
Publication Date
2026-08-25

AI Technical Summary

Technical Problem

The current butter processing relies on human experience, which leads to strong subjectivity and poor detection accuracy. It is difficult to achieve real-time status perception and adaptive control of process parameters, resulting in insufficient quality consistency.

Method used

By acquiring real-time images of the melting and decolorization stages during the butter processing, the oil region and impurity particles are segmented, color and morphological characteristic parameters are calculated, and heating power and stirring rate adjustment values ​​are generated to achieve closed-loop control.

Benefits of technology

It improves the automation level of butter processing and the consistency of product quality, reduces the degree of human intervention, and enables precise quantification and timely feedback adjustment of butter color and impurity content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122632788A_ABST
    Figure CN122632788A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of food processing automation control, and specifically discloses a beef tallow processing control method and system based on image processing. The technical scheme of the present application acquires real-time images of the oil surface in the melting stage and the decoloring stage of beef tallow processing, segments the images to extract color feature vectors of the oil area and impurity particle shape feature parameters, calculates chroma representation values and impurity area proportions, compares the chroma representation values with standard chroma intervals to generate heating power adjustment values, compares the impurity area proportions with impurity thresholds to generate stirring rate adjustment values, and outputs them to the processing equipment actuators. The present application solves the problems of strong subjectivity and poor consistency caused by the reliance of traditional processing modes on manual experience, and the problem of quality fluctuations that cannot be captured and feedback adjusted in time caused by the fact that existing image processing methods do not form data linkage with the melting and decoloring process, thereby improving the beef tallow processing automation level and product quality consistency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of automated control technology for food processing, and in particular to a method and system for controlling butter processing based on image processing. Background Technology

[0002] With the continuous improvement of automation in the food industry, the precise control of butter processing, as an important edible oil raw material, has become increasingly important. Currently, the butter processing industry generally uses temperature sensors and timing devices for control. Operators rely on personal experience to judge the melting state, color changes, and impurity content of the butter, adjusting heating power and stirring rate accordingly. This production mode, dependent on manual experience, is highly subjective, lacks accuracy and consistency, and struggles to accurately capture minute fluctuations in butter color and impurity content during processing. This results in severely delayed feedback adjustments, failing to meet the quality stability requirements of large-scale continuous production. While machine vision technology is currently applied in food inspection, in butter processing, image processing methods are mostly limited to finished product appearance grading or foreign object identification, failing to establish data linkage with melting and decolorization processes. Consequently, fluctuations in butter quality parameters during processing cannot be captured and addressed in a timely manner. Achieving real-time status perception and adaptive control of process parameters throughout the entire butter processing process is crucial for improving the automation level and product quality consistency in butter processing. Summary of the Invention

[0003] To address the aforementioned technical problems, this invention provides a method and system for controlling butter processing based on image processing.

[0004] In a first aspect, the present invention provides a butter processing control method based on image processing, the technical solution of which is as follows: Acquire real-time images of the oil surface during the melting and decolorization stages of tallow processing; The real-time image is segmented, and the color feature vector of the oil region and the morphological feature parameters of the impurity particles are extracted. The chromaticity value of the oil is calculated based on the color feature vector, and the area ratio of impurities is calculated based on the morphological feature parameters. The chromaticity characterization value is compared with a preset standard chromaticity range. If the chromaticity characterization value deviates from the standard chromaticity range, a heating power adjustment value is generated. The impurity area ratio is compared with a preset impurity threshold. If the impurity area ratio exceeds the impurity threshold, a stirring rate adjustment value is generated. The heating power adjustment value and the stirring rate adjustment value are output to the actuator of the butter processing equipment.

[0005] Secondly, the present invention provides a butter processing control system based on image processing, the technical solution of which is as follows: The acquisition module is used to acquire real-time images of the oil surface during the melting and decolorization stages of tallow processing; The segmentation module is used to segment the real-time image and extract the color feature vector of the oil region and the morphological feature parameters of the impurity particles. The calculation module is used to calculate the grease colorimetric value based on the color feature vector and to calculate the impurity area ratio based on the morphological feature parameters. A colorimetric comparison module is used to compare the colorimetric characterization value with a preset standard colorimetric range. If the colorimetric characterization value deviates from the standard colorimetric range, a heating power adjustment value is generated. An impurity comparison module is used to compare the impurity area ratio with a preset impurity threshold. If the impurity area ratio exceeds the impurity threshold, a stirring rate adjustment value is generated. The control module is used to output the heating power adjustment value and the stirring rate adjustment value to the actuator of the butter processing equipment.

[0006] The technical solution of this invention acquires real-time images of the oil surface during the melting and decolorization stages of tallow processing, segments the images to extract color feature vectors of oil regions and morphological feature parameters of impurity particles, calculates chromaticity characterization values ​​and impurity area ratios, compares the chromaticity characterization values ​​with standard chromaticity ranges to generate heating power adjustment values, compares the impurity area ratios with impurity thresholds to generate stirring rate adjustment values, and outputs them to the processing equipment actuator. This solves the problems of traditional processing modes relying on human experience, resulting in strong subjectivity and poor consistency, and the lack of data linkage between existing image processing methods and melting and decolorization processes, leading to the inability to capture and adjust quality fluctuations in a timely manner. This improves the automation level of tallow processing and the consistency of product quality.

[0007] Unlike existing technologies that only use machine vision for finished product appearance grading or foreign object identification, this invention integrates color and morphological features with the heating power and stirring rate of the two key process stages of smelting and decolorization to form a closed-loop linkage control. By using nonlinear weighted colorimetric values ​​and shape-corrected impurity area ratios, it achieves precise quantification of oil color and impurity content. For the first time, it establishes a state perception and process parameter adaptive control mechanism based on image information in the entire butter processing process, which significantly reduces the degree of human intervention and improves batch-to-batch quality consistency.

[0008] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0010] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a flowchart illustrating an embodiment of the image processing-based butter processing control method of the present invention. Detailed Implementation

[0011] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0012] Figure 1 The diagram illustrates a flowchart of an embodiment of a butter processing control method based on image processing provided by the present invention, executed by a control terminal. Figure 1 As shown, the image processing-based butter processing control method includes the following steps: S1. Obtain real-time images of the oil surface during the melting and decolorization stages of tallow processing.

[0013] The butter processing process refers to the complete production process of processing beef fat raw materials through processes such as melting, decolorization, and deodorization to prepare oil products that meet the standards for food or industrial use. For example, starting from the beef fat provided by Company A being put into a type B melting pot, the entire process of heating and melting, separating impurities, adsorption and decolorization, vacuum deodorization until a clear finished butter product is obtained constitutes a butter processing process.

[0014] The melting stage refers to the critical processing period in tallow processing where the fat cells of the raw beef fat are ruptured and liquid oil is released during heating, while protein residues and moisture are removed. For example, in the production batch on May 1, 2026, 100 kg of beef tallow was added to a melting tank and heated continuously for 60 minutes at a temperature range of 80°C to 110°C, causing the solid fat to transform into liquid oil and accompanied by protein flocculation and precipitation. This heating process is called the melting stage. The decolorization stage refers to the refining process in which the crude oil obtained after melting is treated with an adsorbent to remove pigments and other impurities. For example, the crude oil filtered after melting is heated to 90°C, 3 kg of C-brand activated clay is added and stirred for 30 minutes. The adsorbent removes the Maillard reaction brown pigment, residual heme from tissues, and trace amounts of carotenoids deposited from feed sources, all of which are coloring substances produced by high-temperature melting. This adsorption process is called the decolorization stage.

[0015] The internal grease level refers to the free interface on the upper surface of the working medium, i.e., liquid grease, during the melting or decolorization stage in the container of the tallow processing equipment. For example, in a melting tank with a diameter of 1.5m, the liquid tallow depth is 0.8m, and the horizontal interface between the liquid tallow and air at this point is called the internal grease level. Real-time images refer to digital image data reflecting the current appearance of the grease, obtained by continuously capturing images of the grease level during the tallow processing process using an image acquisition device. For example, during the decolorization stage, a 1280×1024 pixel resolution photograph of the grease level is taken every 2 seconds using a D-type industrial camera; this photograph is called a real-time image.

[0016] S2. Segment the real-time image and extract the color feature vector of the oil region and the morphological feature parameters of the impurity particles.

[0017] In this context, the "grease region" refers to the set of pixels corresponding to the spatial location of liquid grease in a real-time image. For example, in a captured real-time image, all pixels located in the central area of ​​the image, exhibiting a brownish-yellow color and a grayscale value between 80 and 150, constitute the grease region. The color feature vector is a multidimensional array composed of the component values ​​of each pixel within the grease region across different color channels, used to quantify the color attributes of the grease. For instance, the component values ​​of each pixel within the grease region in the L, a, and b channels of the Lab color space are extracted and combined to form three one-dimensional arrays of length 50,000; these arrays are called color feature vectors.

[0018] Among them, impurity particles refer to discrete, tiny solid foreign objects in the grease region of a real-time image that differ significantly from the grease background in color, brightness, or texture; for example, multiple irregularly shaped, dark brown or black objects with an area of ​​approximately 0.5 mm were observed in the real-time image.2 Up to 2mm 2 These spots are called impurity particles. Morphological characteristic parameters refer to a set of numerical indicators used to quantitatively describe the geometry and size of impurity particles; for example, measuring the Freret diameter (DF) of each impurity particle as 1.2 mm and its eccentricity... The three values, 0.3 and ψ, together constitute the morphological characteristic parameters of the impurity particles.

[0019] S3. Calculate the grease colorimetric value based on the color feature vector, and calculate the impurity area ratio based on the morphological feature parameters.

[0020] The chromaticity characterization value of grease refers to a single numerical value calculated based on the color feature vectors of all pixels within the grease region. It is used to comprehensively evaluate the degree to which the grease color deviates from the standard color. For example, based on the Lab components of 50,000 pixels in the grease region of a real-time image, an empirical formula yields a value of 87.6, which is called the chromaticity characterization value of grease (the specific formula will be described in detail later and will not be repeated here). Impurity area ratio refers to the proportion of the equivalent total area of ​​all impurity particles in the grease region after shape correction to the total area of ​​the grease region. For example, if the total area of ​​the grease region is 1e6 pixels, and 15 impurity particles are detected, the equivalent total area after eccentricity and shape complexity correction is 8500 pixels, and the calculated ratio is 0.85%. This ratio is called impurity area ratio.

[0021] S4. Compare the chromaticity characterization value with the preset standard chromaticity range. If the chromaticity characterization value deviates from the standard chromaticity range, then generate a heating power adjustment value.

[0022] The preset standard color range refers to the acceptable range of oil color characterization values ​​pre-set according to the quality requirements of butter processing. This range has an upper and lower limit. For example, the lower limit of the preset standard color range is 75.0, and the upper limit is 90.0. When the oil color characterization value falls between 75.0 and 90.0, the color is considered acceptable. The heating power adjustment value refers to the control command value used to change the output power of the heating device of the butter processing equipment. This value can be positive, negative, or zero. For example, when the oil color characterization value is 92.5, exceeding the upper limit of the standard color range of 90.0, a heating power adjustment value of -3.5kW is generated, indicating that the heating power needs to be reduced by 3.5kW.

[0023] S5. Compare the impurity area ratio with a preset impurity threshold. If the impurity area ratio exceeds the impurity threshold, generate a stirring rate adjustment value.

[0024] The preset impurity threshold refers to the maximum allowable percentage of impurity area pre-set according to the quality requirements of butter processing; for example, if the preset impurity threshold is 1.0%, the impurity content is considered excessive when the calculated impurity area percentage exceeds 1.0%. The stirring rate adjustment value refers to the control command value used to change the rotation speed of the stirring device in the butter processing equipment. This value can be positive, negative, or zero; for example, when the impurity area percentage is 1.3%, exceeding the preset impurity threshold of 1.0%, a stirring rate adjustment value of +15 r / min is generated, indicating that the stirring rate needs to be increased by 15 r / min.

[0025] S6. Output the heating power adjustment value and the stirring rate adjustment value to the actuator of the butter processing equipment.

[0026] Tallow processing equipment refers to a combination of industrial equipment used to implement the processes of smelting, decolorizing, and deodorizing involved in tallow processing. For example, a production line consisting of an E-type smelting tank, an F-type decolorizing tower, a G-type vacuum dryer, an H-type plate and frame filter, and supporting heating and stirring systems is called tallow processing equipment. An actuator refers to a mechanical or electrical device that receives control commands and drives the adjustable components in the tallow processing equipment. For example, a variable frequency speed-regulating stirring motor and a thyristor-controlled heater installed on the smelting tank, which receive heating power adjustment values ​​and stirring rate adjustment values, respectively change the power supply voltage of the heating resistance wire and the rotation speed of the stirring paddle; these devices are called actuators.

[0027] The technical solution of this embodiment acquires real-time images of the oil surface during the melting and decolorization stages of tallow processing, segments the images to extract color feature vectors of oil regions and morphological feature parameters of impurity particles, calculates chromaticity characterization values ​​and impurity area ratios, compares the chromaticity characterization values ​​with standard chromaticity ranges to generate heating power adjustment values, compares the impurity area ratios with impurity thresholds to generate stirring rate adjustment values, and outputs them to the processing equipment actuator. This solves the problems of traditional processing modes relying on human experience, resulting in strong subjectivity and poor consistency, and the lack of data linkage between existing image processing methods and melting and decolorization processes, leading to the inability to capture and adjust quality fluctuations in a timely manner. This improves the automation level of tallow processing and the consistency of product quality.

[0028] In one alternative approach, S1 specifically includes: Multiple frames of oil surface images are continuously acquired and the median gray value at each pixel position is calculated. The image composed of the medians is used as the real-time image.

[0029] Among them, the oil surface image refers to a single-frame digital photograph obtained by taking a picture of the upper surface of liquid oil inside the tallow processing equipment through an image acquisition device; for example, a color digital photograph with a resolution of 1280×1024 pixels, containing the oil area and possible impurity particles, taken by a J-type CMOS industrial camera at a single sampling moment is called an oil surface image.

[0030] In the above-mentioned optional methods, a real-time image is further constructed by continuously acquiring multiple frames of oil surface images and calculating the median gray value at each pixel location. This reduces the interference of ambient light fluctuations and liquid surface reflections on image quality, improves the stability and reliability of image data, and provides high-quality input for subsequent oil region segmentation and feature extraction.

[0031] In one alternative approach, the step of segmenting the real-time image includes: An edge detection-based watershed algorithm is used to segment the real-time image into an oil region and an impurity particle region based on the gradient magnitude of the contact boundary between the oil region and the impurity particle in the real-time image, and each connected component in the impurity particle region is extracted as an impurity particle.

[0032] The watershed algorithm based on edge detection refers to an image segmentation algorithm that first calculates the gradient magnitude of each pixel in the image, then treats the gradient magnitude as terrain elevation, and forms watersheds (i.e., damming) at the boundaries of different local minima (i.e., catchment basins) by simulating a flooding process to achieve region division. In the specific application of oil surface images, the pixel color changes are gradual inside the oil and impurity particles, corresponding to the low-gradient "catchment basin" (i.e., low-lying water storage area) on the gradient map; while the pixel color changes drastically at the contact boundary between oil and impurities, corresponding to the high-gradient "watershed ridge" (i.e., the final damming and water blocking location) on the gradient map. Therefore, by using the gradient map as an elevation map to run the watershed transformation, the high-gradient boundary will automatically and accurately separate the gradual oil region from the impurity particle region. This process is called the watershed algorithm based on edge detection. The gradient magnitude refers to the square root of the sum of the squares of the rates of change of gray level or color at a pixel in an image along the horizontal and vertical directions. It is used to characterize the degree of intensity change of the image at the point. For example, in an image of an oily liquid surface, the gray level difference between adjacent pixels within the oily region is small, and the gradient magnitude is about 5 to 10. However, at the boundary between oil and impurity particles, the gray level difference between adjacent pixels is large, and the gradient magnitude can reach 80 to 120. These gradient magnitudes form the basis of edge detection.

[0033] In the above-mentioned optional methods, a watershed algorithm based on edge detection is further used to segment the real-time image. The image is divided into an oil region and an impurity particle region according to the gradient magnitude of the contact boundary between the oil region and the impurity particle. Each connected component is extracted as an impurity particle, which improves the boundary recognition accuracy between the oil region and the impurity particle and lays the foundation for the accurate extraction of color and morphological features.

[0034] In one alternative approach, the step of extracting the color feature vector of the oil region includes: Each pixel within the grease region is converted from the RGB color space to the Lab color space. The lightness component L, red-green component a, and yellow-blue component b of each pixel are extracted. The lightness component L, red-green component a, and yellow-blue component b of all pixels are used to construct three one-dimensional vectors as the color feature vectors.

[0035] The RGB color space refers to an additive color mixing model that uses red, green, and blue as basic color components and represents various colors by combining different intensity values ​​of these three components. For example, the RGB color value of a pixel is represented as red component = 210, green component = 180, and blue component = 120, which corresponds to a brownish-yellow color. This representation is based on the RGB color space. The Lab color space, on the other hand, is a color model based on the characteristics of human visual perception. The L component represents brightness from black to white, the a component represents the change from green to red, and the b component represents the change from blue to yellow. For example, the Lab color value of a pixel is represented as L = 75, a = 12, and b = 28, representing a medium brightness color with a reddish-yellow tint. This representation is based on the Lab color space.

[0036] In the above-mentioned optional methods, each pixel in the oil region is further converted from the RGB color space to the Lab color space, and the lightness component, red-green component and yellow-blue component are extracted and respectively formed into three one-dimensional vectors as color feature vectors. This makes the color feature description more in line with the human visual perception law and enhances the sensitivity and distinguishability of the colorimetric representation value to changes in the color of oil.

[0037] In one alternative approach, the step of extracting the morphological characteristic parameters of the impurity particles includes: Calculate the Freette diameter D for the connected components of each impurity particle. F The eccentricity ε and shape complexity ψ of all impurity particles are used as morphological feature parameters, and the Freette diameter, eccentricity, and shape complexity of all impurity particles are respectively combined into a one-dimensional vector.

[0038] The Freret diameter refers to the length of the smallest bounding rectangle of the connected domain of an impurity particle, measured along the principal direction of the particle. For example, if the longest side of the smallest bounding rectangle of an impurity particle is 1.2 mm, this length is called the Freret diameter and is used to characterize the maximum linear size of the particle. Eccentricity is a dimensionless parameter related to the ratio of the ratio of the major axis to the minor axis of the fitted ellipse of the connected domain of the impurity particle minus 1, and is used to characterize the degree to which the particle shape deviates from a circle. For example, if the major axis of the fitted ellipse of an impurity particle is 1.0 mm and the minor axis is 0.6 mm, the calculated eccentricity is 0.4. The closer this value is to 0, the closer the shape is to a circle. Shape complexity is a dimensionless parameter, the normalized ratio of the square of the actual perimeter of the connected domain of the impurity particle to its area, used to characterize the degree of tortuosity of the particle boundary. For example, if the area of ​​an impurity particle is 2.5 mm², the shape complexity is... 2 The actual perimeter is 8.2mm, and the perimeter of a circle with the same area is 5.6mm. The calculated shape complexity is 1.46. The larger this value is, the more irregular the boundary is.

[0039] In the above-mentioned optional methods, the Freette diameter, eccentricity and shape complexity of each impurity particle are further calculated for the connected domain, and the above parameters of all impurity particles are respectively composed into a one-dimensional vector as morphological feature parameters. This realizes a multi-dimensional quantitative description of the geometric shape of impurity particles, so that the calculation of impurity area ratio can take into account the differences in particle size and shape, and improve the accuracy of impurity content assessment.

[0040] In an alternative approach, the step of calculating the grease colorimetric characterization value based on the color feature vector is performed according to the following formula: ; Where C is the chromaticity characterization value of the oil, N is the total number of pixels in the oil region, and L i a i b i These are the brightness component, red-green component, and yellow-blue component of the i-th pixel, respectively. L0, a0, and b0 are preset standard butter color reference components, and α is a preset sensitivity coefficient.

[0041] It should be noted that the above formula is based on the Euclidean distance between the lightness component, red-green component, and yellow-blue component of each pixel in the Lab color space and the preset standard butter color reference component. A sigmoid-type non-linear weighting factor with the degree of deviation of the lightness component as the independent variable is introduced. The weighting factor is multiplied by the Euclidean distance and the arithmetic mean is calculated over all pixels to construct a chromaticity characterization value that can comprehensively represent the degree of deviation of the oil color. The function of the above formula is to make the chromaticity characterization value mainly reflect the color difference when the lightness component is close to the standard reference value, and to amplify the contribution of the Euclidean distance through the sigmoid function when the lightness component deviates significantly from the standard reference value, thereby enhancing the detection sensitivity of early changes in oil color and suppressing the evaluation distortion caused by extreme brightness anomalies.

[0042] In the above-mentioned optional methods, a standard butter color reference component and sensitivity coefficient are further introduced when calculating the chromaticity characterization value of the grease. Through the combined operation of weighted Euclidean distance and Sigmoid function, the response of the chromaticity characterization value to lightness deviation exhibits non-linear adjustment characteristics, which can both capture slight color shifts and suppress the excessive influence of extreme brightness anomalies on chromaticity evaluation.

[0043] In one alternative approach, the step of calculating the impurity area ratio based on the morphological characteristic parameters is performed according to the following formula: ; Where R is the area ratio of the impurities, M is the total number of impurity particles in the oil region, and D Fj Let be the Freette diameter of the j-th impurity particle. Let be the eccentricity of the j-th impurity particle. Let A be the shape complexity of the j-th impurity particle, β and γ be preset penalty coefficients, and A be the shape complexity of the j-th impurity particle. oil This represents the total area of ​​the oil and fat region.

[0044] It should be noted that the above formula uses the area of ​​the circle corresponding to the Freret diameter of each impurity particle as the baseline area. Then, a penalty factor with eccentricity as the independent variable and an exponential decay factor with shape complexity as the independent variable are introduced respectively. The baseline area is multiplied by the two factors in turn to obtain the equivalent area of ​​each impurity particle. The equivalent areas of all impurity particles are summed, divided by the total area of ​​the oil region, and multiplied by a percentage to construct the shape-corrected impurity area ratio. The function of the above formula is to obtain a smaller equivalent area for impurity particles with slender shapes or complex boundaries in the area conversion, avoiding the overestimation of impurity content caused by calculating irregular impurities as equivalent circular areas. Thus, the impurity area ratio more accurately reflects the actual impact of impurities on the quality of butter.

[0045] In the above optional method, when calculating the proportion of the impurity area, a penalty coefficient is further introduced to perform weighted correction on the Feret diameter for eccentricity and shape complexity, so that irregular or slender impurity particles are reasonably down-weighted in area conversion, avoiding the overestimation of the impurity content caused by solely relying on the equivalent circle area, and making the proportion of the impurity area closer to the actual visual perception.

[0046] In a preferred embodiment, considering that during the actual processing of butter, as the decolorization and smelting proceed, the background color of the oil will change significantly (such as gradually changing from dark color to light yellow). This dynamic change in background chromaticity will directly change the apparent contrast between the impurity particles and the oil background, resulting in the phenomenon of "expansion" or "contraction" when the watershed algorithm based on edge detection identifies the impurity boundary, making the calculated proportion R of the above-mentioned impurity area have a systematic deviation with the color change. To eliminate this deviation, after calculating the proportion R of the impurity area according to the morphological characteristic parameters, it further includes the step of performing color coupling correction on the proportion R of the impurity area according to the oil chromaticity characterization value C to generate the corrected proportion R' of the impurity area: ; where R' is the corrected proportion of the impurity area, R is the proportion of the impurity area; C is the oil chromaticity characterization value, C0 is the central value of the preset standard chromaticity interval, and λ is the preset color-impurity coupling correction coefficient.

[0047] It should be noted that the above formula uses the central value C0 of the standard chromaticity interval as the best visual contrast reference point to construct a non-linear mapping relationship through an exponential function; the function of the above formula is: when the oil chromaticity characterization value C is equal to C0, the exponential term is 1, and the corrected proportion R' of the impurity area is equal to the initial proportion R of the impurity area, without correction; when the oil becomes lighter (C > C0), due to the optical scattering effect, a halo is generated around the impurity, and the watershed algorithm is prone to over-segmentation, resulting in the overestimation of the initial area R. At this time, the exponential term is less than 1, and R is corrected downward to R' through multiplicative attenuation to eliminate the overestimation error; when the oil becomes darker (C < C0), the contrast between the dark impurity and the background is low, and the watershed algorithm is prone to under-segmentation, resulting in the underestimation of the initial area R. At this time, the exponential term is greater than 1, and R is corrected upward to R' through multiplicative amplification to eliminate the underestimation error. λ is used to control the sensitivity of the correction to prevent over-calibration under extreme chromaticity deviations.

[0048] In the preferred embodiment described above, by introducing an exponential coupling correction formula based on chromaticity characterization values, the traditional computational paradigm of isolating color and morphological features in image processing is broken. The dynamic compensation for impurity area recognition bias using chromaticity changes fundamentally suppresses the interference of oil background color evolution during processing on quantitative impurity assessment. Correspondingly, in subsequent step S5, when comparing the impurity threshold, the corrected impurity area ratio R′ is used for comparison, thereby greatly improving the objectivity and accuracy of stirring rate control.

[0049] In one alternative approach, the step of comparing the chromaticity characterization value with a preset standard chromaticity range and generating a heating power adjustment value includes: A negative heating power adjustment value is generated when the chromaticity characterization value is greater than the upper limit of the standard chromaticity range, and a positive heating power adjustment value is generated when the chromaticity characterization value is less than the lower limit of the standard chromaticity range. The absolute values ​​of the negative heating power adjustment value and the positive heating power adjustment value are proportional to the absolute difference between the chromaticity characterization value and the standard chromaticity range.

[0050] Among them, the negative heating power adjustment value refers to a heating power adjustment value with a value less than zero, which is used to instruct the actuator to reduce the output power of the heating device; for example, generating a heating power adjustment value of -3.5kW means that the heating power will be reduced by 3.5kW, and this negative value is called the negative heating power adjustment value.

[0051] Among them, the positive heating power adjustment value refers to a heating power adjustment value with a value greater than zero, which is used to instruct the actuator to increase the output power of the heating device; for example, generating a heating power adjustment value of +2.8kW means that the heating power will be increased by 2.8kW, and this positive value is called the positive heating power adjustment value.

[0052] In the above-mentioned optional methods, when the colorimetric characterization value deviates from the standard colorimetric range, a heating power adjustment value proportional to the absolute difference is generated based on the degree of deviation. This achieves continuous and directional adjustment of the heating power, enabling the temperature control of the melting and decolorization stages to adaptively adjust in accordance with the changes in the color of the oil, and shortening the response lag time of the process parameters.

[0053] In one alternative approach, the step of comparing the impurity area ratio with a preset impurity threshold and generating a stirring rate adjustment value includes: When the impurity area ratio is greater than the impurity threshold, a forward stirring rate adjustment value is generated. The forward stirring rate adjustment value is proportional to the difference between the impurity area ratio and the impurity threshold. When the impurity area ratio is less than or equal to the impurity threshold, a zero stirring rate adjustment value is generated.

[0054] Among them, the forward stirring rate adjustment value refers to a stirring rate adjustment value with a value greater than zero, which is used to instruct the actuator to increase the rotation speed of the stirring device; for example, generating a stirring rate adjustment value of +15r / min means increasing the stirring rate by 15r / min, and this positive value is called the forward stirring rate adjustment value.

[0055] Among them, the zero-value stirring rate adjustment value refers to a stirring rate adjustment value with a value equal to zero, which is used to instruct the actuator to keep the current rotation speed of the stirring device unchanged. For example, when the impurity area ratio is 0.8% which is less than the preset impurity threshold of 1.0%, a stirring rate adjustment value of 0 r / min is generated, indicating that the current stirring rate is not changed. This zero value is called the zero-value stirring rate adjustment value.

[0056] In the above-mentioned optional methods, when the area ratio of impurities exceeds the impurity threshold, a positive stirring rate adjustment value proportional to the difference is generated based on the excess amount. When the area ratio of impurities does not exceed the threshold, the stirring rate remains unchanged. This achieves dynamic adjustment of the stirring rate according to the difference in impurity content, ensuring that impurities are fully dispersed while avoiding unnecessary energy consumption and excessive shearing of oil.

[0057] In a preferred embodiment, in the step of comparing the impurity area ratio with a preset impurity threshold and generating a stirring rate adjustment value, the impurity area ratio is the corrected impurity area ratio R′.

[0058] This invention provides an embodiment of an image processing-based butter processing control system, which includes: The acquisition module is used to acquire real-time images of the oil surface during the melting and decolorization stages of tallow processing; The segmentation module is used to segment the real-time image and extract the color feature vector of the oil region and the morphological feature parameters of the impurity particles. The calculation module is used to calculate the grease colorimetric value based on the color feature vector and to calculate the impurity area ratio based on the morphological feature parameters. A colorimetric comparison module is used to compare the colorimetric characterization value with a preset standard colorimetric range. If the colorimetric characterization value deviates from the standard colorimetric range, a heating power adjustment value is generated. An impurity comparison module is used to compare the impurity area ratio with a preset impurity threshold. If the impurity area ratio exceeds the impurity threshold, a stirring rate adjustment value is generated. The control module is used to output the heating power adjustment value and the stirring rate adjustment value to the actuator of the butter processing equipment.

[0059] The technical solution of this embodiment acquires real-time images of the oil surface during the melting and decolorization stages of tallow processing, segments the images to extract color feature vectors of oil regions and morphological feature parameters of impurity particles, calculates chromaticity characterization values ​​and impurity area ratios, compares the chromaticity characterization values ​​with standard chromaticity ranges to generate heating power adjustment values, compares the impurity area ratios with impurity thresholds to generate stirring rate adjustment values, and outputs them to the processing equipment actuator. This solves the problems of traditional processing modes relying on human experience, resulting in strong subjectivity and poor consistency, and the lack of data linkage between existing image processing methods and melting and decolorization processes, leading to the inability to capture and adjust quality fluctuations in a timely manner. This improves the automation level of tallow processing and the consistency of product quality.

[0060] Furthermore, the system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to the actual situation to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0061] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.

[0062] It should be noted that the terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and do not imply a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of this application described herein can be implemented in an order other than that shown or described.

[0063] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A butter processing control method based on image processing, characterized in that, include: Acquire real-time images of the oil surface during the melting and decolorization stages of tallow processing; The real-time image is segmented, and the color feature vector of the oil region and the morphological feature parameters of the impurity particles are extracted. The chromaticity value of the oil is calculated based on the color feature vector, and the area ratio of impurities is calculated based on the morphological feature parameters. The chromaticity characterization value is compared with a preset standard chromaticity range. If the chromaticity characterization value deviates from the standard chromaticity range, a heating power adjustment value is generated. The impurity area ratio is compared with a preset impurity threshold. If the impurity area ratio exceeds the impurity threshold, a stirring rate adjustment value is generated. The heating power adjustment value and the stirring rate adjustment value are output to the actuator of the butter processing equipment.

2. The image processing-based butter processing control method according to claim 1, characterized in that, The steps for acquiring real-time images of the oil surface during the melting and decolorization stages of tallow processing include: Multiple frames of oil surface images are continuously acquired and the median gray value at each pixel position is calculated. The image composed of the medians is used as the real-time image.

3. The image processing-based butter processing control method according to claim 2, characterized in that, The steps for segmenting the real-time image include: An edge detection-based watershed algorithm is used to segment the real-time image into an oil region and an impurity particle region based on the gradient magnitude of the contact boundary between the oil region and the impurity particle in the real-time image, and each connected component in the impurity particle region is extracted as an impurity particle.

4. The image processing-based butter processing control method according to claim 3, characterized in that, The steps for extracting the color feature vector of the oil region include: Each pixel within the grease region is converted from the RGB color space to the Lab color space. The lightness component L, red-green component a, and yellow-blue component b of each pixel are extracted. The lightness component L, red-green component a, and yellow-blue component b of all pixels are used to construct three one-dimensional vectors as the color feature vectors.

5. The image processing-based butter processing control method according to claim 3, characterized in that, The steps for extracting morphological characteristic parameters of impurity particles include: Calculate the Freette diameter for the connected components of each impurity particle. eccentricity and shape complexity The Freette diameter, eccentricity, and shape complexity of all impurity particles are respectively combined into a one-dimensional vector as the morphological feature parameters.

6. The image processing-based butter processing control method according to claim 4, characterized in that, The step of calculating the chromaticity characterization value of oil based on the color feature vector is performed according to the following formula: ; Where C is the chromaticity characterization value of the oil, N is the total number of pixels in the oil region, and L i a i b i These are the brightness component, red-green component, and yellow-blue component of the i-th pixel, respectively. L0, a0, and b0 are preset standard butter color reference components, and α is a preset sensitivity coefficient.

7. The image processing-based butter processing control method according to claim 5, characterized in that, The step of calculating the impurity area ratio based on the morphological characteristic parameters is performed according to the following formula: ; Where R is the area ratio of the impurities, M is the total number of impurity particles in the oil region, and D Fj Let be the Freette diameter of the j-th impurity particle. Let be the eccentricity of the j-th impurity particle. Let A be the shape complexity of the j-th impurity particle, β and γ be preset penalty coefficients, and A be the shape complexity of the j-th impurity particle. oil This represents the total area of ​​the oil and fat region.

8. The image processing-based butter processing control method according to claim 7, characterized in that, After obtaining the impurity area ratio R, the method further includes a step of performing color coupling correction on the impurity area ratio R based on the oil color characterization value, wherein the color coupling correction is calculated using the following formula: ; Wherein, R′ is the area ratio of impurities after correction, R is the area ratio of impurities; C is the colorimetric value of the oil, C0 is the center value of the preset standard colorimetric range, and λ is the preset color-impurity coupling correction coefficient.

9. The image processing-based butter processing control method according to claim 8, characterized in that, The step of comparing the impurity area ratio with a preset impurity threshold and generating a stirring rate adjustment value includes: The corrected impurity area ratio R′ is compared with a preset impurity threshold. When the corrected impurity area ratio R′ is greater than the impurity threshold, a forward stirring rate adjustment value is generated. The forward stirring rate adjustment value is proportional to the difference between the corrected impurity area ratio R′ and the impurity threshold. When the corrected impurity area ratio R′ is less than or equal to the impurity threshold, a zero stirring rate adjustment value is generated.

10. A butter processing control system based on image processing, characterized in that, include: The acquisition module is used to acquire real-time images of the oil surface during the melting and decolorization stages of tallow processing; The segmentation module is used to segment the real-time image and extract the color feature vector of the oil region and the morphological feature parameters of the impurity particles. The calculation module is used to calculate the grease colorimetric value based on the color feature vector and to calculate the impurity area ratio based on the morphological feature parameters. A colorimetric comparison module is used to compare the colorimetric characterization value with a preset standard colorimetric range. If the colorimetric characterization value deviates from the standard colorimetric range, a heating power adjustment value is generated. An impurity comparison module is used to compare the impurity area ratio with a preset impurity threshold. If the impurity area ratio exceeds the impurity threshold, a stirring rate adjustment value is generated. The control module is used to output the heating power adjustment value and the stirring rate adjustment value to the actuator of the butter processing equipment.