A method and system for quality inspection of prefabricated dishes in vacuum packaging
Through image processing technology, the grayscale image of the vacuum packaging surface of pre-made vegetables is analyzed, and the wrinkle areas are identified and evaluated, which solves the automation and accuracy of vacuum packaging quality detection, and achieves efficient and accurate packaging quality detection.
Patent Information
- Application Number
- CN202411646558.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2044-11-18
AI Technical Summary
In the prior art, the quality inspection of vacuum packaging of pre-made vegetables has problems of low screening efficiency, high cost and inconsistency, making it difficult to achieve efficient, accurate and stable automated inspection.
By using image processing technology, automatic detection of vacuum packaging quality is achieved by acquiring grayscale images of vacuum packaging surfaces, analyzing the grayscale values and gradient amplitudes of pixel points, identifying candidate fold areas, and calculating comprehensive blur values and fold scores.
It improves the accuracy and automation of vacuum packaging quality inspection, ensures the intelligence and standardization of the inspection process, effectively identify blur and wrinkle phenomena caused by air leakage, and ensures packaging sealing and barrier performance.
Smart Images

Figure CN119515847B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and specifically relates to a method and system for detecting the quality of vacuum packaging of prefabricated dishes. Background Art
[0002] With the acceleration of the modern life rhythm, people's demand for convenient, fast and delicious meals is increasing continuously, and prefabricated dishes emerge as the times require and develop rapidly. Prefabricated dishes not only save the trouble of buying food raw materials, but also simplify the production steps, meeting the simple needs of urban people for meals. Vacuum packaging technology is an effective food preservation method. It excludes the air in the package and reduces the contact between food and oxygen, thereby delaying the oxidation and spoilage process of food. In the prefabricated dish industry, vacuum packaging is widely used, which can fully lock the original flavor, taste, freshness and quality of prefabricated dishes. The quality of vacuum packaging of prefabricated dishes directly affects their shelf life, quality assurance and consumers' food safety. However, on the production line, there may be a situation where the packaging bag is punctured or the sealing is not firm in a certain link, resulting in gas accumulation in the leaking package, which in turn leads to food spoilage. Therefore, it is particularly important to detect the quality of vacuum packaging of prefabricated dishes before leaving the factory. Quality inspection can ensure that the sealing and barrier properties of prefabricated dish packaging meet the specified standards, thus effectively preventing food from being contaminated and spoiled during storage and transportation.
[0003] In the prior art, due to the subjectivity and inconsistency of manual screening, and with the expansion of production scale and the improvement of speed, the low efficiency and high cost of manual screening have also become restrictive factors, making it difficult to meet the requirements of efficient, accurate and stable vacuum packaging quality detection. Therefore, developing a technical method that can automatically, standardize and detect the quality of vacuum packaging with high precision has become an urgent technical problem to be solved. Summary of the Invention
[0004] In order to solve the above technical problems, the purpose of this application is to provide a method and system for detecting the quality of vacuum packaging of prefabricated dishes, and the specific technical solutions adopted are as follows:
[0005] In the first aspect, an embodiment of this application provides a method for detecting the quality of vacuum packaging of prefabricated dishes, and this method includes the following steps:
[0006] Collect the grayscale images of the packaging surfaces of each prefabricated dish vacuum packaging;
[0007] Obtain the overall blur degree of each packaging surface grayscale image based on the dispersion degree of the grayscale values of the pixel points in the packaging surface grayscale image and the dispersion degree of the sharp change situation of the grayscale values;
[0008] Obtain the comprehensive blur value of each packaging surface grayscale image based on the degree of dispersion of the grayscale values within the neighborhood of the pixel points in the packaging surface grayscale image, the magnitude of the gradient amplitude of the pixel points, and the overall blur degree;
[0009] Based on the clustering result of the pixel points in the packaging surface grayscale image, obtain the candidate wrinkle regions of each connected domain in each packaging surface grayscale image;
[0010] Based on the aspect ratio of the circumscribed rectangle of the candidate wrinkle region and the distance between the position of the candidate wrinkle region in its connected domain and the edge of the connected domain, obtain the wrinkle probability coefficient of each candidate wrinkle region in each connected domain of each packaging surface grayscale image;
[0011] Based on the average situation of the wrinkle probability coefficients, obtain the wrinkle connected domains of each packaging surface grayscale image;
[0012] Based on the number of pixel points in the wrinkle connected domain and the average situation of the wrinkle probability coefficients, obtain the comprehensive wrinkle score of each packaging surface grayscale image;
[0013] Based on the comprehensive blur value and the comprehensive wrinkle score, obtain the packaging qualification of each packaging surface grayscale image;
[0014] Detect the quality of the vacuum packaging of prefabricated dishes based on the packaging qualification.
[0015] Furthermore, the method for obtaining the overall blur degree is as follows:
[0016] Calculate the Laplacian value of each pixel point in each packaging surface grayscale image;
[0017] For each packaging surface grayscale image, calculate the variance of the Laplacian values of all pixel points as the first variance, calculate the variance of the grayscale values of all pixel points as the second variance, and calculate the calculation result of the exponential function with the natural constant as the base and the negative value of the product of the first variance and the second variance as the exponent, as the overall blur degree of each packaging surface grayscale image.
[0018] Furthermore, the method for obtaining the comprehensive blur value is as follows:
[0019] Use an image segmentation algorithm to obtain each connected domain of each packaging surface grayscale image, and calculate the gradient amplitude of each pixel point in each packaging surface grayscale image;
[0020] The calculation formula of the comprehensive blur value is: In the formula, M is the comprehensive blur value of each packaging surface grayscale image; H is the overall blur degree of each packaging surface grayscale image, n a represents the number of pixel points in the a-th connected domain of the packaging surface grayscale image, n represents the number of connected domains in the packaging surface grayscale image, σ(g a,b) represents the variance of the gray values of all pixel points in the octagon neighborhood of the b-th pixel point in the a-th connected region in the gray image of the packaging surface, t a,b represents the gradient amplitude of the b-th pixel point in the a-th connected region in each gray image of the packaging surface.
[0021] Further, the method for obtaining the candidate fold region is as follows:
[0022] For each connected region in each gray image of the packaging surface, use the threshold segmentation algorithm to obtain the optimal segmentation threshold of the connected region, and regard all pixel points in the connected region with gray values greater than the optimal segmentation threshold as candidate bright points;
[0023] For each connected region in each gray image of the packaging surface, use the clustering algorithm to cluster all candidate bright points in the connected region to obtain each clustering cluster; regard the region composed of the candidate bright points of each clustering cluster in the connected region as each candidate fold region.
[0024] Further, the calculation formula of the fold possibility coefficient is: In the formula, Z x represents the fold possibility coefficient of the x-th candidate fold region in each connected region in each gray image of the packaging surface; s x represents the aspect ratio of the length to the width of the circumscribed rectangle of the x-th candidate fold region in each connected region in each gray image of the packaging surface; d x represents the minimum value of the distance between the central pixel point of the x-th candidate fold region in each connected region in each gray image of the packaging surface and the edge pixel points of its connected region; norm() is a normalization function.
[0025] Further, the method for obtaining the fold connected region is as follows:
[0026] For each connected region in each gray image of the packaging surface, calculate the mean value of the fold possibility coefficients of all candidate fold regions in the connected region as the fold possibility mean value. When the fold possibility mean value is greater than the preset judgment threshold, regard the connected region as the fold connected region.
[0027] Further, the method for obtaining the comprehensive fold score includes:
[0028] For each fold connected region in each gray image of the packaging surface, calculate the ratio between the number of pixel points in the fold connected region and the fold possibility mean value, and regard the sum value of the ratios of all fold connected regions in the gray image of the packaging surface as the comprehensive fold score of each gray image of the packaging surface.
[0029] Further, the packaging qualification is the ratio of the comprehensive fold score to the comprehensive fuzzy value.
[0030] Further, the detection of the vacuum packaging quality of prefabricated dishes based on the packaging qualification includes:
[0031] Normalize the packaging qualification of the grayscale images of the packaging surfaces of all prefabricated dish vacuum packages, and regard the prefabricated dish vacuum packages with packaging qualification greater than the preset qualification threshold as qualified packages.
[0032] In a second aspect, an embodiment of the present application further provides a quality detection system for prefabricated dish vacuum packages, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the method described in any one of the above.
[0033] The present application has at least the following beneficial effects:
[0034] When a vacuum package leaks, the package will bulge due to gas accumulation, the contour of the food will become blurred, and there will be wrinkles in qualified vacuum packages. Analyze the comprehensive blur value and comprehensive wrinkle score of the sample to be detected. Using advanced image processing algorithms, carefully analyze the overall blur degree of the sample, and effectively identify the image blur phenomenon caused by quality problems; by screening the pixel points in the image and performing clustering analysis, identify the candidate wrinkle connected regions. This step not only improves the accuracy of wrinkle detection, but also makes the detection process more intelligent and automated. Deeply analyze each candidate wrinkle region to determine the possibility of its wrinkles, and accordingly obtain the comprehensive wrinkle score. Combine the results of the comprehensive blur value and the comprehensive wrinkle score to comprehensively judge the qualification of the package of the sample to be detected, and improve the accuracy of the quality detection of prefabricated dish vacuum packages. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required to be used in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0036] Figure 1 It is a flowchart of the steps of a quality detection method for prefabricated dish vacuum packages provided by an embodiment of the present application;
[0037] Figure 2 It is a flowchart for obtaining packaging qualification provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] To further elaborate on the technical means and effects adopted by this application to achieve the intended invention purpose, the following specifically describes, in conjunction with the accompanying drawings and preferred embodiments, a method and system for detecting the quality of vacuum packaging of prefabricated dishes according to this application, including its specific implementation manner, structure, features, and effects. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs.
[0040] The following specifically describes the specific solution of a method and system for detecting the quality of vacuum packaging of prefabricated dishes provided by this application in conjunction with the accompanying drawings.
[0041] Please refer to Figure 1 , which shows the step flowchart of a method for detecting the quality of vacuum packaging of prefabricated dishes provided by an embodiment of this application. The method includes the following steps:
[0042] Step S1, collect the grayscale images of the packaging surfaces of each prefabricated dish vacuum packaging.
[0043] On the vacuum packaging production line, each vacuum packaging continuously moves along with the high-speed conveyor belt. To realize the quality detection of the prefabricated dish vacuum packaging bags, this application selects transparent vacuum packaging bags for detection, and installs an industrial camera directly above the conveyor belt to collect the packaging surface images of each prefabricated dish vacuum packaging to be detected on the conveyor belt.
[0044] The packaging surface images need to be of high definition to obtain the subtle features to be detected of the prefabricated dish vacuum packaging bags. To eliminate the influence of noise, this application performs denoising processing on the packaging surface images of each prefabricated dish vacuum packaging. This application selects Gaussian filtering to combine with the coarse grains of the packaging surface images of each prefabricated dish vacuum packaging, and implementers can select other denoising methods according to the actual situation.
[0045] Perform grayscale processing on the denoised packaging surface images of each prefabricated dish vacuum packaging to obtain the grayscale images of the packaging surfaces of each prefabricated dish vacuum packaging.
[0046] Step S2, obtain the overall blurriness of each packaging surface grayscale image based on the dispersion degree of the grayscale values of the pixel points and the dispersion degree of the drastic change of the grayscale values in the packaging surface grayscale image; obtain the comprehensive blur value of each packaging surface grayscale image based on the dispersion degree of the grayscale values within the neighborhood of the pixel points, the magnitude of the gradient amplitude of the pixel points, and the overall blurriness.
[0047] For each vacuum-packed prefabricated dish, after the air in the packaging bag of a qualified vacuum-packed prefabricated dish is pumped out, its internal pressure will decrease significantly, while the external atmospheric pressure remains unchanged. As a result, the outer packaging film remains tight and shrinks tightly against the food surface, forming a unique visual feature. When the sample to be tested leaks air, air will enter the package, causing the packaging bag to bulge, which forms a sharp contrast with the tight-fitting state of the qualified vacuum packaging.
[0048] Due to the extraction of gas inside the package, the food inside the package should be very clear in the captured image, and the characteristics such as the color and texture of the food are truly and vividly displayed in the image. For a leaking package, since the inner wall of the packaging film will closely adhere to the food surface during the vacuum pumping process, when air leakage occurs, as the external air slowly seeps into the package through the leakage port, the packaging film that originally adhered closely to the food surface will gradually separate from the food due to the gradual increase in internal air pressure, and the food will leave marks on the inner wall of the packaging film, thus blurring the transparent packaging film. These phenomena are manifested in the image as the weakening of the key visual features such as the color and texture of the food. Especially in the area where gas accumulates, due to the scattering and reflection of light, the gray value of this area may change, making the image blurred and unclear.
[0049] Furthermore, in order to reflect the degree of gray value change of each pixel point on the packaging surface gray image with its surrounding neighborhood, the Laplacian operator is used to calculate the Laplacian value of each pixel point on the packaging surface gray image. Among them, the Laplacian operator is a well-known technology and will not be elaborated in this embodiment.
[0050] Furthermore, in order to reflect the degree of blurriness of the packaging surface gray image of each vacuum-packed prefabricated dish, based on the dispersion degree of the gray values of the pixel points on the packaging surface gray image and the dispersion degree of the drastic change of the gray values, the overall blurriness of each packaging surface gray image is obtained. The calculation formula is: H = exp[-σ g ×σ Laplace ; In the formula, H represents the overall blurriness of each packaging surface gray image; σ g represents the variance of the gray values of all pixel points on the packaging surface gray image, and σ Laplace represents the variance of the Laplacian values of all pixel points on the packaging surface gray image, and exp represents the exponential function with the natural constant e as the base.
[0051] It should be noted that when the gray variance of the pixel points in the area of the sample to be tested is smaller, it indicates that the gray values between the pixel points are more uniform, that is, the higher the degree of blurriness. The Laplacian operator is an edge detection operator. After performing the Laplacian transform on the image, the clarity of the packaging surface gray image is proportional to the variance of the Laplacian values of the pixel points. The smaller the variance, the more blurred the image. At this time, the obtained overall blurriness is larger; on the contrary, the obtained overall blurriness is smaller.
[0052] Furthermore, on the vacuum packaging of prefabricated dishes, there may be multiple components or the texture characteristics of the sample to be detected itself. Therefore, all connected regions in the grayscale image of the packaging surface are obtained by segmenting the grayscale image of each packaging surface through an image segmentation algorithm. Among them, the image segmentation algorithm includes region growing algorithm, graph cut algorithm, etc. In this embodiment, the graph cut algorithm is selected for processing, and the implementer can select other algorithms according to the actual situation. The graph cut algorithm is a well-known technology and will not be elaborated in this embodiment.
[0053] In each connected region, when the vacuum packaging is qualified, each connected region should be clearly presented. Therefore, the detailed texture characteristics of the food are reflected in the grayscale image of the packaging surface.
[0054] Furthermore, in order to reflect the degree of blurriness on the surface of the vacuum packaging of prefabricated dishes, the gradient amplitude of each pixel point in the grayscale image of each packaging surface is calculated, and the comprehensive blurriness value of each grayscale image of the packaging surface is calculated based on the degree of dispersion of the grayscale values in the neighborhood of the pixel points, the magnitude of the gradient amplitude of the pixel points, and the overall blurriness. The calculation formula is: In the formula, M is the comprehensive blurriness value of each grayscale image of the packaging surface; H is the overall blurriness of each grayscale image of the packaging surface, n a represents the number of pixel points in the a-th connected region in the grayscale image of the packaging surface, n represents the number of connected regions in the grayscale image of the packaging surface, σ(g a,b ) represents the variance of the grayscale values of all pixel points in the eight-neighborhood of the b-th pixel point in the a-th connected region in the grayscale image of the packaging surface, t a,b represents the gradient amplitude of the b-th pixel point in the a-th connected region in each grayscale image of the packaging surface.
[0055] It should be noted that when the variance of the grayscale values in the 8-neighborhood of the pixel points in the connected region is smaller, and the gradient amplitude of the pixel points is smaller, it indicates that in this connected region, the texture characteristics of the corresponding sample to be detected are less obvious, that is, it is more in line with the blurriness characteristics caused by air leakage in the vacuum packaging; and when the overall blurriness of the sample to be detected is higher, its comprehensive blurriness value is also higher; on the contrary, the comprehensive blurriness value is smaller.
[0056] Step S3: Based on the clustering results of the pixel points in the grayscale image of the packaging surface, obtain the candidate wrinkle regions of each connected component in each grayscale image of the packaging surface; based on the aspect ratio of the circumscribed rectangle of the candidate wrinkle region and the distance between the candidate wrinkle region and the edge of the connected component where it is located in its connected component, obtain the wrinkle probability coefficient of each candidate wrinkle region in each connected component of each grayscale image of the packaging surface; based on the average situation of the wrinkle probability coefficient, obtain the wrinkle-connected components of each grayscale image of the packaging surface; based on the number of pixel points in the wrinkle-connected component and the average situation of the wrinkle probability coefficient, obtain the comprehensive wrinkle score of each grayscale image of the packaging surface; based on the comprehensive fuzzy value and the comprehensive wrinkle score, obtain the packaging qualification of each grayscale image of the packaging surface.
[0057] For each vacuum-packed pre-made dish, in a qualified vacuum package, since air is extracted, the packaging film closely adheres to the food surface. Due to the irregular shape of the food, such as edges, corners, curved surfaces, etc., wrinkles will be generated in these positions during the shrinkage process. And due to the tiny gaps between the packaging film and the food surface, wrinkles will also be formed under light. These wrinkles will visually appear as transparent white, and the wrinkles usually occur at the edges of the connected components. However, in a leaky package, due to the accumulation of gas inside the package, it may cause unevenness, bulging, or deformation on the packaging surface, which is in sharp contrast to the closely adhered wrinkles of the qualified vacuum package.
[0058] According to the above analysis, for each connected component in each grayscale image of the packaging surface, use the Otsu threshold segmentation algorithm to obtain the optimal segmentation threshold of the connected component. The Otsu threshold segmentation algorithm is a well-known technology and will not be elaborated in this embodiment; consider all pixel points in the connected component with grayscale values greater than the optimal segmentation threshold as candidate bright points.
[0059] Furthermore, for each connected component in each grayscale image of the packaging surface, use a clustering algorithm to cluster all candidate bright points within the connected component to obtain each clustering cluster; the clustering algorithms include the k-means clustering algorithm, DBSCAN clustering algorithm, hierarchical clustering algorithm, etc. In this embodiment, the DBSCAN clustering algorithm is selected for clustering, and implementers can select other clustering methods according to actual situations; the clustering algorithm is a well-known technology and will not be elaborated in this embodiment; consider the region composed of the candidate bright points of each clustering cluster in the connected component as each candidate wrinkle region.
[0060] Furthermore, for the candidate wrinkle region within each connected component, since wrinkles usually occur in places with edges or gaps, the closer it is to the edge of the connected component, the more likely it is to be a wrinkle. Perform edge detection on each connected component. When the candidate wrinkle region is around the edge of its connected component, the candidate wrinkle region is more likely to belong to a wrinkle. And wrinkles usually appear slender. According to the above analysis, calculate the wrinkle probability coefficient of each candidate wrinkle region in each connected component of each grayscale image of the packaging surface. The calculation formula is: In the formula, Z x represents the fold probability coefficient of the x-th candidate fold region in each connected domain of the grayscale image of each packaging surface; s x represents the aspect ratio of the circumscribed rectangle of the x-th candidate fold region in each connected domain of the grayscale image of each packaging surface; d x represents the minimum value of the distance between the central pixel point of the x-th candidate fold region in each connected domain of the grayscale image of each packaging surface and the edge pixel points of its connected domain; norm() is a normalization function.
[0061] It should be noted that for the aspect ratio s x of the circumscribed rectangle of the x-th candidate fold region, the larger its value, the more its shape conforms to the slender feature of the fold; d x represents the minimum value of the distance between the central pixel point of the x-th candidate fold region in each connected domain of the grayscale image of each packaging surface and the edge pixel points of its connected domain. The smaller the value, the closer the candidate fold region is to the edge, and the higher the fold probability coefficient of the candidate fold region. +1 is to avoid the situation where the shortest distance is zero when the fold coincides with the edge, resulting in a zero denominator.
[0062] Select the fold connected domain according to the fold probability coefficient. The obtaining method is as follows: for each connected domain in the grayscale image of each packaging surface, calculate the average value of the fold probability coefficients of all candidate fold regions in the connected domain as the fold average value. When the fold average value is greater than the preset judgment threshold, the connected domain is used as the fold connected domain. In this embodiment, the value of the preset judgment threshold is 0.6, and the implementer can select other values according to the actual situation.
[0063] Determine the comprehensive fold score of each grayscale image of the packaging surface according to the fold average value of the candidate fold regions in all connected domains of each grayscale image of the packaging surface: In the formula, N is the comprehensive fold score of each grayscale image of the packaging surface; n1 represents the number of all fold connected domains in each grayscale image of the packaging surface; g y represents the number of pixel points in the y-th fold connected domain of each grayscale image of the packaging surface; Z y represents the fold average value of the y-th fold connected domain of each grayscale image of the packaging surface.
[0064] It should be noted that when the number of fold connected domains in the grayscale image of the packaging surface of the sample to be detected is larger, and the smaller its area and the higher the fold probability coefficient, the more the packaging of the sample to be detected conforms to the fold performance of the qualified vacuum packaging, and the higher its comprehensive fold score; on the contrary, its comprehensive fold score is lower.
[0065] Furthermore, a qualified vacuum-packaged image should have the higher clarity of the contents, that is, the smaller the comprehensive blur value, and there should be many wrinkles with relatively small areas in the qualified vacuum packaging, that is, the higher the comprehensive evaluation, meeting the qualified requirements of vacuum packaging. Therefore, based on the comprehensive blur value and the comprehensive wrinkle score obtained according to the above steps, calculate the packaging qualification of each packaging surface grayscale image. The calculation formula is: ; where W is the packaging qualification of each packaging surface grayscale image; N is the comprehensive wrinkle score of each packaging surface grayscale image, and M is the comprehensive blur value of each packaging surface grayscale image. Among them, the flowchart for obtaining the packaging qualification is as shown in Figure 2 shown.
[0066] It should be noted that when the comprehensive blur value is smaller and the comprehensive wrinkle score is larger, the surface of the packaging is clearer, the wrinkles are more obvious, and the packaging is more complete. At this time, the packaging qualification of the packaging surface grayscale image is higher; on the contrary, the packaging qualification is lower.
[0067] Step S4, detect the quality of the prefabricated vegetable vacuum packaging based on the packaging qualification.
[0068] Normalize the packaging qualification of the packaging surface grayscale images of all prefabricated vegetable vacuum packagings, and regard the prefabricated vegetable vacuum packagings with packaging qualification greater than the preset qualified threshold as qualified packagings. In this embodiment, the value of the preset qualified threshold is 0.9, and the implementer can select other values according to the actual situation. Intelligently detect the quality of the prefabricated vegetable vacuum packaging to ensure that qualified products flow into the market.
[0069] Based on the same inventive concept as the above method, the embodiment of the present application also provides a prefabricated vegetable vacuum packaging quality detection system, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of any one of the above prefabricated vegetable vacuum packaging quality detection methods.
[0070] It should be noted that: the above sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above description of specific embodiments of this specification is given. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0071] Each embodiment in the present application is described in a progressive manner. The same or similar parts between each embodiment can be referred to each other, and the key points of each embodiment are the differences from other embodiments.
[0072] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principle of the present application shall be included within the protection scope of the present application.
Claims
1. A method for detecting the quality of vacuum packaging of pre-prepared dishes, characterized in that: The method comprises the following steps: Collecting grayscale images of the packaging surfaces of vacuum packages of various pre-prepared dishes; The overall fuzziness of each packaging surface grayscale image is obtained based on the discrete degree of the grayscale values of the pixels in the packaging surface grayscale image and the discrete degree of the drastic change of the grayscale values; Based on the discrete degree of the grayscale value in the neighborhood of the pixel point in the grayscale image of the packaging surface, the size of the gradient amplitude of the pixel point and the overall fuzziness, the comprehensive fuzzy value of each packaging surface grayscale image is obtained; Based on the clustering results of the pixels in the grayscale image of the packaging surface, the candidate wrinkle regions of each connected domain in the grayscale image of each packaging surface are obtained; Based on the aspect ratio of the circumscribed rectangle of the candidate wrinkle region and the distance between the position of the candidate wrinkle region in the connected domain and the edge of the connected domain, the wrinkle possibility coefficient of each candidate wrinkle region in each connected domain in the grayscale image of each packaging surface is obtained; Based on the average of possible wrinkle coefficients, the wrinkle connected domain of the grayscale image of each package surface is obtained; Obtaining a comprehensive wrinkle score of the grayscale image of each package surface based on the number of pixels in the wrinkle connected domain and the average of the wrinkle possible coefficient of the wrinkle connected domain; Based on the comprehensive fuzzy value and comprehensive wrinkle score, the packaging eligibility of the grayscale image of each packaging surface is obtained; The quality of vacuum packaging of pre-prepared dishes is tested based on packaging conformity.
2. A method for detecting the quality of vacuum packaging of prepared dishes as claimed in claim 1, characterized in that: The method for obtaining the overall ambiguity is: Calculate the Laplace value of each pixel in the grayscale image of each package surface; For the grayscale image of each packaging surface, the variance of the Laplace values of all pixels is calculated as the first variance, the variance of the grayscale values of all pixels is calculated as the second variance, and the result of an exponential function with a natural constant as the base and the negative value of the product of the first variance and the second variance as the exponent is calculated as the overall blurriness of the grayscale image of each packaging surface.
3. A method for detecting the quality of vacuum packaging of prepared dishes as claimed in claim 1, characterized in that: The method for obtaining the comprehensive fuzzy value is: Use image segmentation algorithm to obtain each connected domain of the grayscale image of each package surface, and calculate the gradient amplitude of each pixel point in the grayscale image of each package surface; The calculation formula of the comprehensive fuzzy value is: Where M is the comprehensive fuzzy value of the grayscale image of each packaging surface; H is the overall fuzziness of the grayscale image of each packaging surface, n a represents the number of pixels in the ath connected domain in the grayscale image of the packaging surface, n represents the number of connected domains in the grayscale image of the packaging surface, σ(g a,b ) represents the variance of the grayscale values of all pixels in the eight-neighborhood of the bth pixel in the ath connected domain in the grayscale image of the packaging surface, t a,b Represents the gradient amplitude of the bth pixel in the ath connected domain in the grayscale image of each package surface.
4. A method for detecting the quality of vacuum packaging of prepared dishes as claimed in claim 1, characterized in that: The method for obtaining the candidate wrinkle area is: For each connected domain in the grayscale image of each package surface, the threshold segmentation algorithm is used to obtain the optimal segmentation threshold of the connected domain, and all pixels in the connected domain whose grayscale values are greater than the optimal segmentation threshold are taken as candidate bright spots; For each connected domain in the grayscale image of each package surface, a clustering algorithm is used to cluster all candidate bright spots in the connected domain to obtain each clustering cluster; the area composed of the candidate bright spots of each clustering cluster in the connected domain is used as each candidate wrinkle area.
5. A method for detecting the quality of vacuum packaging of prepared dishes as claimed in claim 1, characterized in that: The calculation formula of the wrinkle possibility coefficient is: In the formula, Z x represents the wrinkle possibility coefficient of the xth candidate wrinkle area in each connected domain in the grayscale image of each packaging surface; s x represents the aspect ratio of the circumscribed rectangle of the xth candidate wrinkle region in each connected domain in the grayscale image of each packaging surface; d x It represents the minimum value of the distance between the central pixel of the x-th candidate wrinkle area in each connected domain in the grayscale image of each packaging surface and the edge pixel of its connected domain; norm() is the normalization function.
6. A method for detecting the quality of vacuum packaging of prepared dishes as claimed in claim 1, characterized in that: The method for obtaining the fold connected domain is: For each connected domain in the grayscale image of each packaging surface, the mean of the wrinkle possibility coefficients of all candidate wrinkle areas in the connected domain is calculated as the wrinkle possibility mean. When the wrinkle possibility mean is greater than the preset judgment threshold, the connected domain is regarded as the wrinkle connected domain.
7. A method for detecting the quality of vacuum packaging of prepared dishes as claimed in claim 6, characterized in that: The method for obtaining the comprehensive wrinkle score is: For each wrinkle connected domain in the grayscale image of each packaging surface, the ratio between the number of pixels in the wrinkle connected domain and the possible mean value of wrinkles is calculated, and the sum of the ratios of all wrinkle connected domains in the grayscale image of the packaging surface is taken as the comprehensive wrinkle score of each packaging surface grayscale image.
8. The method for detecting the quality of vacuum packaging of prepared dishes according to claim 1, characterized in that: The packaging conformity is the ratio of the comprehensive wrinkle score to the comprehensive fuzziness value.
9. A method for detecting the quality of vacuum packaging of prepared dishes as claimed in claim 1, characterized in that: The testing of the quality of vacuum packaging of pre-prepared dishes based on packaging eligibility includes: The packaging conformity of the packaging surface grayscale images of all pre-prepared food vacuum packages is normalized, and the pre-prepared food vacuum packages whose packaging conformity after normalization is greater than a preset conformity threshold are regarded as conforming packages.
10. A system for detecting the quality of vacuum packaging of prepared dishes, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method for detecting the quality of vacuum packaging of pre-prepared dishes as described in any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Sterile vacuum packaging state detection method and system for meat products
CN118471376A
Vacuum machine package sealing performance detection system based on convolutional neural network
CN118761014A