Canned prefabricated food packaging detection system based on machine vision
The machine vision system is used to package and detect canned pre-made foods, combined with image processing and motion trajectory analysis, and solve the problem of insufficient packaging detection accuracy of canned pre-made foods, realize high-precision detection and risk monitoring, and ensure packaging quality.
Patent Information
- Application Number
- CN202510525075.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the production of canned pre-made food, the packaging inspection accuracy is insufficient and cannot meet the high-demand inspection needs.
The canned prefabricated food packaging detection system based on machine vision is adopted, and image data is collected through the camera module, combined with preprocessing, storage, judgment and analysis modules, the canned food profile and the motion trajectory of the packaged parts are compared, and the early warning module is configured for real-time risk monitoring and warning prompts.
It realizes higher-precision packaging inspection, ensures packaging effectiveness and safety, improves detection accuracy, and issues warnings in a timely manner when risks arise to ensure production stability.
Smart Images

Figure CN120411041A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of food safety detection, and specifically to a canned prefabricated food packaging detection system based on machine vision. Background Art
[0002] Canned prefabricated food is pre-packaged food that seals processed food in a canned container and is made through processes such as sterilization. It is convenient for storage and transportation, can be stored for a long time, retains the nutrition and flavor of the food, and is very convenient to eat after simple treatment or directly after opening the can.
[0003] The invention patent application with the application number 202410007725.7 discloses an appearance quality detection system for the production process of food packaging boxes, including: a first acquisition module for collecting conveyor belt transportation images, processing the conveyor belt transportation images to obtain various size packaging images of the food packaging box; a second acquisition module for calculating the first eigenvalue of each gray value under each size packaging image according to the size change degree of each size packaging image of the food packaging box and the frequency change degree of each gray value under each size packaging image; calculating the second eigenvalue of each gray value according to the first eigenvalue of each gray value under various size packaging images, the size packaging image when each gray value disappears, and the frequency of each gray value in each size packaging image; a third acquisition module for correcting the frequency of each gray value in the first size packaging image of the food packaging box according to the second eigenvalue of each gray value, and performing histogram equalization according to the corrected frequency of each gray value to obtain the enhanced packaging image of the food packaging box. This application aims to solve the problem that "the frequency of the gray value corresponding to the defect feature in the packaging image is usually small, and when enhancing by improving histogram equalization, it will be merged, resulting in the defect feature not being enhanced".
[0004] However, in the prior art, there is already a technology for checking whether the product packaging is intact through machine vision. However, in the production scenario of canned prefabricated food, the detection accuracy requirements for canned prefabricated food packaging are higher. Simply detecting whether the packaging is intact from the surface image layer of canned prefabricated food obviously does not meet its detection accuracy requirements.
[0005] Therefore, we propose a canned prefabricated food packaging detection system based on machine vision. Summary of the Invention
[0006] Aiming at the above-mentioned shortcomings of the prior art, the present invention provides a canned prefabricated food packaging detection system based on machine vision, which can effectively solve the problems of the prior art.
[0007] To achieve the above objectives, the present invention is realized through the following technical solutions;
[0008] The present invention discloses a canned prefabricated food packaging detection system based on machine vision, including:
[0009] A camera module for collecting image data of canned foods and image data of packaging components on a canned food packaging device; a preprocessing module for receiving the image data of canned foods collected by the operation of the camera module and optimizing the image data of canned foods; a storage module for receiving the image data of canned foods after preprocessing, obtaining the movement trajectory of the packaging components in the image data of the packaging components on the canned food packaging device, and storing the image data of canned foods and the movement trajectory of the packaging components; a determination module for uploading standard image data of canned foods and the standard movement trajectory of the packaging components on the packaging device, comparing the similarity between the standard image data and the currently collected image data of canned foods, and comparing the standard movement trajectory with the currently obtained movement trajectory of the packaging components to determine whether the output canned food packaging of the current packaging device is qualified; an analysis module for traversing the image data of canned foods and the movement trajectory of the packaging components stored in the storage module and analyzing the packaging risk of canned foods based on the image data of canned foods and the movement trajectory of the packaging components; an early warning module for setting a determination threshold for the packaging risk of canned foods, receiving the analysis result of the packaging risk of canned foods in the analysis module, comparing the analysis result with the set determination threshold for the packaging risk of canned foods, and triggering an early warning prompt when the analysis result exceeds the determination threshold for the packaging risk of canned foods;
[0010] Among them, the early warning module is integrated by a speaker. The early warning module is installed on the surface of the canned food packaging device. The warning audio stored in the speaker is triggered by the operation result of the early warning module to play the warning audio for early warning.
[0011] Furthermore, the camera module is integrated by a high-definition industrial camera. The image data of canned foods collected by the operation of the camera module is the image data of canned foods after being packaged by the canned food packaging device. The image data of the packaging components on the canned food packaging device collected by the operation of the camera module is the image data of the movement trajectory of the packaging components during the packaging process of the canned foods by the device;
[0012] Among them, after the camera module collects the image data of the packaging components on the canned food packaging device, it picks up the first frame image in the image data, and the system-side user marks the tracking target points on the first frame image, and captures the movement trajectory of the packaging components during the packaging process of the canned foods by the device based on the marked tracking target points.
[0013] Furthermore, the optimization processing logic of the image data of canned foods in the preprocessing module is:
[0014] The original image data of canned foods is denoted as I(x, y);
[0015] O(x, y) = α·B(x, y) + β·G(x, y) + γ·H(x, y);
[0016] Where: O(x, y) is the image data of canned food after optimization processing; α, β, γ are fusion coefficients; B(x, y) is a bilateral filtering function; G(x, y) is a guided filtering function; H(x, y) is an adaptive histogram equalization function;
[0017] Among them, the sum of α, β, and γ is 1, and 0 ≤ α, γ ≤ 1.
[0018] Furthermore, the expressions of the bilateral filtering function, the guided filtering function, and the adaptive histogram equalization function are:
[0019]
[0020] Where: W(x, y) is the normalized weight; r is the filtering window radius; (i, j) is the window pixel index; f c (i, j) is the range Gaussian kernel function; f s (i, j) is the spatial Gaussian kernel function; w x is the window centered on pixel x; l is the index variable traversing all pixel positions within the window w k within; w k is the window centered on pixel k; is the variance of the guided image within the window w k ; θ g is the regularization parameter; is the variance of the local area corresponding to the pixel at position l in the guided image within the window w k ; N k is the total number of pixels in the window centered on pixel k; P k is the average value of the guided image within the window w k ; μ k is the mean value of the guided image within the window w k ; L - 1 is the maximum value in the preset gray level range; n is the product of the number of sub - image blocks obtained by horizontal segmentation and the number of sub - image blocks obtained by vertical segmentation of the image after segmentation processing based on the output image of the guided filtering function; h ij (c) is the number of pixels with gray value c in the sub - block (i, j); T is the contrast limit threshold;
[0021] Among them, T is a preset value. When the guided filtering function operates, the output image of the bilateral filtering function is used as the guided image.
[0022] Furthermore, the f c (i, j) is used to measure the pixel value difference, fs (i, j) is used to measure the spatial distance;
[0023]
[0024] The
[0025] In the formula: σ d is the standard deviation of the Gaussian kernel in the value range; σ s is the standard deviation of the Gaussian kernel in space.
[0026] Furthermore, a binding unit and a queue unit are arranged at the lower level of the storage module. The binding unit is used to bind the pre - processed canned food image data with its corresponding movement trajectory of the packaging component. The queue unit is used to identify the acquisition time of the pre - processed canned food image data bound with its corresponding movement trajectory of the packaging component, and sort the pre - processed canned food image data bound with its corresponding movement trajectory of the packaging component based on the time sequence;
[0027] Among them, the operations of the binding unit and the queue unit on the pre - processed canned food image data and its corresponding movement trajectory of the packaging component are all executed inside the storage module.
[0028] Furthermore, the standard canned food image data uploaded in the determination module is: after constructing a three - dimensional model based on the standard specification parameters of canned food and rendering it, referring to the posture of the canned food output by the canned food packaging equipment and the image data acquisition perspective of the canned food, the model image intercepted on the three - dimensional model;
[0029] The standard movement trajectory of the packaging component on the packaging equipment uploaded in the determination module is: after constructing a three - dimensional model based on the structural parameters of the canned food packaging equipment, controlling the movement of the three - dimensional model to generate a three - dimensional model animation, and marking the tracking target points in the three - dimensional model animation to obtain the movement trajectory of the tracking target points in the three - dimensional model animation.
[0030] Furthermore, during the operation stage of the determination module, the contour images of the two are extracted from the standard image data and the currently collected canned food image data, and the similarity between the contour image corresponding to the standard image data and the contour image corresponding to the currently collected canned food image data is compared;
[0031]
[0032] In the formula: SIMM(A, A NORR ) represents the similarity between the contour image corresponding to the currently collected canned food image data and the contour image corresponding to the standard image data; SIMM(L, L NORR) represents the similarity between the currently obtained movement trajectory of the packaging component and the standard movement trajectory; Q1% and Q2% represent preset determination thresholds;
[0033] Among them, the values of Q1% and Q2% are user-defined by the system-side user. Q1% and Q2% are initially set to 99% and 98%. When both Formula (1) and Formula (2) hold, it is determined that the current canned food packaging output by the packaging device is qualified; otherwise, it is determined that the current canned food packaging output by the packaging device is unqualified.
[0034] Furthermore, during the operation stage of the analysis module, the image data similarity comparison results and movement trajectory comparison results of the historical operation of the determination module are obtained, and based on the comparison results, it is analyzed whether there is a risk in the current canned food packaging;
[0035]
[0036] In the formula: SIMM new (A, A NORR ), SIMM new-1 (A, A NORR ) and SIMM new-2 (A, A NORR ) are the similarities between the contour images of the currently collected canned food image data and the contour images of the standard image data obtained from the latest three operations of the determination module; SIMM new (L, L NORR ), SIMM new-1 (L, L NORR ) and SIMM new-2 (L, L NORR ) are the similarities between the currently obtained movement trajectory of the packaging component and the standard movement trajectory obtained from the latest three operations of the determination module;
[0037] Among them, when any one or more of Formula (1) and Formula (2) hold, it indicates that there is a risk in the current canned food packaging; otherwise, there is no risk. The determination result of the determination module is applied to the triggering condition of the warning prompt in the warning module.
[0038] Furthermore, the camera module is interconnected with the preprocessing module and the storage module through a local area network. The lower level of the storage module is interconnected with a binding unit and a queue unit through a local area network. The storage module is interconnected with the determination module and the analysis module through a local area network. The analysis module is interconnected with the queue unit through a local area network. The analysis module is interconnected with the warning module through a local area network. The warning module is interconnected with the determination module through a local area network.
[0039] Adopting the technical solution provided by the present invention, compared with the known prior art, it has the following beneficial effects:
[0040] The present invention collects image data of canned foods undergoing encapsulation processing and the running images of encapsulation components on canned food encapsulation equipment through a camera, obtains the contour of the canned food from the image data, and obtains the movement trajectory of the encapsulation components from the image data. Then, by comparing the contour and trajectory of the canned food with the standard contour and trajectory, it realizes a higher-precision encapsulation detection based on machine vision, ensuring the effectiveness and safety of the encapsulation of the encapsulated food.
[0041] Meanwhile, during the acquisition stage of the canned food image data, continuous optimization processing is performed on the acquired canned food image data, so that the canned food image data undergoes bilateral filtering, guided filtering, and adaptive histogram equalization processing to output higher-quality canned food image data for the extraction of the canned food contour, improving the contour extraction accuracy, and further improving the accuracy of the system operation output result.
[0042] Furthermore, based on the comprehensive analysis of the determination results of whether the historical canned food encapsulation is qualified, real-time monitoring of the canned food encapsulation risk is implemented, and an early warning logic is configured to issue an early warning prompt when there is a risk, ensuring that the canned prefabricated food encapsulation production line can more safely and stably promote the encapsulation production work. Brief Description of the Drawings
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings described below are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0044] Figure 1 It is a schematic structural diagram of a canned prefabricated food encapsulation detection system based on machine vision;
[0045] Figure 2 It is a schematic diagram of an example of the movement trajectory of the encapsulation component in the present invention. Detailed Embodiments
[0046] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.
[0047] The following further describes the present invention with reference to the embodiments.
[0048] Embodiment:
[0049] A canned prefabricated food packaging detection system based on machine vision according to this embodiment, as Figure 1 shown, includes:
[0050] A camera module for collecting image data of canned foods and image data of packaging components on a canned food packaging device;
[0051] The camera module is integrated by a high-definition industrial camera. The image data of canned foods collected by the operation of the camera module is the image data of canned foods after being packaged by the canned food packaging device. The image data of the packaging components on the canned food packaging device collected by the operation of the camera module is the image data of the movement trajectory of the packaging components during the packaging process of the canned foods by the device;
[0052] Among them, after the camera module collects the image data of the packaging components on the canned food packaging device, it picks up the first-frame image in the image data. The system-end user marks the tracking target points in the first-frame image, and captures the movement trajectory of the packaging components during the packaging process of the canned foods by the device based on the marked tracking target points;
[0053] A preprocessing module for receiving the image data of canned foods collected by the operation of the camera module and performing optimization processing on the image data of canned foods;
[0054] The optimization processing logic for the image data of canned foods in the preprocessing module is as follows:
[0055] The original image data of canned foods is denoted as I(x, y);
[0056] O(x, y) = α·B(x, y) + β·G(x, y) + γ·H(x, y);
[0057] In the formula: O(x, y) is the image data of canned foods after optimization processing; α, β, γ are fusion coefficients; B(x, y) is a bilateral filtering function; G(x, y) is a guided filtering function; H(x, y) is an adaptive histogram equalization function;
[0058] Among them, the sum of α, β, γ is 1, and 0 ≤ α, γ ≤ 1;
[0059] Through the above logical formula, it is defined to perform optimization processing on the original image data of canned foods;
[0060] The expressions of the bilateral filtering function, the guided filtering function, and the adaptive histogram equalization function are:
[0061]
[0062] Where: W(x,y) is the normalized weight; r is the radius of the filtering window; (i,j) is the window pixel index; f c (i,j) is the range Gaussian kernel function; f s (i,j) is the spatial Gaussian kernel function; w x is the window centered on pixel x; l is the index variable traversing all pixel positions in window w k ; w k is the window centered on pixel k; is window w k the variance of the guidance image within window w; θ g is the regularization parameter; is window w k the variance of the corresponding local region of the pixel at position l within window w on the guidance image; N k is the total number of pixels in the window centered on pixel k; P k is window w k the average value of the guidance image within window w; μ k is window w k the mean value of the guidance image within window w; L-1 is the maximum value in the preset gray level range; n is the product of the number of sub-image blocks obtained by horizontal segmentation and the number of sub-image blocks obtained by vertical segmentation of the image after segmentation processing of the output image based on the guidance filtering function; h ij (c) is the number of pixels with gray value c in sub-block (i,j); T is the contrast limit threshold;
[0063] Among them, T is a preset value. When the guidance filtering function operates, the output image of the bilateral filtering function is used as the guidance image;[[ID=�6]]
[0064] f c (i,j) is used to measure the pixel value difference, f s (i,j) is used to measure the spatial distance;
[0065]
[0066] In the formula: σ d is the standard deviation of the range Gaussian kernel; σ s is the standard deviation of the spatial Gaussian kernel;
[0067] Through the above logical formula, the specific form of the application function in the optimization processing logical formula of canned food image data is further defined;
[0068] A storage module, configured to receive the preprocessed canned food image data, obtain the motion trajectory of the packaging component in the image data of the packaging component on the canned food packaging device, and store the canned food image data and the motion trajectory of the packaging component;
[0069] The storage module is provided with a binding unit and a queue unit at a lower level. The binding unit is used to bind the pre-processed canned food image data with its corresponding encapsulation component movement trajectory. The queue unit is used to identify the acquisition time of the pre-processed canned food image data bound to each other and its corresponding encapsulation component movement trajectory, and sort the pre-processed canned food image data bound to each other and its corresponding encapsulation component movement trajectory based on time sequence.
[0070] Among them, the operations of the binding unit and the queue unit on the pre-processed canned food image data and its corresponding encapsulation component movement trajectory are both executed inside the storage module.
[0071] The determination module is used to upload the standard canned food image data and the standard movement trajectory of the encapsulation component on the encapsulation device, compare the similarity between the standard image data and the currently acquired canned food image data, and compare the standard movement trajectory with the currently obtained encapsulation component movement trajectory to determine whether the canned food encapsulation output by the current encapsulation device is qualified.
[0072] The standard canned food image data uploaded in the determination module is: after constructing a three-dimensional model based on the standard specifications and parameters of the canned food and rendering it, a model image intercepted on the three-dimensional model with reference to the posture of the canned food output by the canned food encapsulation device and the acquisition perspective of the canned food image data.
[0073] The standard movement trajectory of the encapsulation component on the encapsulation device uploaded in the determination module is: after constructing a three-dimensional model based on the structural parameters of the canned food encapsulation device, controlling the movement of the three-dimensional model to generate a three-dimensional model animation, and marking the tracking target points in the three-dimensional model animation to obtain the movement trajectory of the tracking target points in the three-dimensional model animation.
[0074] During the operation stage of the determination module, the contour images of the two are extracted from the standard image data and the currently acquired canned food image data, and the similarity between the contour image corresponding to the standard image data and the contour image corresponding to the currently acquired canned food image data is compared.
[0075]
[0076] In the formula: SIMM(A,A NORR ) represents the similarity between the contour image corresponding to the currently acquired canned food image data and the contour image corresponding to the standard image data; SIMM(L,L NORR ) represents the similarity between the currently obtained encapsulation component movement trajectory and the standard movement trajectory; Q1%, Q2% represent the preset determination thresholds.
[0077] Among them, the values of Q1% and Q2% are user-defined by the system end-users. Q1% and Q2% are initially set to 99% and 98%. When both Formula (1) and Formula (2) hold, it is determined that the canned food packaging output by the current packaging device is qualified; otherwise, it is determined that the canned food packaging output by the current packaging device is unqualified.
[0078] It should be noted that for SIMM(A, A NORR ) and SIMM(L, L NORR ), any similarity algorithm of a food in the prior art is selected for similarity calculation.
[0079] An analysis module, which is used to traverse the canned food image data and the movement trajectory of the packaging components stored in the storage module, and analyze the canned food packaging risk based on the canned food image data and the movement trajectory of the packaging components;
[0080] During the operation stage of the analysis module, the image data similarity comparison result and the movement trajectory comparison result of the historical operation of the determination module are obtained, and whether there is a risk in the current canned food packaging is analyzed based on the comparison results;
[0081]
[0082] In the formula: SIMM new (A, A NORR ), SIMM new-1 (A, A NORR ), SIMM new-2 (A, A NORR ) are the similarities between the contour images of the currently collected canned food image data and the contour images of the standard image data obtained from the latest three operations of the determination module; SIMM new (L, L NORR ), SIMM new-1 (L, L NORR ), SIMM new-2 (L, L NORR ) are the similarities between the currently obtained movement trajectory of the packaging components and the standard movement trajectory obtained from the latest three operations of the determination module;
[0083] Among them, when any one or more of Formula (1) and Formula (2) hold, it indicates that there is a risk in the current canned food packaging; otherwise, there is no risk. The determination result of the determination module is applied to the trigger condition of the warning prompt in the warning module;
[0084] A warning module, which is used to set the canned food packaging risk determination threshold, receive the canned food packaging risk analysis result in the analysis module, compare the analysis result with the set canned food packaging risk determination threshold, and trigger a warning prompt when the analysis result exceeds the canned food packaging risk determination threshold;
[0085] The camera module is interconnected with the preprocessing module and the storage module through a local area network. The storage module is interconnected with a binding unit and a queue unit through a local area network at a lower level. The storage module is interconnected with a determination module and an analysis module through a local area network. The analysis module is interconnected with the queue unit through a local area network. The analysis module is interconnected with an early warning module through a local area network. The early warning module is interconnected with the determination module through a local area network;
[0086] Among them, the early warning module is integrated by a speaker. The early warning module is installed on the surface of the canned food packaging equipment. The warning audio stored in the speaker is triggered by the early warning module based on the operation result to play the warning audio for warning.
[0087] In this embodiment, the camera module operates to collect image data of canned food and image data of the packaging components on the canned food packaging equipment. The preprocessing module operates later to receive the image data of canned food collected by the operation of the camera module and optimize the image data of canned food. The storage module further receives the image data of canned food that has completed preprocessing, obtains the movement trajectory of the packaging components in the image data of the packaging components on the canned food packaging equipment, stores the image data of canned food and the movement trajectory of the packaging components, the binding unit synchronously binds the image data of canned food that has completed preprocessing with its corresponding movement trajectory of the packaging components, the queue unit real-time identifies the acquisition time of the image data of canned food that has completed preprocessing and its corresponding movement trajectory of the packaging components that are mutually bound, sorts each mutually bound image data of canned food that has completed preprocessing and its corresponding movement trajectory of the packaging components based on the time sequence, and then the determination module uploads the standard image data of canned food and the standard movement trajectory of the packaging components on the packaging equipment, compares the similarity based on the standard image data and the currently collected image data of canned food, compares based on the standard movement trajectory and the currently obtained movement trajectory of the packaging components, and determines whether the canned food packaging output by the current packaging equipment is qualified. The analysis module operates to traverse the image data of canned food and the movement trajectory of the packaging components stored in the storage module, analyzes the canned food packaging risk based on the image data of canned food and the movement trajectory of the packaging components, and finally sets a canned food packaging risk determination threshold through the early warning module, receives the canned food packaging risk analysis result in the analysis module, and based on the comparison between the analysis result and the set canned food packaging risk determination threshold, triggers a warning prompt when the analysis result exceeds the canned food packaging risk determination threshold.
[0088] The above system can use machine vision to collect image data of canned foods and their packaging components, optimize the collected data, and then store it. The system will compare the currently collected image data of canned foods with the standard image data, and at the same time compare the actual and standard movement trajectories of the packaging components to determine whether the packaging is qualified. It can also analyze the packaging risks based on the stored image data and movement trajectories. When the analyzed risks exceed the set threshold, the system will issue a warning prompt to ensure the packaging quality of canned foods;
[0089] See Figure 2 As shown, this figure further shows an example of the movement trajectory of the packaging component. It should be noted that the contours of canned foods and the trajectories of packaging components are composed of points and lines in a three-dimensional environment.
[0090] In summary, in the above embodiments, the system collects image data of canned foods undergoing packaging processing and the running images of the packaging components on the canned food packaging equipment through a camera, obtains the contours of canned foods from the image data, and obtains the movement trajectories of the packaging components from the image data. Then, by comparing the contours and trajectories of canned foods and packaging components with the standard contours and trajectories, it realizes a higher-precision packaging detection based on machine vision, ensuring the effectiveness and safety of the packaging of packaged foods. At the same time, during the acquisition stage of the image data of canned foods, continuous optimization processing is performed on the acquired image data of canned foods, so that the image data of canned foods passes through bilateral filtering, guided filtering, and adaptive histogram equalization processing to output higher-quality image data of canned foods for the extraction of the contours of canned foods, improving the accuracy of contour extraction, and further improving the accuracy of the system operation output results. Moreover, based on the comprehensive analysis of the determination results of whether the historical canned food packaging is qualified, the packaging risks of canned foods are monitored in real time, and a warning logic is configured to issue a warning prompt when there is a risk, ensuring that the packaging production line of canned prefabricated foods can promote the packaging production work more safely and stably.
[0091] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A canned prefabricated food packaging detection system based on machine vision, characterized in that, Including: A camera module for collecting image data of canned foods and image data of the encapsulation components on the canned food encapsulation equipment; A preprocessing module for receiving the image data of canned foods collected by the operation of the camera module and performing optimization processing on the image data of canned foods; A storage module for receiving the image data of canned foods after the completion of preprocessing, obtaining the movement trajectories of the encapsulation components in the image data of the encapsulation components on the canned food encapsulation equipment, and storing the image data of canned foods and the movement trajectories of the encapsulation components; A determination module for uploading the standard image data of canned foods and the standard movement trajectories of the encapsulation components on the encapsulation equipment, comparing the similarity between the standard image data and the currently collected image data of canned foods, comparing the standard movement trajectories with the currently obtained movement trajectories of the encapsulation components, and determining whether the canned food encapsulation output by the current encapsulation equipment is qualified; An analysis module for traversing the image data of canned foods and the movement trajectories of the encapsulation components stored in the storage module and analyzing the canned food encapsulation risks based on the image data of canned foods and the movement trajectories of the encapsulation components; An early warning module for setting a threshold for determining canned food encapsulation risks, receiving the results of the canned food encapsulation risk analysis in the analysis module, comparing the analysis results with the set threshold for determining canned food encapsulation risks, and triggering an early warning prompt when the analysis results exceed the threshold for determining canned food encapsulation risks; Among them, the early warning module is integrated by a speaker. The early warning module is installed on the surface of the canned food encapsulation equipment. The early warning audio stored in the speaker is triggered by the operation result of the early warning module to play the early warning audio for early warning prompts.
2. The canned prefabricated food packaging detection system based on machine vision according to claim 1, characterized in that, The camera module is integrated by a high-definition industrial camera. The image data of canned foods collected by the operation of the camera module is the image data of canned foods after the encapsulation process is completed by the canned food encapsulation equipment. The image data of the encapsulation components on the canned food encapsulation equipment collected by the operation of the camera module is the image data of the movement trajectories of the encapsulation components during the process of the equipment encapsulating canned foods; Among them, after the camera module collects the image data of the encapsulation components on the canned food encapsulation equipment, it picks up the first frame image in the image data. The system-side user marks the tracking target points on the first frame image, and captures the movement trajectories of the encapsulation components during the process of the equipment encapsulating canned foods in the image data based on the marked tracking target points.
3. A canned prefabricated food packaging detection system based on machine vision according to claim 1, characterized in that, The optimization processing logic for the image data of canned foods in the preprocessing module is as follows: The original image data of canned foods is denoted as I(x, y); O(x, y) = α·B(x, y) + β·G(x, y) + γ·H(x, y); In the formula: O(x, y) is the image data of canned foods after optimization processing; α, β, and γ are fusion coefficients; B(x, y) is a bilateral filtering function; G(x, y) is a guided filtering function; H(x, y) is an adaptive histogram equalization function; Among them, the sum of α, β, and γ is 1, and 0 ≤ α, γ ≤ 1.
4. The canned prefabricated food packaging detection system based on machine vision according to claim 3, characterized in that, The expressions of the bilateral filtering function, the guided filtering function, and the adaptive histogram equalization function are: Where: W(x,y) is the normalized weight; r is the radius of the filtering window; (i,j) is the window pixel index; f c (i,j) is the range Gaussian kernel function; f s (i,j) is the spatial Gaussian kernel function; w x is the window centered on pixel x; l is the index variable for traversing all pixel positions within window w k within; w k is the window centered on pixel k; is the variance of the guidance image within window w k ; θ g is the regularization parameter; is the variance of the corresponding local region of the pixel at position l within window w k on the guidance image; N k is the total number of pixels in the window centered on pixel k; P k is the mean value of the guidance image within window w k ; μ k is the mean value of the guidance image within window w k ; L-1 is the maximum value in the preset gray level range; n is the product of the number of sub-image blocks obtained by horizontal segmentation and the number of sub-image blocks obtained by vertical segmentation of the output image of the guided filtering function after segmentation processing; h ij (c) is the number of pixels with gray value c in sub-block (i,j); T is the contrast limit threshold; Among them, T is a preset value. When the guided filtering function operates, it uses the output image of the bilateral filtering function as the guidance image.
5. The canned prefabricated food packaging detection system based on machine vision according to claim 4, characterized in that, The f c (i, j) is used to measure the pixel value difference, and f s (i, j) is used to measure the spatial distance; The Where: σ d is the standard deviation of the range Gaussian kernel; σ s is the standard deviation of the spatial Gaussian kernel.
6. The canned prefabricated food packaging detection system based on machine vision according to claim 1, characterized in that, A binding unit and a queue unit are provided at a lower level of the storage module. The binding unit is used to bind the pre-processed canned food image data with its corresponding movement trajectory of the packaging component. The queue unit is used to identify the acquisition time of the pre-processed canned food image data bound to each other and its corresponding movement trajectory of the packaging component, and sort the pre-processed canned food image data bound to each other and its corresponding movement trajectory of the packaging component based on the time sequence. Among them, the operations of the binding unit and the queue unit on the pre-processed canned food image data and its corresponding movement trajectory of the packaging component are both executed inside the storage module.
7. A canned pre-packaged food packaging detection system based on machine vision according to claim 1, characterized in that, The standard canned food image data uploaded in the determination module is: after constructing a three-dimensional model based on the standard specification parameters of canned food and rendering it, a model image intercepted on the three-dimensional model with reference to the posture of the canned food output by the canned food packaging equipment and the image data acquisition perspective of the canned food. The standard movement trajectory of the packaging component on the packaging equipment uploaded in the determination module is: after constructing a three-dimensional model based on the structural parameters of the canned food packaging equipment, controlling the movement of the three-dimensional model to generate a three-dimensional model animation, and marking the tracking target points in the three-dimensional model animation to obtain the movement trajectory of the tracking target points in the three-dimensional model animation.
8. A canned prefabricated food packaging detection system based on machine vision according to claim 1, characterized in that During the operation stage of the determination module, contour images of the standard image data and the currently acquired canned food image data are extracted, and the similarity between the contour image corresponding to the standard image data and the contour image corresponding to the currently acquired canned food image data is compared. Where: SIMM(A, A NORR ) represents the similarity between the contour image corresponding to the currently acquired canned food image data and the contour image corresponding to the standard image data; SIMM(L, L NORR ) represents the similarity between the motion trajectory of the currently obtained packaging component and the standard motion trajectory; Q1%, Q2% represent preset determination thresholds; Among them, the values of Q1% and Q2% are user-defined by the system end-user. Q1% and Q2% are initially set to 99% and 98%. When both formula (1) and formula (2) hold, it is determined that the canned food output by the current packaging equipment is qualified for packaging; otherwise, it is determined that the canned food output by the current packaging equipment is unqualified for packaging.
9. The canned prefabricated food packaging detection system based on machine vision according to claim 1, characterized in that During the operation stage of the analysis module, the image data similarity comparison results and the movement trajectory comparison results of the historical operation of the determination module are obtained, and whether there is a risk in the current canned food packaging is analyzed based on the comparison results. Where: SIMM new (A, A NORR )、SIMM new-1 (A, A NORR )、SIMM new-2 (A, A NORR ) is the similarity between the contour image corresponding to the currently collected canned food image data and the contour image corresponding to the standard image data obtained from the latest three runs of the determination module; SIMM new (L, L NORR )、SIMM new-1 (L, L NORR )、SIMM new-2 (L, L NORR ) is the similarity between the currently obtained motion trajectory of the encapsulation component and the standard motion trajectory obtained from the latest three runs of the determination module; Among them, when any one or more of formula (1) and formula (2) hold, it indicates that there is a risk in the current canned food packaging; otherwise, there is no risk. The determination result of the determination module is applied to the trigger condition of the warning prompt in the warning module.
10. A canned prefabricated food packaging detection system based on machine vision according to claim 1, characterized in that, The camera module is interactively connected with the pre-processing module and the storage module through a local area network. The lower level of the storage module is interactively connected with a binding unit and a queue unit through a local area network. The storage module is interactively connected with the determination module and the analysis module through a local area network. The analysis module is interactively connected with the queue unit through a local area network. The analysis module is interactively connected with the warning module through a local area network. The warning module is interactively connected with the determination module through a local area network.
Citation Information
Patent Citations
Appearance quality detection system for food packaging box production process
CN117830265A