Method and system for detecting vacuum packaging quality of prefabricated vegetables

Through image processing technology, the overall ambiguity and comprehensive fold score of vacuum packaging are calculated, which solves the problems of low quality detection efficiency and high cost of vacuum packaging in the prior art, and achieves high-precision and automated detection effects.

CN119515847AActive Publication Date: 2025-02-25DONGGUAN QIANCHU FOOD CO LTD

Patent Information

Application Number
CN202411646558.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-25
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

The prior art is difficult to meet the needs of efficient, accurate and stable vacuum packaging quality inspection, especially when the production scale is expanded and the speed is increased, the efficiency of artificial screening is inefficient and costly.

Method used

By collecting the grayscale image of the packaging surface of the vacuum packaging of pre-made vegetables, calculating the overall ambiguity and comprehensive ambiguity values, identifying the candidate wrinkle areas, calculating the wrinkle possible coefficients, obtaining the comprehensive wrinkle score, and judging the packaging qualification based on the ambiguity and wrinkle scores.

Benefits of technology

It realizes automated, standardized and high-precision vacuum packaging quality inspection, improves detection accuracy, reduces costs, and meets efficient, accurate and stable inspection needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119515847A_ABST
    Figure CN119515847A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a prefabricated vegetable vacuum package quality detection method and system, and the method comprises the steps: collecting a package surface gray scale image of each prefabricated vegetable vacuum package; calculating the overall ambiguity and the comprehensive ambiguity value of each package surface grayscale image; obtaining a candidate fold area; calculating a wrinkle possibility coefficient; obtaining a wrinkle connected domain of each package surface gray level image; calculating a comprehensive wrinkle score of each package surface gray scale image; and based on the comprehensive fuzzy value and the comprehensive wrinkle score, obtaining the packaging qualification of each packaging surface gray scale image, and detecting the vacuum packaging quality of the prefabricated vegetables. According to the invention, the precision of vacuum packaging quality detection of the prefabricated vegetables is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and system for detecting the quality of vacuum packaging of pre-prepared dishes. Background Art

[0002] With the acceleration of the pace of modern life, people's demand for convenient, fast and delicious meals is increasing, and pre-prepared meals have emerged and developed rapidly. Pre-prepared meals not only save the trouble of purchasing food ingredients, but also simplify the production steps, meeting the simple needs of urban people for meals. Vacuum packaging technology is an effective means of food preservation. It reduces the contact between food and oxygen by excluding air from the package, thereby delaying the oxidation and corruption of food. In the pre-prepared meal industry, vacuum packaging is widely used, which can fully lock the original flavor, taste, freshness and quality of pre-prepared meals. The quality of pre-prepared meal vacuum packaging directly affects its shelf life, quality assurance and consumer food safety. However, on the production line, the packaging bag may be tied or sealed improperly at a certain link, resulting in air leakage, which will cause gas accumulation in the leaking package, and then cause food deterioration. Therefore, it is particularly important to conduct quality inspection of pre-prepared meal vacuum packaging before leaving the factory. Quality inspection can ensure that the sealing and barrier properties of pre-prepared meal packaging meet the specified standards, thereby effectively preventing food from being contaminated and deteriorating during storage and transportation.

[0003] In the existing technology, due to the subjectivity and inconsistency of manual screening, and with the expansion of production scale and the increase of speed, the low efficiency and high cost of manual screening have become constraints, making it difficult to meet the needs of efficient, accurate and stable vacuum packaging quality testing. Therefore, developing a technical method that can automatically, standardize and accurately detect the quality of vacuum packaging has become a technical problem that needs to be solved urgently. 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 pre-prepared dishes. The technical solutions adopted are as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for detecting the quality of vacuum packaging of pre-prepared dishes, the method comprising the following steps:

[0006] Collecting grayscale images of the packaging surfaces of vacuum packages of various pre-prepared dishes;

[0007] The overall fuzziness of the grayscale image of each packaging surface is obtained based on the discrete degree of the grayscale value of the pixel points in the grayscale image of the packaging surface and the discrete degree of the drastic change of the grayscale value;

[0008] 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;

[0009] 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;

[0010] Based on the aspect ratio of the circumscribed rectangle of the candidate wrinkle region, the position of the candidate wrinkle region in the connected domain and the distance from 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;

[0011] Based on the average of possible wrinkle coefficients, the wrinkle connected domain of the grayscale image of each package surface is obtained;

[0012] Based on the number of pixels in the wrinkle connected domain and the average of the wrinkle possible coefficient, the comprehensive wrinkle score of the grayscale image of each package surface is obtained;

[0013] Based on the comprehensive fuzzy value and comprehensive wrinkle score, the packaging eligibility of the grayscale image of each packaging surface is obtained;

[0014] The quality of vacuum packaging of pre-prepared dishes is tested based on packaging conformity.

[0015] Furthermore, the method for obtaining the overall ambiguity is:

[0016] Calculate the Laplace value of each pixel in the grayscale image of each package surface;

[0017] 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.

[0018] Further, the method for obtaining the comprehensive fuzzy value is:

[0019] 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;

[0020] 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.

[0021] Furthermore, the method for obtaining the candidate wrinkle area is:

[0022] 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;

[0023] 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.

[0024] Furthermore, 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.

[0025] Furthermore, the method for obtaining the fold connected domain is:

[0026] 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.

[0027] Furthermore, the method for obtaining the comprehensive wrinkle score includes:

[0028] 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.

[0029] Furthermore, the packaging qualification is the ratio of the comprehensive wrinkle score to the comprehensive fuzzy value.

[0030] Further, the vacuum packaging quality of the prepared dishes is tested based on the packaging eligibility, including:

[0031] The packaging eligibility of the packaging surface grayscale images of all pre-prepared food vacuum packages is normalized, and the pre-prepared food vacuum packages with packaging eligibility greater than a preset eligibility threshold are regarded as qualified packages.

[0032] In a second aspect, an embodiment of the present application further provides a system for inspecting 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, wherein the processor implements the steps of any one of the above-mentioned methods when executing the computer program.

[0033] This application has at least the following beneficial effects:

[0034] According to the fact that when vacuum packaging leaks, the bag will swell due to gas accumulation, the outline of the food will become blurred, and qualified vacuum packaging will have wrinkles, the comprehensive fuzziness value and comprehensive wrinkle score of the sample to be tested are analyzed. Using advanced image processing algorithms, the overall blur degree of the sample is carefully analyzed to effectively identify the image blur phenomenon caused by quality problems; by screening the pixels in the image and performing cluster analysis, the candidate wrinkle connected domain is identified. This step not only improves the accuracy of wrinkle detection, but also makes the detection process more intelligent and automated. Each candidate wrinkle area is deeply analyzed to determine its wrinkle possibility, and the comprehensive wrinkle score is obtained accordingly. Combined with the results of the comprehensive fuzziness value and the comprehensive wrinkle score, the qualification of the sample packaging to be tested is comprehensively judged, which improves the accuracy of the vacuum packaging quality inspection of pre-prepared dishes. 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 drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 A flowchart of a method for detecting the quality of vacuum packaging of pre-prepared dishes provided in one embodiment of the present application;

[0037] Figure 2 A flowchart for obtaining packaging eligibility is provided for one embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of the method and system for detecting the quality of vacuum packaging of pre-prepared dishes proposed in the present application, its specific implementation method, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0039] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0040] The specific scheme of the method and system for detecting the quality of vacuum packaging of pre-prepared dishes provided by the present application is described in detail below with reference to the accompanying drawings.

[0041] See also Figure 1 , which shows a flowchart of a method for detecting the quality of vacuum packaging of pre-prepared dishes provided by an embodiment of the present application, the method comprising the following steps:

[0042] Step S1, collecting grayscale images of the packaging surfaces of the vacuum packages of each pre-prepared dish.

[0043] On the vacuum packaging production line, each vacuum package moves continuously along the efficiently operating conveyor belt. In order to achieve quality inspection of the vacuum packaging bags of pre-prepared meals, this application uses transparent vacuum packaging bags for inspection. An industrial camera is installed directly above the conveyor belt to collect the packaging surface image of each vacuum packaging of pre-prepared meals to be inspected on the conveyor belt.

[0044] The packaging surface image requires high definition to obtain the subtle features to be detected in the vacuum packaging bags of pre-prepared dishes. In order to eliminate the influence of noise, this application denoises the packaging surface images of each vacuum packaging of pre-prepared dishes. This application uses Gaussian filtering to combine the packaging surface images of each vacuum packaging of pre-prepared dishes with coarse grains. The implementer can choose other denoising methods according to actual conditions.

[0045] The denoised packaging surface images of the vacuum packages of each pre-prepared dish are grayscaled to obtain grayscale images of the packaging surface of the vacuum packages of each pre-prepared dish.

[0046] Step S2, based on the discrete degree of the grayscale values ​​of the pixels in the grayscale image of the packaging surface and the discrete degree of the drastic change of the grayscale values, the overall blurriness of each packaging surface grayscale image is obtained; based on the discrete degree of the grayscale values ​​in the neighborhood of the pixel in the grayscale image of the packaging surface, the size of the gradient amplitude of the pixel and the overall blurriness, the comprehensive blurriness value of each packaging surface grayscale image is obtained.

[0047] For each pre-prepared meal vacuum package, after the air in the packaging bag of a qualified pre-prepared meal vacuum package is extracted, its internal pressure will be significantly reduced, while the external atmospheric pressure remains unchanged, which is manifested as the outer packaging film remaining tight and shrinking to fit tightly against the surface of the food, forming a unique visual feature. When the sample to be tested leaks, air will enter the package, causing the packaging bag to bulge, which is in sharp contrast to the tight fit of the qualified vacuum package.

[0048] Due to the extraction of gas in the package, the food in the package should be very clear in the captured image, and the color, texture and other characteristics of the food can be truly and vividly displayed in the image; while for leaking packaging, the inner wall of the packaging film will be tightly attached to the surface of the food during the vacuum extraction process. When leakage occurs, as the external air slowly penetrates into the package through the leak, the packaging film that was originally tightly attached to the surface of the food will gradually separate from the food due to the gradual increase in internal air pressure. The food will leave marks on the inner wall of the packaging film, thereby blurring the transparent packaging film. These phenomena are manifested in the image as the weakening of key visual features such as color and texture of the food, especially in the area where gas gathers. Due to the scattering and reflection of light, the grayscale value of the area may change, making the image blurred and unclear.

[0049] Furthermore, in order to reflect the grayscale change degree between each pixel point in the grayscale image of the packaging surface and the surrounding neighborhood, the Laplace operator is used to calculate the Laplace value of each pixel point in the grayscale image of the packaging surface. The Laplace operator is a well-known technology and will not be described in detail in this embodiment.

[0050] Furthermore, in order to reflect the blur degree of the grayscale image of the packaging surface of each pre-prepared dish vacuum package, the overall blur degree of the grayscale image of each packaging surface is obtained based on the discrete degree of the grayscale value of the pixel points in the grayscale image of the packaging surface and the discrete degree of the drastic change of the grayscale value. The calculation formula is: H = exp[-σ g ×σ Laplace ]; where H represents the overall fuzziness of the grayscale image of each package surface; σ g Represents the variance of the grayscale values ​​of all pixels in the grayscale image of each package surface, σ Laplace It represents the variance of the Laplace values ​​of all pixels in the grayscale image of each package surface, and exp represents an exponential function with the natural constant e as the base.

[0051] It should be noted that the smaller the grayscale variance of the pixels in the sample area to be detected, the more uniform the grayscale between the pixels, that is, the higher the degree of blur. The Laplace operator is an edge detection operator. After the image is Laplace transformed, the clarity of the grayscale image on the packaging surface is proportional to the variance of the Laplace values ​​of the pixels. The smaller the variance, the blurrier the image. At this time, the greater the overall blurriness obtained; conversely, the smaller the overall blurriness obtained.

[0052] Furthermore, the vacuum packaging of pre-prepared dishes may contain multiple ingredients or the sample to be tested itself has its own texture characteristics. Therefore, the grayscale image of each packaging surface is segmented through an image segmentation algorithm to obtain all connected domains in the grayscale image of the packaging surface. Among them, the image segmentation algorithm includes a region growing algorithm, a graph cut algorithm, etc. This embodiment uses a graph cut algorithm for processing. The implementer can select other algorithms according to actual conditions. The graph cut algorithm is a well-known technology and will not be described in detail in this embodiment.

[0053] In each connected domain, when the vacuum packaging is qualified, each connected domain should be clearly displayed, so the detailed texture features of the food are reflected in the grayscale image of the packaging surface.

[0054] Furthermore, in order to reflect the blur degree of the vacuum packaging surface of the pre-prepared food, the gradient amplitude of each pixel in the grayscale image of each packaging surface is calculated, and based on the discrete degree of the grayscale value in the neighborhood of the pixel in the grayscale image of the packaging surface, the size of the gradient amplitude of the pixel and the overall blur, the comprehensive blur value of the grayscale image of each packaging surface is calculated. The calculation formula 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.

[0055] It should be noted that when the gray value variance in the 8-neighborhood of the pixel point in the connected domain is smaller and the gradient amplitude of the pixel point is smaller, it means that in the connected domain, the texture features of the corresponding sample to be tested are less obvious, that is, it is more consistent with the blur characteristics caused by vacuum packaging leakage; and when the overall blur of the sample to be tested is higher, its comprehensive blur value is also higher; conversely, the comprehensive blur value is smaller.

[0056] Step S3, based on the clustering result of the pixel points in the grayscale image of the packaging surface, obtain the candidate wrinkle area of ​​each connected domain in the grayscale image of each packaging surface; based on the aspect ratio of the circumscribed rectangle of the candidate wrinkle area, the position of the candidate wrinkle area in the connected domain and the distance from the edge of the connected domain, obtain the wrinkle possibility coefficient of each candidate wrinkle area in each connected domain in the grayscale image of each packaging surface; based on the average of the wrinkle possibility coefficients, obtain the wrinkle connected domain of each packaging surface grayscale image; based on the number of pixels in the wrinkle connected domain and the average of the wrinkle possibility coefficients, obtain the comprehensive wrinkle score of each packaging surface grayscale image; based on the comprehensive fuzzy value and the comprehensive wrinkle score, obtain the packaging qualification of each packaging surface grayscale image.

[0057] For vacuum packaging of various pre-prepared dishes, qualified vacuum packaging has the packaging film tightly attached to the food surface due to the extraction of air, and the food has irregular shapes, such as edges and corners, curved surfaces, etc., which will cause wrinkles in the packaging film at these locations during the shrinkage process, and the tiny gaps between the packaging film and the food surface will also form wrinkles under light. These wrinkles will visually appear as transparent white, and wrinkles usually occur at the edges of the connected domain. However, due to the accumulation of gas inside the packaging, leaky packaging may cause the packaging surface to be uneven, bulging or deformed, which is in sharp contrast to the wrinkles formed by the tight fit of qualified vacuum packaging.

[0058] According to the above analysis, for each connected domain in the grayscale image of each packaging surface, the Otsu threshold segmentation algorithm is used to obtain the optimal segmentation threshold of the connected domain, wherein the Otsu threshold segmentation algorithm is a well-known technology and will not be repeated in this embodiment; all pixels in the connected domain whose grayscale values ​​are greater than the optimal segmentation threshold are taken as candidate bright spots.

[0059] Furthermore, for each connected domain in the grayscale image of each packaging surface, a clustering algorithm is used to cluster all candidate bright spots in the connected domain to obtain each cluster cluster; wherein, the clustering algorithm includes a k-means clustering algorithm, a DBSCAN clustering algorithm, and a hierarchical clustering algorithm, etc. This embodiment uses the DBSCAN clustering algorithm for clustering, and the implementer can select other clustering methods according to actual conditions; the clustering algorithm is a well-known technology and will not be described in detail in this embodiment; the area composed of the candidate bright spots of each cluster cluster in the connected domain is used as each candidate wrinkle area.

[0060] Furthermore, for the candidate wrinkle regions in each connected domain, since wrinkles usually occur in places with corners or gaps, they are more likely to be near the edge of the connected domain. Edge detection is performed on each connected domain. When the candidate wrinkle region is around the edge of its connected domain, the candidate wrinkle region is more likely to be a wrinkle, and wrinkles are usually slender. Based on the above analysis, the wrinkle possibility coefficient of each candidate wrinkle region in each connected domain in the grayscale image of each packaging surface is calculated, and the calculation formula 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.

[0061] It should be noted that the aspect ratio s of the circumscribed rectangle of the xth candidate wrinkle region is x The larger the value, the more its shape conforms to the slender characteristics of the fold; d x It represents the minimum value of the distance between the central pixel point of the x-th candidate wrinkle area in each connected domain in the grayscale image of each packaging surface and the edge pixel point of its connected domain. The smaller the value, the higher the wrinkle coefficient of the candidate wrinkle area is near the edge. +1 is to avoid the situation where the shortest distance is zero when the wrinkle overlaps with the edge, resulting in the denominator being zero.

[0062] The wrinkle connected domain is selected according to the wrinkle possibility coefficient. The acquisition method is as follows: for each connected domain in the grayscale image of each packaging surface, the average 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 taken as the wrinkle connected domain. In this embodiment, the preset judgment threshold is 0.6, and the implementer can select other values ​​according to actual conditions.

[0063] According to the possible mean values ​​of wrinkles in the candidate wrinkle areas in all connected domains of the grayscale images of each package surface, the comprehensive wrinkle score of each package surface grayscale image is determined: Where N is the comprehensive wrinkle score of the grayscale image of each package surface; n1 represents the number of all wrinkle connected domains in the grayscale image of each package surface; g y represents the number of pixels in the connected domain of the yth wrinkle in the grayscale image of each packaging surface; Z y Represents the possible mean value of the wrinkles in the yth wrinkle connected domain in the grayscale image of each package surface.

[0064] It should be noted that, when the number of connected wrinkle domains in the grayscale image of the packaging surface of the sample to be tested is greater and the smaller the area, the higher the wrinkle possibility coefficient is, and the packaging of the sample to be tested is more in line with the wrinkle performance of qualified vacuum packaging, the higher its comprehensive wrinkle score is; otherwise, the lower its comprehensive wrinkle score is.

[0065] Furthermore, a qualified vacuum packaging image should meet the following requirements: the clearer the content, the smaller the comprehensive fuzziness value, and the more wrinkles a qualified vacuum packaging has, the smaller the area, the higher the comprehensive evaluation, and the qualified vacuum packaging meets the requirements. Therefore, according to the comprehensive fuzziness value and comprehensive wrinkle score obtained in the above steps, the packaging qualification of each packaging surface grayscale image is calculated, and the calculation formula is: W = M N; 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 fuzzy value of each packaging surface grayscale image. Figure 2 shown.

[0066] It should be noted that when the comprehensive fuzzy value is smaller and the comprehensive wrinkle score is larger, the surface of the packaging is clearer, the wrinkles are more obvious, the packaging is more complete, and the packaging qualification of the grayscale image of the packaging surface is higher; otherwise, the packaging qualification is lower.

[0067] Step S4, testing the vacuum packaging quality of the prepared dishes based on packaging eligibility.

[0068] The packaging eligibility of the grayscale images of the packaging surfaces of all vacuum-packed pre-prepared dishes is normalized, and the vacuum-packed pre-prepared dishes with packaging eligibility greater than a preset qualified threshold are regarded as qualified packages. In this embodiment, the preset qualified threshold is 0.9, and the implementer may select other values ​​according to actual conditions. The quality of the vacuum-packed pre-prepared dishes is intelligently tested to ensure that qualified products flow into the market.

[0069] Based on the same inventive concept as the above method, an embodiment of the present application also provides a system for detecting the quality of vacuum packaging of pre-prepared dishes, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the steps of any one of the above-mentioned methods for detecting the quality of vacuum packaging of pre-prepared dishes are implemented.

[0070] It should be noted that the above sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above is a description of a specific embodiment of this specification. In addition, the processes depicted in the accompanying 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] The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

[0072] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application should be included in 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 the grayscale image of each packaging surface is obtained based on the discrete degree of the grayscale value of the pixel points in the grayscale image of the packaging surface and the discrete degree of the drastic change of the grayscale value; 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, the position of the candidate wrinkle region in the connected domain and the distance from 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; Based on the number of pixels in the wrinkle connected domain and the average of the wrinkle possible coefficient, the comprehensive wrinkle score of the grayscale image of each package surface is obtained; 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 comprises: 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 eligibility of the packaging surface grayscale images of all pre-prepared food vacuum packages is normalized, and the pre-prepared food vacuum packages with packaging eligibility greater than a preset eligibility threshold are regarded as qualified 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-9 are implemented.

Citation Information

Patent Citations

  • Inspection of vacuum packaged product for detection of gas inside package

    CN112789492A

  • 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

  • Food packaging bottle defect visual detection method and system

    CN118864468A

  • Inspection of vacuum packaged product for detection of gas inside package

    US20210310893A1

Cited By

  • Image or video identification method in pre-prepared dish degradation feature extraction

    CN121937993A

  • Image or video recognition methods for extracting deterioration features of pre-cooked food

    CN121937993B