A machine vision-based oil mixing uniformity control method
By analyzing the oil mixing process using machine vision and dynamically adjusting the detection frequency and cycle, the problem of insufficient or excessive mixing in traditional oil mixing is solved, thereby improving the uniformity of oil mixing and production efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 四川友联味业食品有限公司
- Filing Date
- 2026-01-28
- Publication Date
- 2026-04-17
AI Technical Summary
Traditional oil mixing processes rely on manual observation or fixed time programs, which can lead to insufficient or excessive mixing, making it difficult to quantify and assess uniformity, thus affecting product quality and production efficiency.
Using a machine vision-based approach, the number of yellow-white particles in the fan-shaped observation area is periodically captured and analyzed by a camera module. By combining the nearest neighbor distance coefficient of variation and the area ratio of chili shells on and under the oil, the shooting frequency and detection cycle are dynamically adjusted to achieve precise control of the mixing uniformity.
It improves the precision and efficiency of the mixing process, enhances adaptability to different batch production, and ensures the uniformity and reliability of oil mixing.
Smart Images

Figure CN121600453B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and more specifically, to a method for controlling the uniformity of oil mixing based on machine vision. Background Technology
[0002] With the continuous improvement of automation in the food processing industry, the requirements for the control precision of material mixing processes are also increasing. In the production of oils (such as chili oil and seasoning oil), it is often necessary to thoroughly mix various solid materials (such as chili seeds and chili shells) with the oil to ensure the uniformity of the final product in terms of color, flavor, and texture. Traditional mixing processes usually rely on manual observation or fixed-time mixing procedures to judge uniformity, which has problems such as strong subjectivity, poor repeatability, and difficulty in quantitative evaluation. This can easily lead to under-mixing or over-mixing, affecting product quality and production efficiency. Summary of the Invention
[0003] The purpose of this invention is to provide a machine vision-based method for controlling the uniformity of oil mixing, so as to solve the above-mentioned technical problems.
[0004] To achieve the above objectives, the embodiments of this application provide the following technical solutions:
[0005] This application provides a machine vision-based method for controlling the uniformity of oil mixing. The method is applicable to a drum-type mixing device, including a mixing drum, a rotating stirring rod located in the middle of the mixing drum's inner cavity, and a camera module located above the mixing drum. The method includes: after multiple materials are sequentially added, the camera module periodically captures multiple first detection samples based on a time-series distribution at 5-8 second intervals. Based on a preset cropping frame, three annularly distributed fan-shaped observation areas are cropped from the first detection samples. A color-based image feature extraction algorithm is used to identify the number of yellow-white particles in each fan-shaped observation area, thereby obtaining the uniformity of oil mixing in the first detection samples. The total number of yellow-white particles in the three sector-shaped observation areas is measured. When the total number of yellow-white particles corresponding to multiple first detection samples tends to stabilize, the first uniformity detection is triggered. If the first uniformity detection is qualified, the amount of oil added in the current batch of various materials is obtained, and the sampling period of the camera is determined based on the amount of oil added. At the same time, the shooting interval of the camera module within the sampling period is shortened to 1.5-2 seconds / shot. Multiple second detection samples within a sampling period are retrieved, and the material uniformity distribution corresponding to each second detection sample is analyzed in turn. If the material uniformity distribution of multiple detection samples meets the requirements, the mixing is determined to be complete.
[0006] Optionally, the step of sequentially analyzing the material uniformity distribution corresponding to each second test sample includes analyzing the distribution of yellowish-white granular chili seeds, dark red chili shells under the oil, and bright red chili shells on the oil in the material.
[0007] Optionally, the first uniformity detection includes:
[0008] The most recently captured first detection sample is retrieved and designated as the third detection sample. Based on the average number of yellow-white particles corresponding to the three sector observation areas in the third detection sample, the coefficient of variation threshold of the nearest neighbor distance is retrieved from the running parameter reference table. Then, the coordinate data corresponding to each yellow-white particle in the sector observation area is identified. The coefficient of variation of the nearest neighbor distance corresponding to each sector observation area is calculated using the nearest neighbor distance algorithm. The coefficient of variation of the nearest neighbor distance in all three sector observation areas is less than the coefficient of variation threshold of the nearest neighbor distance. The coefficient of variation is used to characterize the consistency of the spacing between yellow-white particles, and the smaller the value, the more uniform the particle distribution.
[0009] Optionally, the material uniformity distribution corresponding to each second test sample is analyzed sequentially, including:
[0010] Based on the preset cropping frame, three fan-shaped observation areas distributed in a ring are cropped out from the second detection sample, which are denoted as the second fan-shaped observation area.
[0011] The second sector observation area is divided into multiple unit observation blocks, and the unit observation blocks are divided into chili pepper blocks under the oil or chili pepper blocks on the oil according to the RGB mean of the unit observation blocks.
[0012] Calculate the ratio of the number of chili pieces under the oil to the number of chili pieces on the surface of the oil, and record it as the first ratio. The first ratio is used to characterize the area ratio of chili pieces covered under the oil to chili pieces exposed above the oil surface in a fixed area on the surface of the material in the mixing tank.
[0013] Calculate the difference between the maximum and minimum values of the first ratios corresponding to the three second sector observation areas in the second test sample, and determine that the material uniformity of the second test sample is qualified if the difference is within the preset fluctuation threshold range;
[0014] If the material uniformity of multiple second test samples is qualified, calculate the mean of the quantity ratio corresponding to each second test sample, and calculate the standard deviation of the mean among multiple second test samples. If the standard deviation is less than a preset error threshold, perform the filling operation.
[0015] The beneficial effects of this invention are as follows:
[0016] The machine vision-based oil mixing uniformity control method of the present invention initially captures and monitors the changes in the number of yellow-white particles at relatively long intervals. Once the number stabilizes, the first uniformity detection is triggered, avoiding invalid analysis during the unstable stage of initial mixing. Subsequently, the shooting interval is adaptively shortened according to the amount of oil added, entering the fine detection stage, making the detection timing more accurate and the overall control process more efficient.
[0017] Secondly, the sampling cycle and shooting frequency of the camera module are dynamically adjusted according to the actual amount of oil added in production, so that the detection rhythm matches the actual material mixing characteristics, thereby improving the adaptability of the method to different batch production volumes.
[0018] Secondly, the method described in this invention not only assesses the spatial distribution uniformity of yellow-white particles (such as chili seeds) through the nearest neighbor distance coefficient of variation, but also comprehensively evaluates the mixing and distribution of oil and main seasonings through the area ratio of chili shells on the oil and chili shells under the oil, overcoming the limitations of single feature evaluation (such as chili seeds) and making the uniformity judgment more comprehensive and reliable.
[0019] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing embodiments of the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description
[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a schematic diagram of a machine vision-based method for controlling the uniformity of oil mixing, as described in an embodiment of the present invention.
[0022] Figure 2 This is a schematic diagram of the camera module detection screen structure in a machine vision-based oil mixing uniformity control method described in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0024] It should be noted that similar reference numerals or letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0025] Example 1
[0026] Before explaining the principles of the invention described in this application, a brief parameter description of the specific production scenario is needed. The main ingredients for mixing chili oil products are pre-chopped chili peppers and rapeseed oil. The chopped chili peppers consist of two main parts: one is the yellowish-white chili seed particles, and the other is the chopped red chili shells. Traditional fixed-time / speed programs are essentially open-loop systems. They assume that as long as the input (material quantity, type) and process (time, speed) are fixed, the output (uniformity) will also be fixed. However, in actual production, even for the same raw material, there are batch-to-batch differences in its physical properties, and these differences can significantly affect mixing efficiency. For example, the chili powder purchased in this batch may have slight differences in oil absorption and dispersibility compared to the previous batch due to differences in origin, grinding fineness, and moisture content. Fixed processes cannot detect these differences, which may lead to insufficient mixing (clumping) or over-mixing (evaporation of flavor compounds). Secondly, changes in the ambient temperature of the workshop on the day of oil mixing will significantly affect the viscosity of the oil. For example, slight wear of the mixing shaft bearings and a slight decrease in motor efficiency can all cause different mixing efficiencies at the same speed and time.
[0027] like Figure 1 As shown, this embodiment provides a machine vision-based method for controlling the uniformity of oil mixing. The method is applicable to a barrel-type mixing device, including a mixing barrel, a rotary mixing rod disposed in the middle of the inner cavity of the mixing barrel, and a camera module disposed above the mixing barrel. The method includes steps S100 and S200.
[0028] Step S100: After the various materials are sequentially added, a camera module periodically captures multiple first detection samples based on time-series distribution at 5-8 second intervals. Three annularly distributed fan-shaped observation areas are cropped from the first detection samples using a preset cropping frame. A color-based image feature extraction algorithm is used to identify the number of yellow-white particles in each fan-shaped observation area, thus obtaining the total number of yellow-white particles in the three fan-shaped observation areas of the first detection sample. When the total number of yellow-white particles corresponding to the multiple first detection samples tends to stabilize, a first uniformity detection is triggered. If the first uniformity detection is qualified, the amount of oil added in the current batch of various materials is obtained, and based on the oil addition amount... Determine the camera's sampling period; simultaneously shorten the shooting interval of the camera module within the sampling period to 1.5-2 seconds / shot. Since distinguishing between yellow-white and red colors is relatively easy, and the computational load of color-based image extraction algorithms is small, the computational requirements before uniform mixing are low. Initially, only periodic acquisition of the chili seed particle count fluctuation in the monitoring area is performed. When the chili seed particle count fluctuation is stable (constantly fluctuating within a preset percentage fluctuation range), preliminary particle distribution uniformity detection is continuously triggered, i.e., detecting the uniformity of chili seed distribution in the most recently acquired first detection sample. For details on the chili seed uniformity detection method, please refer to the first uniformity detection method; it will not be elaborated here. If the chili seed uniformity detection is qualified, detailed detection is performed. In detailed detection, the sampling frequency increases, and the sampling period is customized based on the oil volume (indirectly representing the stirring amount). One sampling period roughly corresponds to the time it takes for the bottom material to move from bottom to top under the current stirring amount and stirring speed. This time is determined through manual experimentation. Furthermore, chili shell fragments, as one of the main mixing materials, are also included in the evaluation. Detailed implementation methods are described below.
[0029] The distribution of the sector-shaped observation areas is as follows: Figure 2 As shown, the center point of the arc of the fan-shaped observation area coincides with the center of the circular mixing tank. At the same time, the three fan-shaped observation areas are located in the middle area of the imaging area of the camera module, thereby reducing the stretching and deformation of the pattern caused by lens distortion. During the mixing process, the material as a whole exhibits a vortex motion state, that is, the material rotates slowly in the direction of rotation of the stirring rod. Meanwhile, the material in the middle area of the mixing tank sinks, and the material in the edge area of the mixing tank rises. Furthermore, the camera module has a built-in light module for illuminating the mixing monitoring area.
[0030] Step S200: Retrieve multiple second test samples within a sampling period and analyze the material uniformity distribution corresponding to each second test sample in sequence. The main analysis focuses on the distribution of yellowish-white granular chili seeds, dark red chili shells under the oil, and bright red chili shells on the oil. If the material uniformity distribution of multiple test samples meets the requirements, the mixing is deemed complete.
[0031] The specific implementation method of the first uniformity detection mentioned above can be as follows:
[0032] The most recently captured first detection sample is retrieved and designated as the third detection sample. Based on the average number of yellow-white particles corresponding to the three fan-shaped observation areas in the third detection sample, the corresponding nearest neighbor distance variation coefficient threshold is retrieved from the running parameter reference table. Then, the coordinate data corresponding to each yellow-white particle in the fan-shaped observation area is identified. The nearest neighbor distance variation coefficient is calculated for each fan-shaped observation area using the nearest neighbor distance algorithm. The variation coefficients of the nearest neighbor distances in all three fan-shaped observation areas are less than the nearest neighbor distance variation coefficient threshold. The variation coefficient is used to characterize the consistency of the spacing between yellow-white particles, and the smaller the value, the more uniform the particle distribution. The specific calculation method of the nearest neighbor distance variation coefficient is as follows: calculate the distance from each particle to all other particles, find its nearest neighbor distance, and calculate the average and standard deviation of multiple nearest neighbor distances. The variation coefficient of the nearest neighbor distance is calculated based on the average and standard deviation. Secondly, the coordinate data corresponding to the yellow-white particles is mainly determined by pre-mapping the coordinate system in the fan-shaped observation area, and then obtained based on the specific position of the yellow-white particles in the fan-shaped observation area.
[0033] Secondly, the specific implementation of the material uniformity distribution corresponding to each second detection sample in step S200 can be as follows:
[0034] Step S210, as follows Figure 2 As shown, based on the preset cropping frame, three fan-shaped observation areas distributed in a ring are cropped out from the second detection sample, which are denoted as the second fan-shaped observation area.
[0035] Step S220: Divide the second sector observation area into multiple unit observation blocks, and classify the unit observation blocks into chili pepper blocks under the oil or chili pepper blocks on the oil according to the RGB mean of the unit observation blocks. If there is a yellow-white area in the unit observation block, it is marked as an invalid unit observation block and is not included in the division of chili pepper blocks under the oil and chili pepper blocks on the oil. The chili pepper blocks under the oil are generally dark red or dark red, while the chili pepper blocks on the oil are generally bright red. The division can be achieved by preset the corresponding RGB range threshold and then calculating the RGB mean of each unit observation block.
[0036] Step S230: Calculate the ratio of the number of chili pieces under the oil to the number of chili pieces on the oil, and record it as the first ratio. The first ratio is used to characterize the area ratio of chili pieces covered under the oil to chili pieces exposed on the oil surface in a certain fixed area on the upper surface of the material in the mixing tank, and thus characterize the mixing state between rapeseed oil and chili shells. When this state area is stable, the ratio will fluctuate slightly within a certain fluctuation range.
[0037] Step S240: Calculate the difference between the maximum and minimum values of the first ratios corresponding to the three second sector observation areas in the second test sample, and determine that the material uniformity of the second test sample is qualified if the difference is within the preset fluctuation threshold range. The material uniformity of the second test sample indicates that the area ratio of chili peppers under the oil and chili peppers exposed on the oil surface in multiple second sector observation areas is consistent across the whole area at a certain moment.
[0038] Step S250: If the material uniformity of multiple second test samples is qualified, calculate the mean of the quantity ratio corresponding to each second test sample, and calculate the standard deviation corresponding to the mean of multiple second test samples. If the standard deviation is less than the preset error threshold, it indicates that the material uniformity of multiple second test samples in one cycle tends to be consistent. Then, the filling operation is performed. That is, first determine the material consistency of three second sector observation areas on the upper surface of the mixing tank at a certain moment, and then check the material consistency of multiple second test samples in one cycle. Only when both are satisfied is it determined that the mixing is sufficient.
[0039] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A machine vision-based method for controlling the uniformity of oil mixing, the method being applicable to a barrel-type mixing device, comprising a mixing barrel, a rotary stirring rod disposed in the middle of the inner cavity of the mixing barrel, and a camera module disposed above the mixing barrel, characterized in that, The method includes: After multiple materials are sequentially added, the camera module periodically captures multiple first detection samples based on time-series distribution at 5-8 second intervals. Three annularly distributed fan-shaped observation areas are then cropped from each first detection sample using a preset cropping frame. A color-based image feature extraction algorithm identifies the number of yellow-white particles in each fan-shaped observation area, thus obtaining the total number of yellow-white particles in the three fan-shaped observation areas of the first detection sample. When the total number of yellow-white particles corresponding to multiple first detection samples tends to stabilize, a first uniformity detection is triggered. If the first uniformity detection is successful, the amount of oil added in the current batch of multiple materials is obtained, and the camera's sampling cycle is determined based on the oil addition amount. Simultaneously, the shooting interval of the camera module within the sampling cycle is shortened to 1.5-2 seconds per shot. Multiple second test samples within a sampling period are retrieved, and the material uniformity distribution corresponding to each second test sample is analyzed in turn. If the material uniformity distribution of multiple test samples meets the requirements, the mixing is determined to be complete. The step of sequentially analyzing the material uniformity distribution corresponding to each second test sample includes analyzing the distribution of yellowish-white granular chili seeds, dark red chili shells under the oil, and bright red chili shells on the oil in the material. The first uniformity detection includes: The most recently captured first detection sample is retrieved and designated as the third detection sample. Based on the average number of yellow-white particles corresponding to the three sector observation areas in the third detection sample, the coefficient of variation threshold of the nearest neighbor distance is retrieved from the running parameter reference table. Then, the coordinate data corresponding to each yellow-white particle in the sector observation area is identified. The coefficient of variation of the nearest neighbor distance corresponding to each sector observation area is calculated using the nearest neighbor distance algorithm. The coefficient of variation of the nearest neighbor distance in all three sector observation areas is less than the coefficient of variation threshold of the nearest neighbor distance. The coefficient of variation is used to characterize the consistency of the spacing between yellow-white particles, and the smaller the value, the more uniform the particle distribution. Secondly, the material uniformity distribution corresponding to each second test sample is analyzed sequentially, including: Based on the preset cropping frame, three fan-shaped observation areas distributed in a ring are cropped out from the second detection sample, which are denoted as the second fan-shaped observation area. The second sector observation area is divided into multiple unit observation blocks, and the unit observation blocks are divided into chili pepper blocks under the oil or chili pepper blocks on the oil according to the RGB mean of the unit observation blocks. Calculate the ratio of the number of chili pieces under the oil to the number of chili pieces on the surface of the oil, and record it as the first ratio. The first ratio is used to characterize the area ratio of chili pieces covered under the oil to chili pieces exposed above the oil surface in a fixed area on the surface of the material in the mixing tank. Calculate the difference between the maximum and minimum values of the first ratios corresponding to the three second sector observation areas in the second test sample, and determine that the material uniformity of the second test sample is qualified if the difference is within the preset fluctuation threshold range; In the case that the material uniformity of the plurality of second detection samples is qualified, the mean value of the quantity ratio corresponding to each second detection sample is calculated, the standard deviation corresponding to the mean value of the plurality of second detection samples is calculated, and in the case that the standard deviation is less than a preset error threshold, the filling operation is performed.
Citation Information
Patent Citations
Evaluation method for dry mixing uniformity of admixture slurry powder used for lithium ion battery
CN106404584A
Method and device for detecting mixing uniformity of compound premix, storage medium and equipment
CN121141575A