A visual inspection method and system for food packaging air tightness
By applying pressure and video detection combined with neural network scoring, the problem of air tightness detection of puffed food packaging is solved, fast and accurate detection results are achieved, and labor and time costs are reduced.
Patent Information
- Application Number
- CN202410584863.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-13
AI Technical Summary
It is difficult to effectively detect the air tightness of puffed food packaging with existing technology, especially since puffed food is filled with inert gases and easily floats on the water. The traditional detection method of pressing into water is not applicable, and it is easy to contaminate the packaging, increasing labor and time costs.
By applying pressure to the puffed food packaging, detecting changes in feedback pressure and the degree of packaging deformation, and combining video detection and neural network scoring to determine whether the air tightness is qualified or unqualified, a visual inspection method and system for the air tightness of food packaging are provided. .
It achieves rapid and accurate detection of air tightness of puffed food packaging, avoids contamination and high cost problems in traditional methods, and improves detection efficiency and accuracy.
Smart Images

Figure CN118172359B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of air tightness detection, and in particular to a method and system for visually detecting air tightness of food packaging. Background Art
[0002] Food packaging is an integral part of food commodities. It protects food and prevents it from being damaged by biological, chemical, and physical external factors during the circulation process from the factory to the hands of consumers. It can also maintain the stable quality of the food itself, especially for food packaging such as puffed food. If puffed food is in contact with air for a long time, it is easy to get damp, resulting in a deterioration in taste and quality. Therefore, it needs to be sealed and stored, usually in plastic packaging bags, to avoid contact with air during packaging. In addition, to prevent the food from being squeezed and broken, inert gas is filled into the bag during packaging, and then it is sealed. If the seal is not tight, the bag will slowly leak, which will also cause the quality of the food to decline. Therefore, inflation and sealing testing is required after packaging.
[0003] At present, the air tightness detection of food packaging includes pressing the food packaging bag into water and observing whether uniform bubbles are generated in the water to judge the air tightness of the packaging bag. For example, an "air tightness detection device for filled food" disclosed in Chinese patent documents, with the announcement number CN110160711A, is provided. By setting an ultrasonic bubble detection sensor, the filled food is directly placed into the water storage bin, and whether bubbles are generated can be directly detected, thereby realizing the air tightness detection of the filled food; by setting a first servo electric cylinder, a slide, a first slide rail, a push plate and a first placement rack, the canned food is placed in the first placement rack, and then the first servo electric cylinder is adjusted to transport the first placement rack to the inside of the detection box for detection, which is convenient and fast; by setting a third servo electric cylinder and a detection rack, the third servo electric cylinder is adjusted to be extended and retracted, and the canned food can be immersed in the water storage bin for detection, which is convenient and fast; by setting a second servo electric cylinder, a second placement rack, a second slide rail and a second slide bar, the second placement rack and the first placement rack can be pushed out of the detection box and onto the support rack by adjusting the second servo electric cylinder, which is convenient and fast.
[0004] However, the method of detecting bubbles by pressing them into water is not suitable for puffed foods. First, puffed foods are filled with inert gases and tend to float on the water, making them difficult to press into water. In addition, pressing food packaging into water can easily contaminate the packaging, and the packaging needs to be dried after the air-tightness test, which increases the number of steps and increases manpower and time costs. Summary of the invention
[0005] The purpose of this application is to provide a method and system for visually inspecting the air tightness of food packaging. By applying pressure to the top of the puffed food package and then detecting the change in feedback pressure and the change in the degree of package deformation to judge the air tightness of the food package, this application can effectively solve the defects of the traditional method of pressing the puffed food package into water to inspect the air tightness, which has many processes and high labor costs.
[0006] The first aspect of the present application provides a method for visually inspecting the air tightness of food packaging, the method comprising the following steps:
[0007] Acquire a first detection image of a contact position between the food package to be detected and the pressing device, wherein the first detection image is used to determine a first pressure value between the contact position between the food package to be detected and the pressing device;
[0008] Determine whether the first pressure value is within a preset first pressure threshold range, and if not, adjust the pressing device to make the first pressure value within the preset pressure threshold range;
[0009] If yes, the pressing device is kept in the pressing state for a rated time, a second detection image of the contact position between the food package to be detected and the pressing device is obtained, and a second pressure value is fed back;
[0010] Compare whether the pressure difference between the second pressure value and the first pressure value is greater than the pressure change threshold; if not, perform video detection on the food package to be detected and output the detection result; if yes, extract and compare the deformation characteristic change amount in the first detection image and the second detection image;
[0011] If the change in the deformation feature is less than or equal to the change threshold, the food package to be inspected is subjected to video inspection and the inspection result is output; if the change in the deformation feature is greater than the change threshold, the curvature change value at the same position of the first detection image and the second detection image is judged. If the curvature change value is greater than the curvature threshold, it is judged as unqualified in air tightness. If the curvature change is less than or equal to the curvature threshold, the food package to be inspected is subjected to video inspection and the inspection result is output.
[0012] Optionally, the step of adjusting the pressure-down device to make the first pressure value within a preset pressure threshold range includes:
[0013] Extract the deformation curve of the first detection image, compare the deformation curve of the corresponding pressure level in the data, and determine whether the error of the deformation curve is within the preset deformation error threshold range. If not, the air tightness of the food packaging to be inspected is determined to be unqualified and it is discarded. If so, adjust the state of the pressing device to make the first pressure value within the pressure threshold range, and update the first detection image.
[0014] Optionally, extracting the deformation curve of the first detection image includes:
[0015] Acquire point cloud data of the food package to be detected in the first detection image, and fit the point cloud data to form a deformation curve including at least a concave portion of a contact position between the food package to be detected and the pressing device;
[0016] The deformation curve is compared with the deformation curve of each deformation detection image in the real-time pressure value matching database to determine whether the error of the deformation curve is within a preset deformation error range threshold.
[0017] Optionally, extracting the deformation curve of the first detection image, comparing the deformation curve of the corresponding pressure level in the data, and determining whether the error of the deformation curve is within a preset deformation error threshold range includes:
[0018] Comparing the tangent slopes at the same position in the first detection image and the second detection image to obtain a slope difference;
[0019] Comparing the slope changes in the same direction in the first detection image and the second detection image to obtain a slope change difference;
[0020] If the slope difference is greater than a preset slope difference threshold or the slope change difference is greater than a preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is greater than the preset curvature threshold;
[0021] If the slope difference is less than or equal to the preset slope difference threshold and the slope change difference is less than or equal to the preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is less than or equal to the preset curvature threshold.
[0022] Optionally, the video detection includes:
[0023] Keep the pressing device in the pressed state and start the conveyor belt;
[0024] Start the detection camera to obtain the detection video of the food packaging to be detected;
[0025] By detecting each frame of the video, point cloud data of the upper surface of the food package to be detected is extracted respectively, and multi-dimensional parameters of the food package to be detected in each frame of the detection image are obtained;
[0026] Input the multidimensional parameters of the food packaging to be tested into the trained evaluation neural network and output the airtightness score of each frame;
[0027] Determine whether the air tightness score is greater than a preset air tightness score threshold. If so, the air tightness of the food package to be tested is determined to be qualified and pass the test; if not, compare the test images of several adjacent frames to obtain the height difference and height recovery speed of the same position before and after the downward pressure device passes;
[0028] If the height difference is less than the preset height difference threshold and the height recovery speed is less than the preset height recovery speed threshold, the air tightness of the food package to be tested is determined to be qualified and passed the test; if not, the air tightness of the food package to be tested is determined to be unqualified and an alarm message is issued to remind the staff to manually remove the food package to be tested.
[0029] Optionally, the detection camera obtains the detection video of the food package to be detected through a camera stream mode.
[0030] A second aspect of the present application provides a visual inspection system for air tightness of food packaging, the system comprising: a pressing device, a detection camera, a conveyor belt, and a controller;
[0031] The controller controls the pressing device to press downward;
[0032] The detection camera obtains a first detection image of the contact position between the food package to be detected and the pressing device, and sends the first detection image to the controller, and the controller feeds back a first pressure value by performing image processing on the first detection image;
[0033] The controller determines whether the first pressure value is within a preset first pressure threshold range, and if not, adjusts the pressing device to make the first pressure value within the preset pressure threshold range;
[0034] If yes, the pressing device is controlled to maintain the pressing state for a rated time, the detection camera obtains a second detection image of the contact position between the food package to be detected and the pressing device, and the controller feeds back a second pressure value by performing image detection on the second detection image;
[0035] The controller compares whether the pressure difference between the second pressure value and the first pressure value is greater than the pressure change threshold value. If not, the controller controls the pressing device to maintain the pressing state, and controls the detection camera to perform video detection on the food package to be detected. The controller processes the video data detected by the detection camera and outputs the detection result. If yes, the controller extracts and compares the deformation characteristic changes in the first detection image and the second detection image.
[0036] If the deformation feature change is less than or equal to the change threshold, the controller controls the pressing device to maintain the pressing state, and controls the detection camera to perform video detection on the food package to be detected. The controller processes the video data detected by the detection camera and outputs the detection result. If the deformation feature is greater than the change threshold, the curvature change at the same position of the first detection image and the second detection image is judged. If the curvature change is greater than the curvature threshold, it is judged as poor air tightness. If the curvature change is less than or equal to the curvature threshold, the controller controls the pressing device to maintain the pressing state, and controls the detection camera to perform video detection on the food package to be detected. The controller processes the video data detected by the detection camera and outputs the detection result.
[0037] Optionally, the step of adjusting the pressure-down device to make the first pressure value within a preset pressure threshold range includes:
[0038] The controller extracts the deformation curve of the first detection image, compares the deformation curve of the corresponding pressure level in the data, and determines whether the deformation of the deformation curve is within a preset deformation error threshold range. If not, the air tightness of the food package to be detected is determined to be unqualified and is rejected. If yes, the state of the pressing device is adjusted to make the first pressure value within the pressure threshold range, and the first detection image is updated;
[0039] The step of extracting the deformation curve of the first detection image, comparing the deformation curve of the corresponding pressure level in the data, and determining whether the error of the deformation curve is within a preset deformation error threshold range includes:
[0040] The controller extracts point cloud data of the food package to be detected from the first detection image, and fits the point cloud data to form a deformation curve including at least a concave portion of a contact position between the food package to be detected and the pressing device;
[0041] The deformation curve is compared with the deformation curve of each deformation detection image in the real-time pressure value matching database to determine whether the error of the deformation curve is within the preset deformation error range threshold. If so, it is determined that the inflation of the food package to be inspected is unqualified. If not, the state of the pressing device is adjusted to adjust the first pressure value.
[0042] Optionally, determining a change in curvature of the first detection image and the second detection image at the same position includes:
[0043] The controller compares the tangent slopes at the same position in the first detection image and the second detection image to obtain a slope difference;
[0044] Comparing the slope changes in the same direction in the first detection image and the second detection image to obtain a slope change difference;
[0045] If the slope difference is greater than a preset slope difference threshold or the slope change difference is greater than a preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is greater than the preset curvature threshold;
[0046] If the slope difference is less than or equal to the preset slope difference threshold and the slope change difference is less than or equal to the preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is less than or equal to the preset curvature threshold.
[0047] Optionally, the video detection includes:
[0048] Keep the pressing device in the pressed state and start the conveyor belt;
[0049] Start the detection camera to obtain the detection video of the food packaging to be detected;
[0050] Using the controller to detect each frame of the video, respectively extracting the point cloud data of the upper surface of the food package to be detected, and obtaining the multi-dimensional parameters of the food package to be detected in each frame of the detection image;
[0051] Input the multidimensional parameters of the food packaging to be tested into the trained evaluation neural network and output the airtightness score of each frame;
[0052] Check whether the air tightness score is greater than a preset air tightness score threshold. If so, the air tightness of the food package to be tested is qualified and passed the test; if not, compare the test images of several adjacent frames to obtain the height difference and height recovery speed of the same position before and after the pressing device passes;
[0053] If the height difference is less than the preset height difference threshold and the height recovery speed is less than the preset height recovery speed threshold, the air tightness of the food package to be tested is judged to be qualified and the test passes; if not, the air tightness of the food package to be tested is judged to be unqualified, and an alarm is issued to remind the staff to manually remove the food package to be tested.
[0054] As can be seen from the above, the present application provides a method and system for visually inspecting the air tightness of food packaging. The present application uses a pressing device to press down the food package to be inspected to detect and adjust its pressure value. After maintaining the pressing state for a rated time, the change in the pressure value difference, the change in the deformation characteristics of the contact surface between the food package to be inspected and the pressing device, and the change in the curvature of the contact surface between the food to be inspected and the pressing device are detected in turn. Finally, the food package to be inspected that fails the above detection is subjected to video detection, and each frame of food parameters of the food package to be inspected is detected by an evaluation neural network. In addition, for the detection images that fail the evaluation neural network detection, the height difference and height recovery speed of the detection images of several adjacent frames are compared. If they are all within the corresponding preset threshold range, it is determined to be poor in air tightness. Otherwise, it is determined to be qualified in air tightness.
[0055] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A simplified flow chart of a method for visually inspecting the air tightness of food packaging provided in an embodiment of the present application;
[0058] Figure 2 A specific flow chart of a method for visually inspecting air tightness of food packaging provided in an embodiment of the present application;
[0059] Figure 3 A block diagram of a visual inspection system for air tightness of food packaging provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0061] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0062] Please refer to Figure 1 , is a flow chart of a method for visually inspecting the air tightness of food packaging in some embodiments of the present application. The method comprises the following steps:
[0063] S102: Acquire a first detection image of a contact position between the food package to be detected and the pressing device, wherein the first detection image is used to determine a first pressure value between the contact position between the food package to be detected and the pressing device;
[0064] S104: determining whether the first pressure value is within a preset first pressure threshold range, and if not, adjusting the pressing device to bring the first pressure value within the preset pressure threshold range;
[0065] If yes, the pressing device is kept in the pressing state for a rated time, a second detection image of the contact position between the food package to be detected and the pressing device is obtained, and a second pressure value is fed back;
[0066] S106: inspecting the food package to be inspected according to the first inspection image and the second inspection image, specifically comprising: comparing whether the pressure value difference between the second pressure value and the first pressure value is greater than the pressure change threshold value, if not, executing S108, if yes, extracting and comparing the deformation characteristic change amount in the first inspection image and the second inspection image;
[0067] If the deformation feature change amount is less than or equal to the change threshold, execute S108; if the deformation feature change amount is greater than the change threshold, determine the curvature change value of the same position of the first detection image and the second detection image, if the curvature change is greater than the curvature threshold, it is determined that the airtightness is unqualified, if the curvature change is less than or equal to the curvature threshold, execute S108;
[0068] S108: Perform video detection on the food packaging to be detected and output the detection result.
[0069] Please refer to Figure 2 , which is a specific flow chart of a visual inspection method for air tightness of food packaging described in the present application. The present application adopts multiple inspections for the inspection of food packaging to be inspected. The specific inspections include sequentially detecting the changes in the pressure value difference, the changes in the deformation characteristics of the contact surface between the food packaging to be inspected and the downward pressure device, and the changes in the curvature of the contact surface between the food to be inspected and the downward pressure device. Finally, the food packaging to be inspected that fails the above inspections is subjected to video inspection, and the final data inspection results are obtained. The present application can effectively improve the accuracy of the inspection results through multiple inspections. Judging the air tightness of puffed food by visual inspection at multiple levels and in multiple ways can not only ensure that the inspection process has the least destructive effect on the food product, but also can intuitively, quickly and accurately obtain the results of the air tightness of the food packaging.
[0070] According to an embodiment of the present invention, the pressure adjustment device adjusts the first pressure value to be within a preset pressure threshold range, including:
[0071] Extract the deformation curve of the first detection image, compare the deformation curve of the corresponding pressure level in the data, and determine whether the deformation of the deformation curve is within the preset deformation error threshold range. If not, the air tightness of the food packaging to be inspected is determined to be unqualified and it is rejected. If so, adjust the state of the pressing device to make the first pressure value within the pressure threshold range, and update the first detection image.
[0072] According to an embodiment of the present invention, extracting the deformation curve of the first detection image, comparing the deformation curve of the corresponding pressure level in the data, and determining whether the error of the deformation curve is within a preset deformation error threshold range includes:
[0073] Acquire point cloud data of the food package to be detected in the first detection image, and fit the point cloud data to form a deformation curve including at least a concave portion of a contact position between the food package to be detected and the pressing device;
[0074] The deformation curve is compared with the deformation curve of each deformation detection image in the real-time pressure value matching database to determine whether the error of the deformation curve is within the preset deformation error range threshold. If so, it is determined that the inflation of the food package to be tested is unqualified. If not, the pressure value of the pressing device is adjusted.
[0075] According to an embodiment of the present invention, determining the curvature change value of the same position of the first detection image and the second detection image includes:
[0076] Comparing the tangent slopes at the same position in the first detection image and the second detection image to obtain a slope difference;
[0077] Comparing the slope changes in the same direction in the first detection image and the second detection image to obtain a slope change difference;
[0078] If the slope difference is greater than a preset slope difference threshold or the slope change difference is greater than a preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is greater than the preset curvature threshold;
[0079] If the slope difference is less than or equal to the preset slope difference threshold and the slope change difference is less than or equal to the preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is less than or equal to the preset curvature threshold.
[0080] According to an embodiment of the present invention, the video detection includes:
[0081] Keep the pressing device in the pressed state and start the conveyor belt;
[0082] Start the detection camera to obtain the detection video of the food packaging to be detected;
[0083] By detecting each frame of the video, point cloud data of the upper surface of the food package to be detected is extracted respectively, and multi-dimensional parameters of the food package to be detected in each frame of the detection image are obtained;
[0084] Input the multidimensional parameters of the food packaging to be tested into the trained evaluation neural network and output the airtightness score of each frame;
[0085] Check whether the air tightness score is greater than a preset air tightness score threshold. If so, the air tightness of the food package to be tested is qualified and passed the test; if not, compare the test images of several adjacent frames to obtain the height difference and height recovery speed of the same position before and after the pressing device passes;
[0086] If the height difference is less than the preset height difference threshold and the height recovery speed is less than the preset height recovery speed threshold, the air tightness of the food package to be tested is determined to be qualified and passed the test; if not, the air tightness of the food package to be tested is determined to be unqualified and an alarm message is issued to remind the staff to manually remove the food package to be tested.
[0087] According to an embodiment of the present invention, the detection camera obtains the detection video of the food package to be detected through a camera stream mode.
[0088] It should be noted that the detection camera obtains the detection video in a streaming mode, and the detection video includes the transmission process when the pressing device contacts the food packaging. For each frame of the detection video, the point cloud data of the upper surface of the video packaging is extracted respectively, and the multi-dimensional food packaging parameters in the detection image of each frame are obtained; the multi-dimensional food packaging parameters are input into the trained evaluation neural network, and the evaluation neural network outputs the air tightness score of each frame; the air tightness score output by the evaluation neural network is compared with the scoring threshold to determine whether there is a suspicion of air leakage. If there is a suspicion of air leakage in a frame of the detection image, the adjacent detection images are combined to determine whether the food packaging has poor air tightness. Compare the detection images of several adjacent frames to obtain the height difference and height recovery speed of the same position before and after the pressing device passes; if the height difference and the height recovery speed are both within the preset corresponding thresholds, the food packaging passes the inspection, otherwise, the food packaging is judged to have poor air tightness, the staff is warned, and the food packaging is discarded.
[0089] Please refer to Figure 3 , is a block diagram of a visual inspection system for air tightness of food packaging provided in the present application, wherein the visual inspection system 3 for air tightness of food packaging comprises: a pressing device 301, a detection camera 302, a conveyor belt 303, and a controller 304;
[0090] The controller 304 controls the pressing device 301 to press downward;
[0091] The detection camera 302 obtains a first detection image of the contact position between the food package to be detected and the pressing device 301, and sends the first detection image to the controller 304. The controller 304 feeds back a first pressure value by performing image processing on the first detection image.
[0092] The controller 304 determines whether the first pressure value is within the preset first pressure threshold range. If not, the controller 304 adjusts the pressing device 301 to make the first pressure value within the preset pressure threshold range.
[0093] The controller 304 controls the pressing device 301 to maintain the pressing state for a specified time, and the detection camera 302 obtains a second detection image of the contact position between the food package to be detected and the pressing device 301. The controller 304 performs image detection on the second detection image and feeds back a second pressure value.
[0094] The controller 304 compares whether the pressure difference between the second pressure value and the first pressure value is greater than the pressure change threshold value. If not, the controller 304 controls the pressing device 301 to maintain the pressing state, and controls the detection camera 302 to perform video detection on the food package to be detected. The controller 304 processes the video data detected by the detection camera 302 and outputs the detection result. If yes, the deformation characteristic changes in the first detection image and the second detection image are extracted and compared.
[0095] If the deformation feature change is less than or equal to the change threshold, the controller 304 controls the pressing device 301 to maintain the pressing state, and controls the detection camera 302 to perform video detection on the food package to be detected. The controller 304 processes the video data detected by the detection camera 302 and outputs the detection result. If the deformation feature is greater than the change threshold, the curvature change at the same position of the first detection image and the second detection image is judged. If the curvature change is greater than the curvature threshold, it is judged as poor air tightness. If the curvature change is less than or equal to the curvature threshold, the controller 304 controls the pressing device 301 to maintain the pressing state, and controls the detection camera 302 to perform video detection on the food package to be detected. The controller 304 processes the video data detected by the detection camera 302 and outputs the detection result.
[0096] It should be noted that, in this application, the food package to be tested, that is, the food package that has been inflated, is transferred to the detection position, and the pressing device 301 is pressed down to the set position, the first image is obtained, and the real-time pressure value is fed back. In the scheme in this application, after the puffed food package is inflated and sealed, it is transferred to the conveyor belt 303 and transmitted to the detection position. A plurality of pressing devices 301 are arranged above the detection position of the conveyor belt 303, and the pressing device 301 includes a lifting rod for adjusting the position of the pressing device 301; a pressing block is arranged at the bottom of the lifting rod, and the pressing block is used to apply pressure to the puffed food product package to deform the package. The shape of the pressing block can be selected according to actual needs, and can be a rectangular block, a roller or a sphere, etc. In this application, the pressing block is a roller. A pressure sensor is arranged at the pressing block to feedback the pressure when the pressing block contacts the food package. The pressing device 301 is arranged in a distributed manner above the conveyor belt 303, and can simultaneously perform air tightness detection of multiple food packages. When the food package is transferred to the designated position (i.e., directly below the pressing device 301) by the conveyor belt 303, the pressing device 301 is lowered to a preset position according to the program setting in the controller 304, so that the pressing block contacts the food package, thereby deforming the food package. Specifically, the preset position is obtained after multiple experiments based on the product parameters of the food packaging product. Multiple experiments are conducted based on the parameters of the food packaging product such as the shape, inflation ratio, and packaging material to obtain the pressing position that causes obvious deformation of the food package without damaging the product.
[0097] According to an embodiment of the present invention, the pressure adjustment device adjusts the first pressure value to be within a preset pressure threshold range, including:
[0098] The controller 304 extracts the deformation curve of the first detection image, compares the deformation curve of the corresponding pressure level in the data, and determines whether the deformation of the deformation curve is within the preset deformation error threshold range. If not, the air tightness of the food package to be detected is determined to be unqualified and is rejected. If yes, the state of the pressing device 301 is adjusted to make the first pressure value within the pressure threshold range, and the first detection image is updated;
[0099] It should be noted that after the pressing device 301 contacts the food product package, the pressure sensor at the pressing device 301 feeds back the real-time pressure value and simultaneously obtains the first detection image. The first detection image is obtained by the detection camera 302 arranged on the upper side, and the image obtained by the detection camera 302 at least includes the contact position between the pressing device 301 and the food package and the overall shape of the food package. According to the feedback of the real-time pressure and the first detection image, compared with the set threshold value, the preliminary screening of qualified food products for inflation is carried out.
[0100] Specifically, the following process is included: comparing the real-time pressure feedback with the set pressure range to determine whether the real-time pressure feedback is within the set pressure range. If so, it is preliminarily determined that the food package is properly inflated and can proceed to the next step of constant pressure detection (i.e., maintaining the rated time of the pressing device 301 to obtain the second detection image); if not, it is necessary to further determine whether the food product is properly inflated based on the first detection image. Extract the point cloud data of the upper surface of the food package in the first detection image (i.e., the surface where the food package contacts the pressing device 301), fit the point cloud data, and form a deformation curve including at least the concave part of the contact position.
[0101] It should be noted that the database contains deformation detection images of food packages in different postures at different pressure levels. When the real-time pressure is greater than the set pressure range, the deformation detection images of the corresponding pressure levels in the database are matched according to the value of the real-time pressure, and the deformation curves of each qualified deformation detection image are extracted. The deformation curve of the first detection image is compared with the deformation curves of each deformation detection image in the database. When the error is within the set error range, the food package is judged to be properly inflated, otherwise it is judged that the food package is over-inflated. When the real-time pressure is less than the set pressure range, the aspect ratio of the food package in the first detection image and the contact position between the pressing device 301 and the food package are identified, and according to the position of the contact position on the food package, it is determined whether the contact position is located at the edge of the food package. If so, the first detection image and the real-time pressure value are re-acquired after adjusting the position of the food package; otherwise, the deformation detection image of the corresponding pressure level in the database is matched according to the numerical value of the real-time pressure, and the deformation curve of each deformation detection image that meets the conditions is extracted, and the deformation curve of the first detection image is compared with the deformation curve of each deformation detection image in the database. When the error is within the set error range, it is determined that the food package is properly inflated, otherwise it is determined that the food package is under-inflated.
[0102] When the food packaging is judged to be qualified according to the first detection image, the position of the pressing device 301 is adjusted until the feedback pressure is within the set pressure range. After adjusting the position of the pressing device 301, the first detection image is re-acquired and updated. When the food packaging is judged to be unqualified according to the first detection image, a corresponding alarm is issued (including over-inflation or under-inflation), and unqualified food packaging is removed. Through the preliminary screening of the real-time pressure combined with the first detection image, unqualified products with over-inflation or under-inflation are removed, and the interference with subsequent air tightness detection is reduced. The same set of detection standards can be used for air tightness detection to improve recognition accuracy. It can also determine whether the product posture at the detection position is correct to ensure the accuracy of subsequent detection.
[0103] According to an embodiment of the present invention, extracting the deformation curve of the first detection image, comparing the deformation curve of the corresponding pressure level in the data, and determining whether the error of the deformation curve is within a preset deformation error threshold range includes:
[0104] The controller 304 extracts point cloud data of the food package to be inspected from the first detection image, and fits the point cloud data to form a deformation curve including at least the depression at the contact position between the food package to be inspected and the pressing device 301; the deformation curve is compared with the deformation curve of each deformation detection image in the real-time pressure value matching database to determine whether the error of the deformation curve is within a preset deformation error range threshold. If so, it is determined that the inflation of the food package to be inspected is unqualified; if not, the state of the pressing device 301 is adjusted to adjust the first pressure value.
[0105] It should be noted that when the real-time pressure value is within the set pressure range, the second detection image and pressure change data are obtained after the downward pressure device 301 is maintained for a rated time. For products that have passed the preliminary screening, a constant pressure test is performed, and a constant pressure within the set pressure range is applied to the food package. After maintaining the constant pressure for a rated time, a second detection image of the deformation of the food package and pressure change data within the rated time are obtained. The second detection image is also obtained by a detection camera 302 arranged on the upper side. The image obtained by the detection camera 302 includes at least the contact position between the downward pressure device 301 and the food package and the overall morphological content of the food package. Whether the food package is leaking is determined by visual inspection based on the second detection image and the pressure change data.
[0106] It should be noted that the point cloud data of the upper surface of the food package (i.e., the surface where the food package contacts the pressing device 301) in the second detection image is extracted, and the point cloud data is fitted to form a deformation curve including at least the concave part of the contact position. The deformation curve obtained by fitting the first detection image is called the first deformation curve, and the deformation curve obtained by fitting the second detection image is called the second deformation curve. Based on the first deformation curve, the curve change rate of the second deformation curve is determined, and the expression of the curve change rate can be expressed as:
[0107] Lc = △L / L_1
[0108] Where, Lc is the curve change rate;
[0109] △L is the difference length between the second deformation curve and the first deformation curve;
[0110] L_1 is the length of the deformation curve obtained by fitting the first detection image.
[0111] If the curve change rate is greater than the set change threshold, the process enters the curvature change judgment; if the curve change rate is less than or equal to the set change threshold, the process enters the video detection.
[0112] According to an embodiment of the present invention, determining the curvature change value of the same position of the first detection image and the second detection image includes:
[0113] The controller 304 compares the tangent slopes at the same position in the first detection image and the second detection image to obtain a slope difference;
[0114] Comparing the slope changes in the same direction in the first detection image and the second detection image to obtain a slope change difference;
[0115] If the slope difference is greater than a preset slope difference threshold or the slope change difference is greater than a preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is greater than the preset curvature threshold;
[0116] If the slope difference is less than or equal to the preset slope difference threshold and the slope change difference is less than or equal to the preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is less than or equal to the preset curvature threshold.
[0117] It should be noted that the present application extracts the point cloud data of the upper surface of the food package (i.e., the surface where the food package contacts the pressing device 301) in the first detection image and the second detection image, fits the point cloud data, and forms a deformed surface including at least the concave part of the contact position, which is called the first deformed surface and the second deformed surface. Based on the first deformed surface, the surface change rate of the second deformed surface is determined, and the expression of the surface change rate can be expressed as:
[0118] Sc = △S / S_1
[0119] Where, Sc is the rate of change of the surface;
[0120] △S is the difference area between the second deformed surface and the first deformed surface;
[0121] S_1 is the area of the first deformation curve.
[0122] If the surface change rate is greater than the set change threshold, the process enters the curvature change judgment; if the surface change rate is less than or equal to the set change threshold, the process enters the video detection.
[0123] It should be noted that the process of judging the curvature change includes: extracting tangent slope data around the concave position on the surface of the food packaging in the first detection image and the second detection image, and calculating the slope change value for the tangent slope in the same direction. Compare the tangent slopes at the same position in the first detection image and the second detection image to obtain the slope difference; compare the slope change values in the same direction in the first detection image and the second detection image to obtain the slope change difference. If there is a slope difference greater than the preset slope difference threshold or the slope change difference greater than the preset slope change difference threshold, the airtightness of the food packaging is judged to be poor and it is discarded; otherwise, enter the video detection step.
[0124] According to an embodiment of the present invention, the video detection includes:
[0125] Keep the pressing device 301 in the pressing state and start the conveyor belt 303;
[0126] Start the detection camera 302 to obtain the detection video of the food package to be detected;
[0127] Utilize the controller 304 to detect each frame of the video, extract the point cloud data of the upper surface of the food package to be detected, and obtain the multi-dimensional parameters of the food package to be detected in each frame of the detection image;
[0128] Input the multidimensional parameters of the food packaging to be tested into the trained evaluation neural network and output the airtightness score of each frame;
[0129] Check whether the air tightness score is greater than a preset air tightness score threshold. If so, the air tightness of the food package to be tested is qualified and passed the test; if not, compare the test images of several adjacent frames to obtain the height difference and height recovery speed of the same position before and after the pressing device 301 passes;
[0130] If the height difference is less than the preset height difference threshold and the height recovery speed is less than the preset height recovery speed threshold, the air tightness of the food package to be tested is judged to be qualified and the test passes; if not, the air tightness of the food package to be tested is judged to be unqualified, and an alarm is issued to remind the staff to manually remove the food package to be tested.
[0131] It should be noted that the present application starts the conveying device and obtains a detection video of conveying the food package when the pressing device 301 remains in the pressing state. For the food package that has passed the constant pressure test, the pressing device 301 remains in the pressing state, and the conveyor belt 303 is started, so that the food package to be tested moves slowly at the set rated speed. At this time, since the pressing device 301 maintains the previous pressing state, the food package moves relative to the pressing device 301, that is, the concave position where the pressing device 301 contacts the food package will move on the food package, simulating the process of continuous extrusion at different positions on the food package.
[0132] It should be noted that the detection camera 302 acquires the detection video in a streaming mode, and the detection video includes the transmission process when the pressing device 301 contacts the food package.
[0133] In this application, for each frame of the detection video, the point cloud data of the upper surface of the video packaging is extracted respectively, and the multidimensional food packaging parameters in the detection image of each frame are obtained. The multidimensional food packaging parameters include the height difference between the concave position and the highest convex position, the tangent slope around the concave position and the slope change value in each direction, the curvature of the concave position, and the height of the upper surface of the food packaging. The multidimensional food packaging parameters are input into the trained evaluation neural network, and the evaluation neural network outputs the air tightness score of each frame. The air tightness score output by the neural network is compared with the scoring threshold to determine whether there is a suspicion of air leakage; if there is no suspicion of air leakage in the detection image of each frame, the product passes the detection and is transmitted to the next link with the conveyor belt 303; if there is a suspicion of air leakage in all frames of the entire detection video, the food packaging is judged to have poor air tightness, the staff is warned, and the food packaging is removed. If there is a suspicion of air leakage in the detection image of one frame, the food packaging is judged to have poor air tightness in combination with the adjacent detection images. Compare the detection images of several adjacent frames to obtain the height difference and height recovery speed of the same position before and after the pressing device 301 passes; if the height difference and the height recovery speed are both within the preset corresponding thresholds, the food package passes the test, otherwise, the food package is judged to have poor air tightness, the staff is warned, and the food package is rejected. The air tightness of puffed food can be judged by multi-level and multi-mode visual inspection, which can not only ensure that the detection process has the least destructive effect on the food product, but also can intuitively, quickly and accurately obtain the air tightness of the food package.
[0134] As can be seen from the above, the present application provides a method and system for visually inspecting the air tightness of food packaging. The present application uses a pressing device to press down the food package to be inspected to detect and adjust its pressure value. After maintaining the pressing state for a rated time, the change in the pressure value difference, the change in the deformation characteristics of the contact surface between the food package to be inspected and the pressing device, and the change in the curvature of the contact surface between the food to be inspected and the pressing device are detected in turn. Finally, the food package to be inspected that fails the above detection is subjected to video detection, and each frame of food parameters of the food package to be inspected is detected by an evaluation neural network. In addition, for the detection images that fail the evaluation neural network detection, the height difference and height recovery speed of the detection images of several adjacent frames are compared. If they are all within the corresponding preset threshold range, it is determined to be poor in air tightness. Otherwise, it is determined to be qualified in air tightness.
[0135] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0136] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0137] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0138] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, the aforementioned program can be stored in a readable storage medium, and when the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.
[0139] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
Claims
1. A visual inspection method for air tightness of food packaging, characterized in that: The method comprises the following steps: Acquire a first detection image of a contact position between the food package to be detected and the pressing device, wherein the first detection image is used to determine a first pressure value between the contact position between the food package to be detected and the pressing device; Determine whether the first pressure value is within a preset first pressure threshold range, and if not, adjust the pressing device to make the first pressure value within the preset pressure threshold range; If yes, the pressing device is kept in the pressing state for a rated time, a second detection image of the contact position between the food package to be detected and the pressing device is obtained, and a second pressure value is fed back; Compare whether the pressure difference between the second pressure value and the first pressure value is greater than the pressure change threshold; if not, perform video detection on the food package to be detected and output the detection result; if yes, extract and compare the deformation characteristic change amount in the first detection image and the second detection image; If the change amount of the deformation feature is less than or equal to the change threshold, the food package to be inspected is subjected to video inspection and the inspection result is output; if the change amount of the deformation feature is greater than the change threshold, the curvature change value of the same position of the first inspection image and the second inspection image is determined. If the curvature change value is greater than the curvature threshold, it is determined that the airtightness is unqualified. If the curvature change is less than or equal to the curvature threshold, the food package to be inspected is subjected to video inspection and the inspection result is output; The video detection includes: Keep the pressing device in the pressed state and start the conveyor belt; Start the detection camera to obtain the detection video of the food packaging to be detected; By detecting each frame of the video, point cloud data of the upper surface of the food package to be detected is extracted respectively, and multi-dimensional parameters of the food package to be detected in each frame of the detection image are obtained; Input the multidimensional parameters of the food packaging to be tested into the trained evaluation neural network and output the airtightness score of each frame; Determine whether the air tightness score is greater than a preset air tightness score threshold. If so, the air tightness of the food package to be tested is determined to be qualified and pass the test; if not, compare the test images of several adjacent frames to obtain the height difference and height recovery speed of the same position before and after the downward pressure device passes; If the height difference is less than the preset height difference threshold and the height recovery speed is less than the preset height recovery speed threshold, the air tightness of the food package to be tested is judged to be qualified and passes the test; if not, the air tightness of the food package to be tested is judged to be unqualified and an alarm message is issued.
2. A visual inspection method for air tightness of food packaging according to claim 1, characterized in that: The step of adjusting the pressure-down device so that the first pressure value is within a preset pressure threshold range includes: Extract the deformation curve of the first detection image, compare the deformation curve of the corresponding pressure level in the data, and determine whether the error of the deformation curve is within the preset deformation error threshold range. If not, it is determined that the air tightness of the food package to be inspected is unqualified. If so, adjust the state of the pressing device to make the first pressure value within the pressure threshold range, and update the first detection image.
3. A visual inspection method for air tightness of food packaging according to claim 2, characterized in that: The step of extracting the deformation curve of the first detection image, comparing the deformation curve of the corresponding pressure level in the data, and determining whether the error of the deformation curve is within a preset deformation error threshold range includes: Acquire point cloud data of the food package to be detected in the first detection image, and fit the point cloud data to form a deformation curve including at least a concave portion of a contact position between the food package to be detected and the pressing device; The deformation curve is compared with the deformation curve of each deformation detection image in the real-time pressure value matching database to determine whether the error of the deformation curve is within a preset deformation error range threshold.
4. A visual inspection method for air tightness of food packaging according to claim 3, characterized in that: The determining of the curvature change value of the same position of the first detection image and the second detection image includes: Comparing the tangent slopes at the same position in the first detection image and the second detection image to obtain a slope difference; Comparing the slope changes in the same direction in the first detection image and the second detection image to obtain a slope change difference; If the slope difference is greater than a preset slope difference threshold or the slope change difference is greater than a preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is greater than the preset curvature threshold; If the slope difference is less than or equal to the preset slope difference threshold and the slope change difference is less than or equal to the preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is less than or equal to the preset curvature threshold.
5. A visual inspection system for air tightness of food packaging, characterized in that: The system includes: a pressing device, a detection camera, a conveyor belt, and a controller; The controller controls the pressing device to press downward; The detection camera obtains a first detection image of the contact position between the food package to be detected and the pressing device, and sends the first detection image to the controller, and the controller feeds back a first pressure value by performing image processing on the first detection image; The controller determines whether the first pressure value is within a preset first pressure threshold range, and if not, adjusts the pressing device to make the first pressure value within the preset pressure threshold range; If yes, the pressing device is controlled to maintain the pressing state for a rated time, the detection camera obtains a second detection image of the contact position between the food package to be detected and the pressing device, and the controller feeds back a second pressure value by performing image detection on the second detection image; The controller compares whether the pressure difference between the second pressure value and the first pressure value is greater than the pressure change threshold value. If not, the controller controls the pressing device to maintain the pressing state, and controls the detection camera to perform video detection on the food package to be detected. The controller processes the video data detected by the detection camera and outputs the detection result. If yes, the controller extracts and compares the deformation characteristic changes in the first detection image and the second detection image. If the deformation feature change is less than or equal to the change threshold, the controller controls the pressing device to maintain the pressing state, and controls the detection camera to perform video detection on the food package to be detected. The controller processes the video data detected by the detection camera and outputs the detection result. If the deformation feature is greater than the change threshold, the curvature change at the same position of the first detection image and the second detection image is judged. If the curvature change is greater than the curvature threshold, it is judged as poor air tightness. If the curvature change is less than or equal to the curvature threshold, the controller controls the pressing device to maintain the pressing state, and controls the detection camera to perform video detection on the food package to be detected. The controller processes the video data detected by the detection camera and outputs the detection result. Video detection includes: Keep the pressing device in the pressed state and start the conveyor belt; Start the detection camera to obtain the detection video of the food packaging to be detected; Using the controller to detect each frame of the video, respectively extracting the point cloud data of the upper surface of the food package to be detected, and obtaining the multi-dimensional parameters of the food package to be detected in each frame of the detection image; Input the multidimensional parameters of the food packaging to be tested into the trained evaluation neural network and output the airtightness score of each frame; Check whether the air tightness score is greater than a preset air tightness score threshold. If so, the air tightness of the food package to be tested is qualified and passed the test; if not, compare the test images of several adjacent frames to obtain the height difference and height recovery speed of the same position before and after the pressing device passes; If the height difference is less than the preset height difference threshold and the height recovery speed is less than the preset height recovery speed threshold, the air tightness of the food package to be tested is judged to be qualified and passes the test; if not, the air tightness of the food package to be tested is judged to be unqualified and an alarm is issued.
6. A visual inspection system for air tightness of food packaging according to claim 5, characterized in that: The step of adjusting the pressure-down device so that the first pressure value is within a preset pressure threshold range includes: The controller extracts the deformation curve of the first detection image, compares the deformation curve of the corresponding pressure level in the data, and determines whether the deformation of the deformation curve is within a preset deformation error threshold range. If not, it is determined that the air tightness of the food package to be detected is unqualified. If so, the state of the pressing device is adjusted to make the first pressure value within the pressure threshold range, and the first detection image is updated; The step of extracting the deformation curve of the first detection image, comparing the deformation curve of the corresponding pressure level in the data, and determining whether the error of the deformation curve is within a preset deformation error threshold range includes: The controller extracts point cloud data of the food package to be detected from the first detection image, and fits the point cloud data to form a deformation curve including at least a concave portion of a contact position between the food package to be detected and the pressing device; The deformation curve is compared with the deformation curve of each deformation detection image in the real-time pressure value matching database to determine whether the error of the deformation curve is within the preset deformation error range threshold. If so, it is determined that the inflation of the food package to be inspected is unqualified. If not, the state of the pressing device is adjusted to adjust the first pressure value.
7. A visual inspection system for air tightness of food packaging according to claim 6, characterized in that: The determining of the curvature change value of the same position of the first detection image and the second detection image includes: The controller compares the tangent slopes at the same position in the first detection image and the second detection image to obtain a slope difference; Comparing the slope changes in the same direction in the first detection image and the second detection image to obtain a slope change difference; If the slope difference is greater than a preset slope difference threshold or the slope change difference is greater than a preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is greater than the preset curvature threshold; If the slope difference is less than or equal to the preset slope difference threshold and the slope change difference is less than or equal to the preset slope change difference threshold, it is determined that the curvature change at the same position of the first detection image and the second detection image is less than or equal to the preset curvature threshold.
8. A visual inspection system for air tightness of food packaging according to claim 5, characterized in that: The detection camera obtains the detection video of the food package to be detected through the camera stream mode.
