A method and system for detecting airtightness of food packaging
Through image acquisition and processing and point cloud scanning, combined with the leakage fitting model, the problem of low accuracy and low efficiency in food packaging tightness detection is solved, the precise positioning and scale quantitative assessment of the leakage area are achieved, and the detection capability is enhanced.
Patent Information
- Application Number
- CN202411097503.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-12
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-08-12
AI Technical Summary
Food packaging tightness testing has problems of low accuracy and efficiency, and it is difficult to detect small leaks using traditional methods.
Image acquisition and processing are used to obtain basic and grayscale packaging images, and leakage points are identified based on the information. Point cloud scanning and fitting models are used to accurately locate the leakage area and quantitatively assess the scale.
It improves the accuracy and efficiency of food packaging tightness detection, can accurately locate and quantify leakage areas, and enhances the ability to detect small leaks.
Smart Images

Figure CN118628490B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing, and in particular to a method and system for detecting the airtightness of food packaging. Background Art
[0002] In the food industry, the airtightness of packaging is directly related to the safety and shelf life of food. Ensuring the integrity and airtightness of food packaging is crucial to preventing food from getting damp, oxidized, deteriorating, and being contaminated by bacteria. As consumers' requirements for food safety continue to increase, higher requirements are also being placed on the means of testing the airtightness of food packaging. Traditional testing methods, such as visual inspection and air pressure testing, can identify obvious leakage problems to a certain extent, but they often have limitations such as low detection efficiency, insufficient accuracy, and difficulty in detecting small leaks.
[0003] In the current related technologies, the airtightness detection of food packaging has technical problems of low detection accuracy and efficiency. Summary of the invention
[0004] The present application provides a method and system for detecting the airtightness of food packaging. The method and system respectively obtain basic packaging images and grayscale packaging images through image acquisition and processing, and identify them by combining the information of the two to improve the detection capability of leakage points. The packaging surface point cloud is scanned to perform three-dimensional reconstruction of the packaging surface. The leakage point cloud data is further purified by identifying and eliminating specific component point clouds. The surface leakage point cloud is fitted and analyzed by a leakage fitting model set. The precise positioning of the leakage area and the quantitative evaluation of the leakage scale are achieved, thereby achieving the technical effect of improving the accuracy and efficiency of food packaging airtightness detection.
[0005] The present application provides a method for detecting the airtightness of food packaging, comprising:
[0006] Capture images of food packaging to obtain basic packaging images, identify the basic packaging images to obtain basic image airtightness information; grayscale process the basic packaging images to obtain grayscale packaging images, identify the grayscale image airtightness information; determine the leakage area and image leakage scale based on the basic image airtightness information and the grayscale image airtightness information by fusion; set a leakage fitting model set based on the image leakage scale, scan the food packaging to obtain packaging surface point cloud, identify and eliminate specific component point clouds in the packaging surface point cloud to obtain surface leakage point cloud; fit the surface leakage point cloud using the leakage fitting model set to obtain airtightness detection results.
[0007] In a possible implementation, an image of the food packaging is captured to obtain a basic packaging image, the basic packaging image is recognized to obtain the basic image airtightness information, and the following processing is performed:
[0008] Capturing food packaging images to obtain basic packaging images; collecting a set of sample basic packaging images based on historical data of basic packaging image acquisition and airtightness recognition of food packaging, and annotating and obtaining a set of sample basic image airtightness information based on the regional location and scale of food leakage reflected by color features in each sample basic packaging image; training a basic packaging image recognizer using the sample basic packaging image set and the sample basic image airtightness information set; and recognizing the basic packaging images using the basic packaging image recognizer to obtain basic image airtightness information, wherein the basic image airtightness information includes a basic leakage location and a basic leakage scale.
[0009] In a possible implementation, the basic packaging image is gray-processed to obtain a gray-scale packaging image, and recognition is performed to obtain gray-scale image airtightness information, and the following processing is performed:
[0010] The basic packaging image is gray-processed to obtain a gray-scale packaging image; based on the historical data of gray-scale packaging image collection and airtightness recognition of food packaging, a set of sample gray-scale packaging images is collected, and according to the regional location and scale of food leakage reflected by the reflective characteristics on the surface of each sample gray-scale packaging image, a set of sample gray-scale image airtightness information is annotated to obtain the set; the set of sample gray-scale packaging images and the set of sample gray-scale image airtightness information are used to train a gray-scale packaging image recognizer; the gray-scale packaging image is recognized by the gray-scale packaging image recognizer to obtain gray-scale image airtightness information, wherein the gray-scale image airtightness information includes a gray-scale leakage location and a gray-scale leakage scale.
[0011] In a possible implementation, according to the basic image airtightness information and the grayscale image airtightness information, the leakage area and the image leakage scale are determined by fusion, and the following processing is performed:
[0012] The basic leakage position and the gray leakage position in the basic image airtightness information and the gray image airtightness information are fused to obtain the leakage area; the basic leakage scale and the gray leakage scale in the basic image airtightness information and the gray image airtightness information are fused to obtain the image leakage scale.
[0013] In a possible implementation, according to the image leakage scale, a leakage fitting model set is set, and the following processing is performed:
[0014] According to historical data of airtight leakage problems in food packaging, a set of sample image leakage scales is collected, and food leakage shapes under different sample image leakage scales are collected to obtain multiple sample leakage fitting model sets, wherein each sample leakage fitting model corresponds to an airtight leakage scale; the sample image leakage scale set and multiple sample leakage fitting model sets are used to construct a fitting model database; the image leakage scale is input into the fitting model database for indexing to obtain a leakage fitting model set.
[0015] In a possible implementation, the food package is scanned to obtain a package surface point cloud, a specific component point cloud in the package surface point cloud is identified and removed to obtain a surface leakage point cloud, and the following processing is performed:
[0016] The food packaging is scanned to obtain a packaging surface point cloud; based on the point cloud recognition history data of the food packaging, a sample packaging surface point cloud set is collected, and a sample specific component point cloud set of a specific component is collected; the sample packaging surface point cloud set and the sample specific component point cloud set are used to train a specific component point cloud identifier; the specific component point cloud identifier is used to identify the packaging surface point cloud to obtain a specific component point cloud; the specific component point cloud is deleted from the packaging surface point cloud, and the deleted area is supplemented with a tiled point cloud to obtain a surface leakage point cloud.
[0017] In a possible implementation, the leakage fitting model set is used to fit the surface leakage point cloud to obtain a tightness detection result, and the following processing is performed:
[0018] Using the first leakage fitting model in the leakage fitting model set, perform multiple random fittings on the point cloud of the leakage area in the surface leakage point cloud, obtain the proportion of the leaked food point cloud falling into the first leakage fitting model as the fitting score, obtain multiple basic fitting scores, and screen the maximum value as the first fitting score; continue to use other leakage fitting models in the leakage fitting model set, perform multiple random fittings on the leakage area in the surface leakage point cloud, and obtain multiple fitting scores; output the leakage fitting model corresponding to the largest fitting score among the multiple fitting scores as the matching leakage fitting model; and use the airtightness leakage scale corresponding to the matching leakage fitting model as the airtightness detection result.
[0019] The present application also provides a food packaging airtightness detection system, comprising:
[0020] A basic image airtightness information acquisition module, the basic image airtightness information acquisition module is used to collect images of food packaging, obtain basic packaging images, identify the basic packaging images, and obtain basic image airtightness information; a grayscale image airtightness information acquisition module, the grayscale image airtightness information acquisition module is used to grayscale process the basic packaging images, obtain grayscale packaging images, and identify and obtain grayscale image airtightness information; an image leakage scale determination module, the image leakage scale determination module is used to fuse and determine the leakage area and image leakage scale according to the basic image airtightness information and the grayscale image airtightness information; a surface leakage point cloud acquisition module, the surface leakage point cloud acquisition module is used to set a leakage fitting model set according to the image leakage scale, scan the food packaging, obtain packaging surface point cloud, identify and eliminate specific component point clouds in the packaging surface point cloud, and obtain surface leakage point cloud; a sealing detection result acquisition module, the sealing detection result acquisition module is used to fit the surface leakage point cloud using the leakage fitting model set to obtain a sealing detection result.
[0021] The present application proposes a method and system for detecting the airtightness of food packaging. First, the image of the food packaging is captured to obtain a basic packaging image, the basic packaging image is identified to obtain the airtightness information of the basic image, and then the basic packaging image is gray-processed to obtain a gray-scale packaging image, which is identified to obtain the airtightness information of the gray-scale image. Then, based on the airtightness information of the basic image and the airtightness information of the gray-scale image, the leakage area and the image leakage scale are determined by fusion. Then, based on the image leakage scale, a leakage fitting model set is set, the food packaging is scanned to obtain a packaging surface point cloud, specific component point clouds in the packaging surface point cloud are identified and removed to obtain a surface leakage point cloud, and finally a leakage fitting model set is used to fit the surface leakage point cloud to obtain the airtightness detection result, thereby achieving the technical effect of improving the accuracy and efficiency of food packaging airtightness detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the accompanying drawings of the embodiment of the present invention will be briefly introduced below. A flow chart is used in the present application to illustrate the operations performed by the system according to the embodiment of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps can be processed in reverse order or simultaneously as needed. At the same time, other operations can also be added to these processes, or one or more operations can be removed from these processes.
[0023] Figure 1 A schematic flow chart of a method for detecting the airtightness of food packaging provided in an embodiment of the present application.
[0024] Figure 2 A schematic diagram of the structure of a food packaging airtightness detection system provided in an embodiment of the present application.
[0025] Explanation of reference numerals: 10. Basic image airtightness information acquisition module; 20. Grayscale image airtightness information acquisition module; 30. Image leakage scale determination module; 40. Surface leakage point cloud acquisition module; 50. Airtightness detection result acquisition module. DETAILED DESCRIPTION
[0026] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below.
[0027] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0028] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict, and the terms "first\second" involved are merely to distinguish similar objects and do not represent a specific ordering of objects. The terms "including" and "having" and any variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or modules that are not clearly listed or inherent to these processes, methods, products, or devices. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of this application. The terms used herein are for the purpose of describing the embodiments of the present application only.
[0029] The present application provides a method for detecting the airtightness of food packaging. Figure 1 As shown, the method includes:
[0030] Step S100, capture images of food packaging to obtain basic packaging images, identify the basic packaging images, and obtain basic image airtightness information. Specifically, use a high-resolution camera or image acquisition device to shoot food packaging (such as hot pot base packaging) from multiple angles and in all directions, ensure that the shooting environment is well-lit and uniform, and avoid the effects of shadows and reflections on image quality. When shooting, pay special attention to key parts of the packaging, such as seals, seams, corners, etc., which are high-risk areas for leakage. Preprocess the captured basic packaging images, including cropping, resizing, denoising, and other operations to improve image quality. For example, if there are obvious color changes in the image (such as color pollution caused by hot pot base overflow), color enhancement technology can be used to highlight these changes so that they are more easily captured by the recognition algorithm.
[0031] Apply image recognition algorithms (such as machine learning, deep learning, etc.) to analyze the preprocessed images. The image recognition algorithms can identify various features on food packaging, including cracks, deformations, stains, etc., and can also analyze the shape, size, color depth, etc. of the leakage area. The recognition results are organized into basic image airtightness information, which is preliminary information about the airtightness of the package extracted from the basic packaging image, including the leakage location (such as the specific part of the package), the leakage scale (such as the leakage area, the degree of leakage, etc.) and the possible causes of the leakage (such as packaging damage, poor sealing, etc.).
[0032] In a possible implementation, the image of the food packaging is captured to obtain a basic packaging image, the basic packaging image is identified to obtain the airtightness information of the basic image, and step S100 further includes step S110, capturing the image of the food packaging to obtain the basic packaging image. Specifically, the basic packaging image is an original image of the food packaging directly obtained by the image acquisition device without any processing. Step S120, based on the historical data of the acquisition and airtightness identification of the basic packaging image of the food packaging, a set of sample basic packaging images is collected, and the airtightness information set of the sample basic images is annotated and obtained according to the regional location and scale of the food leakage reflected by the color characteristics in each sample basic packaging image. Specifically, the historical data of successful food packaging image acquisition and airtightness identification in the past are sorted out, and representative sample basic packaging images are selected from the historical data. These sample basic packaging images cover different types of leakage situations (such as slight leakage, serious leakage, no leakage, etc.). Professionals annotate the selected sample basic packaging images, determine the location and scale of the leakage area according to the color features (such as stains, color changes, etc.) in the image, and record the corresponding airtightness information, and organize the sample basic packaging images and the corresponding annotated airtightness information into a sample basic packaging image set and a sample basic image airtightness information set for subsequent training. Step S130, using the sample basic packaging image set and the sample basic image airtightness information set to train the basic packaging image recognizer. Specifically, an image recognition algorithm (such as a deep learning algorithm, a machine learning algorithm, etc.) is used to build a model framework of the basic packaging image recognizer, and the sample basic packaging image set and the sample basic image airtightness information set are input into the model as training data, and the model is trained by an iterative optimization algorithm (such as a gradient descent method) so that it can learn and recognize the leakage features in the image, and the performance of the trained model is evaluated using a validation set to ensure that it meets the requirements of recognition accuracy and generalization ability. After training, a model or algorithm that can recognize leakage features in food packaging images is obtained, that is, the basic packaging image recognizer. Step S140, using the basic packaging image recognizer, recognize the basic packaging image to obtain basic image airtightness information, which includes basic leakage position and basic leakage scale. Specifically, the basic packaging image to be detected is input into the trained basic packaging image recognizer, and the basic packaging image recognizer automatically extracts leakage-related features (such as color change, shape abnormality, etc.) from the input image. Based on the extracted features and the knowledge learned during the training process, the basic packaging image recognizer judges the leakage in the image and outputs the recognition results (including basic leakage position and basic leakage scale) in a visual form (such as annotated diagram, report, etc.). Among them, the basic leakage position refers to the specific location where the leakage occurs in the food packaging; the basic leakage scale refers to the leakage range or degree evaluated based on the image features.This implementation method combines historical data and machine learning technology to achieve efficient and accurate identification of the airtightness of food packaging.
[0033] Step S200, grayscale processing is performed on the basic packaging image to obtain a grayscale packaging image, and recognition is performed to obtain the grayscale image airtightness information. Specifically, the obtained basic packaging image is read, and a grayscale conversion algorithm is applied to convert the color image into a grayscale image, that is, the color value (red, green, blue) of each pixel in the color image is converted into a single grayscale value. The grayscale value represents the brightness of the pixel. The higher the grayscale value, the brighter the pixel; the lower the grayscale value, the darker the pixel. The conversion method can be an average method (taking the average value of red, green, and blue) or a weighted average method (giving different weights according to the sensitivity of the human eye to different colors). The converted image is a grayscale packaging image, which removes the color information in the original basic packaging image and only retains the brightness information.
[0034] Apply image recognition algorithms (such as edge detection, threshold segmentation, etc.) to analyze grayscale packaging images and detect areas with abnormal brightness or texture. For example, when hot pot soup base overflows, reflective features (features formed by light reflected from the surface of an object) will change. In grayscale images, these reflective areas will appear as areas with abnormal brightness (such as too bright or too dark). Based on the grayscale image analysis results, extract information about the leak location and leak scale. The leak location refers to the specific location of the brightness abnormality area in the grayscale image, and the leak scale describes the size and shape of these areas.
[0035] Among them, the basic packaging image contains the original color information of the food packaging. Different colors represent different states or characteristics of the packaging material. By identifying the color information in the basic packaging image, it is used to preliminarily determine whether the packaging maintains its original integrity and state. The grayscale packaging image converts the basic packaging image into a grayscale image, focusing on the brightness and contrast changes of the image, and is used to more accurately identify tiny defects, cracks or leaks on the packaging surface, which may be difficult to detect in color images due to color interference. For example, the color feature of the hot pot base leakage is red, and the background part of the food packaging is also red, which makes it difficult to accurately detect the leakage. However, the reflective characteristics of the hot pot base leakage are different from those of the food packaging. This problem can be solved by analyzing the brightness difference formed by the reflective characteristics in the grayscale image. For example, the brightness of the food packaging is high. By combining the basic image airtightness information and the grayscale image airtightness information, information complementation and enhancement can be achieved. The basic packaging image provides the overall color status of the packaging and a preliminary visual inspection, while the grayscale packaging image provides finer local details and more accurate defect identification. By combining these two types of information, the airtightness of the packaging can be more comprehensively evaluated, reducing the possibility of misjudgment and missed detection.
[0036] In a possible implementation, grayscale processing is performed on the basic packaging image to obtain a grayscale packaging image, and recognition is performed to obtain grayscale image airtightness information. Step S200 further includes step S210, grayscale processing is performed on the basic packaging image to obtain a grayscale packaging image. Specifically, the basic packaging image is read from a storage medium (such as a hard disk, cloud storage, etc.), and a grayscale conversion function in an image processing library (such as OpenCV, PIL, etc.) is applied to convert the color value (RGB) of each pixel of the basic packaging image into a grayscale value (an integer of 0-255). During the conversion process, different grayscale conversion methods can be selected, such as an average method, a weighted average method (for example, weights are R: 0.299, G: 0.587, B: 0.114), etc. After the conversion is completed, a grayscale packaging image is obtained. Step S220, based on the historical data of the collection and airtightness identification of grayscale packaging images of food packaging, a set of sample grayscale packaging images is collected, and the area position and scale of food leakage reflected by the reflective characteristics on the surface of each sample grayscale packaging image are annotated to obtain the airtightness information set of the sample grayscale images. Specifically, the historical data of successful collection and airtightness identification of grayscale packaging images in the past are sorted out, and representative sample grayscale packaging images are selected from the historical data. These sample grayscale packaging images cover different types of leakage situations (such as slight leakage, serious leakage, no leakage, etc.). Professionals annotate the selected sample grayscale packaging images, determine the area position and scale of the leakage according to the reflective characteristics in the image (such as brightness changes, abnormal shapes, etc.), and record the corresponding airtightness information. The annotation work can be completed using image processing software (such as Photoshop, GIMP, etc.) or special annotation tools. The sample grayscale packaging images and their corresponding annotated airtightness information are sorted into sets, namely, a set of sample grayscale packaging images and a set of sample grayscale image airtightness information.
[0037] Step S230, using the sample grayscale packaged image set and the sample grayscale image airtightness information set to train a grayscale packaged image recognizer. Specifically, a machine learning or deep learning algorithm is used to build a model framework of the grayscale packaged image recognizer, including defining an input layer, a hidden layer, and an output layer. The sample grayscale packaged image set and the sample grayscale image airtightness information set are input into the model as training data, and the model is trained by an iterative optimization algorithm (such as a gradient descent method, a back propagation algorithm, etc.) so that it can learn and recognize leakage features in grayscale images. The trained model is evaluated for performance using a validation set, including indicators such as accuracy, recall rate, and F1 score, to ensure that the model meets the recognition requirements. After the training is completed, a model or algorithm that can recognize leakage features in grayscale packaged images is obtained, namely, the grayscale packaged image recognizer. Step S240, using the grayscale packaged image recognizer, the grayscale packaged image is recognized to obtain grayscale image airtightness information, wherein the grayscale image airtightness information includes grayscale leakage position and grayscale leakage scale. Specifically, the grayscale packaging image to be detected is input into the trained grayscale packaging image recognizer, and the grayscale packaging image recognizer automatically extracts leakage-related features (such as brightness changes, shape anomalies, etc.) from the input image. Based on the extracted features and the knowledge learned during the training process, the grayscale packaging image recognizer judges the leakage in the image and outputs the recognition results (including grayscale leakage position and grayscale leakage scale) in a visual form (such as annotated diagrams, reports, etc.). Among them, the grayscale leakage position refers to the specific location of the leakage area identified in the grayscale packaging image; the grayscale leakage scale is a quantitative description of the size and shape of the leakage area in the grayscale packaging image, reflecting the severity of the leakage. This implementation method uses historical data to construct a sample set and a corresponding tightness information set. The historical data contains various possible leakage situations and complex image features. Through annotation and organization, it provides rich training materials for the grayscale packaging image recognizer, achieving the technical effect of improving the accuracy and efficiency of grayscale packaging image tightness information detection.
[0038] Step S300, based on the basic image airtightness information and the grayscale image airtightness information, the leakage area and the image leakage scale are determined by fusion. Specifically, the obtained basic image airtightness information and grayscale image airtightness information are integrated. The two types of image airtightness information contain descriptions of the leakage area from different angles or levels. For example, the basic packaging image focuses on features such as color and texture, and the grayscale packaging image focuses more on features such as brightness and reflection. The potential leakage areas identified in the two types of image airtightness information are compared. Since the basic packaging image and the grayscale packaging image reveal clues of leakage from different angles, these clues need to be compared and integrated to confirm which areas are the real leakage areas. During the comparison process, it will be found that some areas are not obvious in the basic packaging image, but become clear in the grayscale packaging image due to reflection or brightness changes; vice versa. Therefore, it is necessary to determine the final leakage area by comprehensively analyzing these differences.
[0039] For the areas that are identified as potential leaks in both image tightness information, regional fusion processing is performed to merge and correct the boundaries of these areas to form a complete leakage area. Based on the fused leakage area, image processing software or algorithms are used to calculate the geometric parameters such as the area and perimeter of the leakage area, and the severity and scope of the leakage are evaluated based on these parameters to estimate the image leakage scale. The leakage area and image leakage scale determined by fusion are output in a visual form (such as annotated diagrams, reports, etc.).
[0040] For example, in the tightness detection of hot pot soup base packaging, since hot pot soup base may overflow from the packaging due to various reasons (such as temperature changes, transportation vibrations, etc.), these overflows appear as color changes or stains in the basic packaging image, but are more obvious in the grayscale packaging image due to reflections or brightness changes. By fusing the information in the basic packaging image and the grayscale packaging image, the leakage area can be determined more accurately and the leakage scale can be estimated. For example, if a fuzzy stain area is found in the basic packaging image, and the area in the grayscale packaging image has a clear boundary and shape due to reflections, then it can be confirmed that this is a leakage area, and its scale can be estimated based on the information in the grayscale packaging image.
[0041] In a possible implementation, according to the basic image airtightness information and the grayscale image airtightness information, the leakage area and the image leakage scale are determined by fusion, and step S300 further includes step S310, fusing the basic leakage position and the grayscale leakage position in the basic image airtightness information and the grayscale image airtightness information to obtain the leakage area. Specifically, all points or areas marked as basic leakage positions are extracted from the basic image airtightness information; all points or areas marked as grayscale leakage positions are extracted from the grayscale image airtightness information. The basic leakage position and the grayscale leakage position are compared to find the corresponding relationship between the two. For positions that are obviously overlapping or close, they are considered to be different manifestations of the same leakage area and need to be fused. The successfully matched basic leakage position and grayscale leakage position are fused, and a continuous and complete leakage area is formed by merging, correcting and optimizing the position boundaries. Step S320, the basic leakage scale and the grayscale leakage scale in the basic image airtightness information and the grayscale image airtightness information are fused to obtain the image leakage scale. Specifically, all leakage-related scale parameters (such as area, perimeter, etc.) are extracted from the basic image airtightness information; corresponding scale parameters are also extracted from the grayscale image airtightness information. The basic leakage scale and the grayscale leakage scale are fused, and an accurate and comprehensive image leakage scale is obtained by weighted averaging, maximum value selection or other fusion strategies of the leakage scale parameters. This implementation method comprehensively and accurately determines the leakage area and evaluates the leakage scale by fusing the leakage location and scale information in the basic package image and the grayscale package image, achieving the technical effect of improving the accuracy and reliability of the fusion.
[0042] Step S400, according to the image leakage scale, set a leakage fitting model set, scan the food package, obtain the package surface point cloud, identify and remove the specific component point cloud in the package surface point cloud, and obtain the surface leakage point cloud. Specifically, according to the obtained image leakage scale (such as leakage area, shape, etc.), set a series of possible leakage fitting models. These leakage fitting models are based on the specific shapes that may be formed after the food leaks, such as tiled circles, ellipses or other irregular shapes, and different scales of leakage correspond to models of different sizes or parameters. For example, if the image leakage scale is displayed as a medium-sized circular area, a series of circular models with different radii can be set as fitting candidates. Therefore, the leakage fitting model set is a series of models preset according to the leakage scale and shape, which are used to fit and analyze the actual leakage point cloud.
[0043] Use a 3D scanner (such as a laser scanner, structured light scanner, etc.) to scan the food packaging and obtain the 3D point cloud data of the packaging surface. These 3D point cloud data contain detailed information such as the shape and bumps of the packaging surface. In the obtained packaging surface point cloud, identify and remove the point cloud data belonging to specific components in the food (such as peppers, spices, etc.). These specific components may protrude from the packaging surface due to their distribution in the packaging or residues during processing, forming point cloud data similar to leakage. Identification methods include color analysis (if the color of the specific component is significantly different from that of the main body of the food), texture analysis, shape matching, etc. The elimination process is to separate the identified specific component point cloud from the entire packaging surface point cloud. After eliminating the specific component point cloud, the flat point cloud data is supplemented in the eliminated area through interpolation, smoothing or based on the geometric model of the original packaging design to ensure the integrity and accuracy of the packaging surface point cloud. After the above processing, the surface leakage point cloud data obtained will contain the convex point cloud data formed by the leaked food. These point cloud data reflect the shape, size and position of the leakage area, providing a reliable basis for subsequent fitting analysis.
[0044] In a possible implementation, according to the image leakage scale, a leakage fitting model set is set, and step S400 further includes step S410, according to the historical data of the airtight leakage problem of food packaging, a sample image leakage scale set is collected, and the food leakage shape under different sample image leakage scales is collected to obtain multiple sample leakage fitting model sets, wherein each sample leakage fitting model corresponds to a closed leakage scale. Specifically, historical data of the airtight leakage problem of food packaging that occurred in the past are collected. These data come from production records, quality inspection reports, customer complaints, etc. From the collected historical data, images of food packaging with leakage are extracted, and the leakage scale in each image is measured or evaluated. Among them, the leakage scale can be measured by pixel area, actual area, shape characteristics of the leakage area, etc. For each sample image leakage scale, the specific shape of the leakage area is further collected by image processing technology (such as edge detection, shape recognition, etc.), and based on the shape of each leakage area, a corresponding leakage fitting model is constructed. The leakage fitting model can be a mathematical equation, a geometric figure (such as a circle, an ellipse, a polygon, etc.) or a parameterized model, etc., which is used to describe the characteristics of the leakage area. The leakage fitting models under different leakage scales of sample images are organized into multiple sample leakage fitting model sets, each set corresponding to a specific leakage scale range or category.
[0045] Step S420, using the sample image leakage scale set and multiple sample leakage fitting model sets to construct a fitting model database. Specifically, the fitting model database structure is designed, including table structure, field definition, index strategy, etc., to support efficient data storage and query. The sample image leakage scale set and multiple sample leakage fitting model sets are entered into the fitting model database, each leakage scale is associated with the corresponding leakage fitting model set, and an index is created for the key fields (such as leakage scale) in the fitting model database to improve query efficiency. Step S430, the image leakage scale is input into the fitting model database for indexing to obtain a leakage fitting model set. Specifically, the currently detected image leakage scale is input into the fitting model database as a query condition, and the index mechanism in the database is used to quickly locate the sample leakage fitting model set that matches the input leakage scale, and the queried leakage fitting model set is returned to the detection process for use in subsequent steps. This implementation method realizes the rapid indexing and acquisition of leakage fitting models by constructing a fitting model database using historical data, thereby achieving the technical effect of improving detection efficiency.
[0046] In a possible implementation, the food package is scanned to obtain a package surface point cloud, and a specific component point cloud in the package surface point cloud is identified and removed to obtain a surface leakage point cloud. Step S400 further includes step S440, scanning the food package to obtain a package surface point cloud. Specifically, a 3D scanner (such as a laser scanner, a structured light scanner, etc.) is used to comprehensively scan the food package, and the scanner emits light or a light beam to the package surface and captures the reflected data, and the captured data is converted into a three-dimensional coordinate point set, i.e., a package surface point cloud. Step S450, based on the point cloud recognition history data of the food package, a sample package surface point cloud set is collected, and a sample specific component point cloud set of a specific component is collected. Specifically, historical data is collected, and food package point cloud data containing different damage conditions are selected as samples, and the point cloud areas of specific components are manually or automatically marked from these samples, and the point clouds of these specific components are extracted to form a sample specific component point cloud set. At the same time, the complete package surface point cloud is retained as the sample package surface point cloud set. Step S460, using the sample packaging surface point cloud set and the sample specific component point cloud set to train a specific component point cloud identifier. Specifically, the sample packaging surface point cloud set and the sample specific component point cloud set are used to train a machine learning or deep learning model (such as a convolutional neural network CNN, a random forest, etc.), and the model parameters, such as the learning rate, the number of iterations, etc., are adjusted to optimize the recognition effect of the specific component point cloud identifier, and the model performance is evaluated by methods such as cross-validation to ensure that the recognition accuracy meets the requirements. Step S470, using the specific component point cloud identifier to identify the packaging surface point cloud to obtain a specific component point cloud. Specifically, the packaging surface point cloud to be processed is input into the trained specific component point cloud identifier, and the specific component point cloud identifier processes the packaging surface point cloud, outputs the point cloud area of the specific component, and saves the point cloud data of the specific component. Step S480, the specific component point cloud is deleted from the packaging surface point cloud, and the deleted area is tiled to supplement the point cloud to obtain a surface leakage point cloud. Specifically, all point cloud areas of specific components are removed from the original packaging surface point cloud, and the vacant areas after removal are filled. The point cloud data of adjacent areas can be used for interpolation or smoothing to generate a tiled point cloud. The processed point cloud data is merged to form a surface leakage point cloud that does not contain specific components. This implementation method realizes automatic identification and elimination of specific component point clouds by training specific component point cloud identifiers, reduces manual intervention, and achieves the technical effect of improving processing efficiency and accuracy.
[0047] Step S500, using the leakage fitting model set, fitting the surface leakage point cloud to obtain the airtightness test result. Specifically, based on the geometric shape, size, direction and other factors of the leakage area, select the model that best suits the shape and characteristics of the current leakage area from the leakage fitting model set, match and fit the selected leakage fitting model with the surface leakage point cloud, and adjust the parameters of the model (such as position, size, direction, etc.) so that the leakage fitting model can best cover and describe the point cloud data of the leakage area. By calculating statistical indicators such as fitting error and residual, the accuracy and reliability of the model fitting are evaluated to determine whether the leakage fitting model accurately reflects the actual situation of the leakage area. According to the results of model fitting, a tightness test report or a visual model is generated, and the report contains information such as the specific location, shape, size and other information of the leakage area, as well as the parameters and evaluation results of the leakage fitting model. Among them, the visual model can intuitively display the leakage area and the fitting effect through three-dimensional graphics. According to the airtightness test results, support is provided for subsequent decisions such as packaging quality control, maintenance or replacement. If the test results show that the packaging has serious airtightness problems, immediate measures need to be taken to repair or replace it to avoid food quality damage or safety accidents. The embodiment of the present application adopts image acquisition and processing to obtain basic packaging images and grayscale packaging images respectively, and combines the information of the two for identification, thereby improving the detection capability of leakage points, utilizing packaging surface point cloud scanning to perform three-dimensional reconstruction of the packaging surface, and further purifying the leakage point cloud data by identifying and eliminating specific component point clouds, and using a leakage fitting model set to perform fitting analysis on the surface leakage point cloud, and other technical means to achieve precise positioning of the leakage area and quantitative assessment of the leakage scale, thereby achieving the technical effect of improving the accuracy and efficiency of food packaging airtightness detection.
[0048] In a possible implementation, the surface leakage point cloud is fitted by using the leakage fitting model set to obtain the airtightness detection result, and step S500 further includes step S510, using the first leakage fitting model in the leakage fitting model set, performing multiple random fittings on the point cloud of the leakage area in the surface leakage point cloud, obtaining the proportion of the leaked food point cloud falling into the first leakage fitting model as the fitting score, obtaining multiple basic fitting scores, and screening the maximum value as the first fitting score. Specifically, any leakage fitting model is selected from the leakage fitting model set as the current model, and in the surface leakage point cloud, a point cloud subset of the leakage area is located, and multiple (for example, N times) random fitting attempts are performed on the leakage area point cloud. In each attempt, the initial position, direction or parameters of the first leakage fitting model are fine-tuned to simulate different fitting starting conditions. After each fitting, it is calculated how much proportion of the point cloud in the leaked food point cloud (i.e., the leakage area point cloud) falls within the boundary of the first leakage fitting model or meets a certain fitting accuracy standard. This proportion is the fitting score of this fitting, and the fitting score is used to quantify the matching degree between the first leakage fitting model and the leakage area point cloud. Record the score of each fitting, and select the maximum value as the first fitting score. Step S520, continue to use other leakage fitting models in the leakage fitting model set, perform multiple random fittings in the leakage area in the surface leakage point cloud, and obtain multiple fitting scores. Specifically, repeat the process of step S510, but this time use the next model in the leakage fitting model set as the current model, perform multiple random fittings for each leakage fitting model, and calculate the corresponding fitting scores, and record multiple fitting scores of each leakage fitting model for subsequent comparison. Step S530, output the leakage fitting model corresponding to the largest fitting score among the multiple fitting scores as the matching leakage fitting model. Specifically, compare the fitting scores of all leakage fitting models (including the scores obtained in steps S510 and S520), find the model with the highest fitting score, which is the matching leakage fitting model, and output the information of the matching leakage fitting model, including its shape, size and other parameters. Step S540, according to the airtightness leakage scale corresponding to the matching leakage fitting model, as the airtightness detection result. Specifically, according to the parameters and shape of the matching leak fitting model, the scale and possible causes of the leak are evaluated, and this information is integrated into the airtightness test results, including the specific location, shape, size, severity of the leak, and the impact on the package integrity and food safety. This implementation method improves the accuracy and robustness of the leak fitting through multiple random fittings and comparison of fitting scores, achieving the technical effect of providing a reliable basis for the airtightness test results.
[0049] In the above, refer to Figure 1A method for detecting the airtightness of food packaging according to an embodiment of the present invention is described in detail. Figure 2 A food package airtightness detection system according to an embodiment of the present invention is described.
[0050] A food packaging airtightness detection system according to an embodiment of the present invention is used to solve the technical problems of low detection accuracy and efficiency in the existing food packaging airtightness detection, and achieve the technical effect of improving the accuracy and efficiency of food packaging airtightness detection. A food packaging airtightness detection system includes: a basic image airtightness information acquisition module 10, a gray image airtightness information acquisition module 20, an image leakage scale determination module 30, a surface leakage point cloud acquisition module 40, and an airtightness detection result acquisition module 50.
[0051] The basic image airtightness information acquisition module 10 is used to capture images of food packaging, obtain basic packaging images, identify the basic packaging images, and obtain basic image airtightness information; the grayscale image airtightness information acquisition module 20 is used to grayscale process the basic packaging images, obtain grayscale packaging images, and identify the grayscale image airtightness information; the image leakage scale determination module 30 is used to fuse and determine the leakage area and image leakage scale based on the basic image airtightness information and the grayscale image airtightness information; the surface leakage point cloud acquisition module 40 is used to set a leakage fitting model set according to the image leakage scale, scan the food packaging, obtain the packaging surface point cloud, identify and eliminate the specific component point cloud in the packaging surface point cloud, and obtain the surface leakage point cloud; the airtightness detection result acquisition module 50 is used to use the leakage fitting model set to fit the surface leakage point cloud to obtain the airtightness detection result.
[0052] The specific configuration of the basic image airtightness information acquisition module 10 will be described in detail below. As described above, the image of the food packaging is captured to obtain the basic packaging image, the basic packaging image is recognized to obtain the basic image airtightness information, and the basic image airtightness information acquisition module 10 may further include: an image acquisition unit for capturing the image of the food packaging to obtain the basic packaging image; a basic sample set acquisition unit for collecting a sample basic packaging image set according to the acquisition and airtightness recognition history data of the basic packaging image of the food packaging, and annotating and obtaining the sample basic image airtightness information set according to the regional location and scale of the food leakage reflected by the color characteristics in each sample basic packaging image; a basic packaging image recognizer training unit for training the basic packaging image recognizer using the sample basic packaging image set and the sample basic image airtightness information set; a basic packaging image recognition unit for recognizing the basic packaging image using the basic packaging image recognizer to obtain the basic image airtightness information, and the basic image airtightness information includes the basic leakage location and the basic leakage scale.
[0053] The specific configuration of the grayscale image airtightness information acquisition module 20 will be described in detail below. As described above, the grayscale processing is performed on the basic packaging image to obtain the grayscale packaging image, and the grayscale image airtightness information is obtained by identification. The grayscale image airtightness information acquisition module 20 may further include: a grayscale processing unit for grayscale processing the basic packaging image to obtain the grayscale packaging image; a grayscale sample set acquisition unit for collecting a sample grayscale packaging image set according to the grayscale packaging image collection and airtightness identification history data of the food packaging, and annotating and obtaining the sample grayscale image airtightness information set according to the regional location and scale of food leakage reflected by the reflective characteristics of the surface of each sample grayscale packaging image; a grayscale packaging image recognizer training unit for training a grayscale packaging image recognizer using the sample grayscale packaging image set and the sample grayscale image airtightness information set; a grayscale packaging image recognition unit for identifying the grayscale packaging image using the grayscale packaging image recognizer to obtain the grayscale image airtightness information, wherein the grayscale image airtightness information includes the grayscale leakage location and the grayscale leakage scale.
[0054] The specific configuration of the image leakage scale determination module 30 will be described in detail below. As described above, according to the basic image tightness information and the grayscale image tightness information, the leakage area and the image leakage scale are determined by fusion, and the image leakage scale determination module 30 may further include: a leakage position fusion unit for fusing the basic leakage position and the grayscale leakage position in the basic image tightness information and the grayscale image tightness information to obtain the leakage area; a leakage scale fusion unit for fusing the basic leakage scale and the grayscale leakage scale in the basic image tightness information and the grayscale image tightness information to obtain the image leakage scale.
[0055] The specific configuration of the surface leakage point cloud acquisition module 40 will be described in detail below. As described above, according to the image leakage scale, a leakage fitting model set is set, and the surface leakage point cloud acquisition module 40 may further include: a leakage sample acquisition unit is used to collect a sample image leakage scale set based on historical data of airtight leakage problems in food packaging, and collect food leakage shapes under different sample image leakage scales to obtain multiple sample leakage fitting model sets, wherein each sample leakage fitting model corresponds to a closed leakage scale; a fitting model database construction unit is used to use the sample image leakage scale set and multiple sample leakage fitting model sets to construct a fitting model database; an indexing unit is used to input the image leakage scale into the fitting model database for indexing to obtain a leakage fitting model set.
[0056] Among them, the food packaging is scanned to obtain a packaging surface point cloud, and a specific component point cloud in the packaging surface point cloud is identified and removed to obtain a surface leakage point cloud. The surface leakage point cloud acquisition module 40 may further include: a scanning unit for scanning the food packaging to obtain a packaging surface point cloud; a point cloud sample acquisition unit for collecting a sample packaging surface point cloud set and a sample specific component point cloud set of a specific component according to the point cloud recognition history data of the food packaging; a specific component point cloud identifier training unit for training a specific component point cloud identifier using the sample packaging surface point cloud set and the sample specific component point cloud set; a point cloud recognition unit for identifying the packaging surface point cloud using the specific component point cloud identifier to obtain a specific component point cloud; a point cloud deletion unit for deleting the specific component point cloud from the packaging surface point cloud, and supplementing the deleted area with a tiled point cloud to obtain a surface leakage point cloud.
[0057] The specific configuration of the airtightness detection result acquisition module 50 will be described in detail below. As described above, the leak fitting model set is used to fit the surface leakage point cloud to obtain the airtightness detection result. The airtightness detection result acquisition module 50 may further include: a point cloud random fitting unit is used to use the first leak fitting model in the leak fitting model set, perform multiple random fittings on the point cloud of the leakage area in the surface leakage point cloud, obtain the proportion of the leaked food point cloud falling into the first leak fitting model as the fitting score, obtain multiple basic fitting scores, and screen the maximum value as the first fitting score, continue to use other leak fitting models in the leak fitting model set, perform multiple random fittings on the leakage area in the surface leakage point cloud, and obtain multiple fitting scores; the matching leak fitting model acquisition unit is used to output the leak fitting model corresponding to the largest fitting score among the multiple fitting scores as the matching leak fitting model; the airtightness detection result acquisition unit is used to use the airtightness leakage scale corresponding to the matching leak fitting model as the airtightness detection result.
[0058] A food packaging airtightness detection system provided by an embodiment of the present invention can execute a food packaging airtightness detection method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects of the execution method.
[0059] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, any number of different modules may be used and run on the user terminal and / or server, and the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0060] The above specific implementation manner does not constitute a limitation to the protection scope of the present application. It should be understood by those skilled in the art that various modifications, combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application. In some cases, the actions or steps recorded in the present application can be performed in an order different from that in the embodiment and can still achieve the desired results. In addition, the process depicted in the accompanying drawings does 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.
Claims
1. A method for detecting the airtightness of food packaging, characterized in that: The method comprises: Capturing images of food packaging to obtain a basic packaging image, and identifying the basic packaging image to obtain airtightness information of the basic image; Performing grayscale processing on the basic packaging image to obtain a grayscale packaging image, and performing recognition to obtain grayscale image airtightness information; According to the basic image airtightness information and the grayscale image airtightness information, a leakage area and an image leakage scale are determined by fusion; According to the image leakage scale, a leakage fitting model set is set, the food packaging is scanned to obtain a packaging surface point cloud, and specific component point clouds in the packaging surface point cloud are identified and removed to obtain a surface leakage point cloud; Using the leakage fitting model set, fitting the surface leakage point cloud to obtain a tightness detection result; The method of scanning the food package to obtain a package surface point cloud, identifying and removing a specific component point cloud in the package surface point cloud to obtain a surface leakage point cloud includes: Scanning the food packaging to obtain a point cloud of the packaging surface; According to the historical data of point cloud recognition of food packaging, a point cloud set of the sample packaging surface is collected, and a point cloud set of a sample specific component of a specific component is collected; Using the sample packaging surface point cloud set and the sample specific component point cloud set, training a specific component point cloud identifier; Using the specific component point cloud identifier, the packaging surface point cloud is identified to obtain a specific component point cloud; The specific component point cloud is deleted from the packaging surface point cloud, and the deleted area is supplemented with a tiled point cloud to obtain a surface leakage point cloud.
2. The method for detecting the airtightness of food packaging according to claim 1, characterized in that: Capturing food packaging images to obtain basic packaging images, and identifying the basic packaging images to obtain basic image airtightness information, including: Capture images of food packaging to obtain basic packaging images; According to the historical data of the collection and airtightness identification of basic packaging images of food packaging, a set of sample basic packaging images is collected, and according to the regional location and scale of food leakage reflected by the color characteristics in each sample basic packaging image, a set of airtightness information of the sample basic images is annotated and obtained; Using the sample basic packaging image set and the sample basic image airtightness information set to train a basic packaging image recognizer; The basic packaging image recognizer is used to recognize the basic packaging image to obtain basic image airtightness information, wherein the basic image airtightness information includes a basic leakage position and a basic leakage scale.
3. The method for detecting the airtightness of food packaging according to claim 1, characterized in that: Grayscale processing is performed on the basic packaging image to obtain a grayscale packaging image, and recognition is performed to obtain grayscale image airtightness information, including: Performing grayscale processing on the basic packaging image to obtain a grayscale packaging image; According to the historical data of grayscale packaging image collection and airtightness identification of food packaging, a set of sample grayscale packaging images is collected, and according to the reflective characteristics of the surface of each sample grayscale packaging image, the area location and scale of food leakage are reflected, and the airtightness information set of the sample grayscale images is annotated to obtain; Using the sample grayscale packaging image set and the sample grayscale image airtightness information set to train a grayscale packaging image recognizer; The grayscale packaging image identifier is used to identify the grayscale packaging image to obtain grayscale image sealing information, wherein the grayscale image sealing information includes a grayscale leakage position and a grayscale leakage scale.
4. The method for detecting the airtightness of food packaging according to claim 1, characterized in that: According to the basic image airtightness information and the grayscale image airtightness information, the leakage area and the image leakage scale are determined by fusion, including: Fusing the basic image airtightness information and the basic leakage position and the grayscale leakage position in the grayscale image airtightness information to obtain a leakage area; The basic image leakage scale and the grayscale leakage scale in the basic image sealing information and the grayscale image sealing information are fused to obtain the image leakage scale.
5. The method for detecting the airtightness of food packaging according to claim 1, characterized in that: According to the image leakage scale, a leakage fitting model set is set, including: According to the historical data of airtight leakage problems in food packaging, a set of sample image leakage scales is collected, and the food leakage shapes under different sample image leakage scales are collected to obtain a set of multiple sample leakage fitting models, wherein each sample leakage fitting model corresponds to a airtight leakage scale; Using the sample image leakage scale set and multiple sample leakage fitting model sets, constructing a fitting model database; The image leakage scale is input into the fitting model database for indexing to obtain a leakage fitting model set.
6. The method for detecting the airtightness of food packaging according to claim 1, characterized in that: The surface leakage point cloud is fitted using the leakage fitting model set to obtain a tightness test result, including: Using a first leakage fitting model in the leakage fitting model set, performing multiple random fittings on the point cloud of the leakage area in the surface leakage point cloud, obtaining a proportion of the leaked food point cloud falling into the first leakage fitting model as a fitting score, obtaining multiple basic fitting scores, and selecting the maximum value as a first fitting score; Continuing to use other leakage fitting models in the leakage fitting model set, performing multiple random fittings on the leakage area in the surface leakage point cloud to obtain multiple fitting scores; Outputting a leakage fitting model corresponding to a maximum fitting score among the multiple fitting scores as a matching leakage fitting model; The airtightness leakage scale corresponding to the matching leakage fitting model is used as the airtightness detection result.
7. A food packaging airtightness detection system, characterized in that: The system is used to implement a food packaging airtightness detection method according to any one of claims 1 to 6, and the system comprises: A basic image airtightness information acquisition module, which is used to collect images of food packaging, obtain basic packaging images, identify the basic packaging images, and obtain basic image airtightness information; A grayscale image airtightness information acquisition module, the grayscale image airtightness information acquisition module is used to perform grayscale processing on the basic packaging image to obtain a grayscale packaging image, and perform recognition to obtain grayscale image airtightness information; An image leakage scale determination module, the image leakage scale determination module is used to fuse and determine the leakage area and the image leakage scale according to the basic image airtightness information and the grayscale image airtightness information; A surface leakage point cloud acquisition module, the surface leakage point cloud acquisition module is used to set a leakage fitting model set according to the image leakage scale, scan the food packaging, obtain the packaging surface point cloud, identify and remove the specific component point cloud in the packaging surface point cloud, and obtain the surface leakage point cloud; The airtightness detection result acquisition module is used to adopt the leakage fitting model set to fit the surface leakage point cloud to obtain the airtightness detection result.
