A method and device for detecting false seal of food packaging
By using segmented conveyor belts and multiple imaging technologies in food packaging detection, the problem of the inability to identify sealing quality and trace information in the prior art is solved, and efficient and automated food packaging quality is achieved Control improves detection accuracy and efficiency.
Patent Information
- Application Number
- CN202410847269.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-06-27
AI Technical Summary
Existing food packaging inspection technology cannot accurately identify sealing quality and conduct appearance inspection and information traceability, resulting in production safety hazards and economic losses.
Using segmented conveyor belts and a variety of imaging technologies, including line sweep and ray perspective technology, the surface images of food packaging are captured through line sweep, internal images are captured through ray perspective, and image fusion and preprocessing are carried out, combining OCR recognition algorithms and Defect identification algorithm realizes comprehensive inspection of the internal and external quality of food packaging.
It realizes high-precision detection of the internal and external quality of food packaging, identifying problems such as virtual sealing, oil clamping, and clamping, and provides comprehensive internal and external quality inspection and product traceability functions of food packaging, improving detection efficiency and accuracy, and reducing Economic losses and brand image damage.
Smart Images

Figure CN118392884B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of food detection, and in particular to a method and a device for detecting false seals in food packages. Background Art
[0002] At present, the small package food inspection machines on the market mainly rely on X-ray technology to check for foreign objects inside food packaging products, such as stainless steel wire, stainless steel balls, stones, glass balls, cartilage, high-density plastics, etc. Although this technology can detect whether there are harmful substances inside the packaging to a certain extent, it cannot accurately identify quality problems at the seal, such as false seals, oil inclusions, material inclusions, etc. This makes it difficult for manufacturers to fully and efficiently guarantee the quality of food packaging when facing large-scale production tasks. Although the unqualified rate of food packaging machines has been controlled at a relatively low level (0.3%), due to the huge daily production base, a considerable number of defective products will still appear, causing great economic losses and brand image damage to manufacturers.
[0003] In addition, existing X-ray technology-based detection equipment is also unable to perform appearance inspection and information traceability, which limits the comprehensiveness and accuracy of food quality testing, cannot meet increasingly stringent market demands, and poses a production safety hazard. Summary of the invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the problem in the prior art that food packaging detection cannot accurately identify the sealing quality and cannot perform appearance detection and information traceability.
[0005] In order to solve the above technical problems, the present invention provides a method for detecting a food package seal failure, comprising the following steps:
[0006] S1: providing a segmented conveyor belt with gaps between the belts, on which a first position, a second position and a third position are sequentially arranged along a transmission direction; when a food package passes through the first position, photographing a first surface of the food package through the gaps between the belts by line scanning to obtain a first line scan image; and detecting a surface quality of the first surface based on the first line scan image;
[0007] S2: when the food package passes through the second position, photographing the second surface of the food package by line scanning to obtain a second line scan image; and at the same time, detecting the surface quality of the second surface based on the second line scan image;
[0008] S3: when the food package is transferred from the second position to the third position, preprocessing the second line scan image to remove surface information to obtain a first preprocessed image;
[0009] S4: when the food package passes through the third position, photograph the food package by means of ray perspective to obtain a perspective image; and linearly transform the perspective image by means of a linear transformation matrix to obtain a second preprocessed image;
[0010] S5: According to a preset fusion ratio, the first preprocessed image and the second preprocessed image are fused to obtain a fused image; and the internal quality of the food package is detected based on the fused image.
[0011] In one embodiment of the present invention, based on the first line scan image, product information on the first surface is collected and analyzed; based on the second line scan image, product information on the second surface is collected and analyzed; the product information includes production date and batch information.
[0012] In one embodiment of the present invention, the product information on the first surface is analyzed by an OCR recognition algorithm and a defect recognition algorithm; and the product information on the second surface is analyzed by an OCR recognition algorithm and a defect recognition algorithm.
[0013] In one embodiment of the present invention, in S3, the method of preprocessing the second line scan image to remove surface information is as follows:
[0014] S31: Extracting a red R channel component image from the second line scan image according to the blue background At the same time, the second line scan image is converted from the RGB color space to the HSV color space, and the saturation S component of the image is extracted. ;
[0015] S32: The image With the image Mix at a preset mixing ratio to obtain a mixed image ;
[0016] S33: According to a preset hard threshold H, the mixed image Perform binarization operation to obtain a binary image ;
[0017] S34: Binarizing the image Invert the image to obtain an inverted image ;
[0018] S35: Reverse the image from A block that meets the preset characteristics is selected, and the closed area in the block is filled. After all the blocks are filled, a first preprocessed image with surface information removed is obtained.
[0019] In one embodiment of the present invention, in S35, the preset characteristics include a preset area range and an outer diameter range.
[0020] In one embodiment of the present invention, in S4, the linear transformation matrix is obtained by image calibration, and the method of image calibration is as follows:
[0021] S41: collecting a plurality of groups of images within different fields of view of the calibration plate by using a line scanning shooting method and a ray perspective shooting method respectively;
[0022] S42: Obtaining coordinates of several boundary points of the calibration plate in each group of images;
[0023] S43: calculating, according to the coordinates of the boundary points, an offset, a scaling ratio, and an angle difference between images acquired by the line scan shooting method and the ray fluoroscopy shooting method;
[0024] S44: Obtain a linear transformation matrix according to the offset, scaling ratio and angle difference.
[0025] In one embodiment of the present invention, a polygonal hollow is provided in the calibration plate; the boundary point coordinates of the calibration plate include the vertex coordinates of the calibration plate and the vertex coordinates of the polygonal hollow.
[0026] The present invention also provides a food packaging loose seal detection device, which is used to implement the food packaging loose seal detection method, and is characterized by comprising:
[0027] A conveying mechanism, comprising a first conveyor belt and a second conveyor belt arranged along a first direction, wherein a belt gap is provided between the first conveyor belt and the second conveyor belt; the food package is sequentially transported along the first direction through the first conveyor belt, the belt gap and the second conveyor belt;
[0028] The detection mechanism comprises a first line scanning assembly, a second line scanning assembly and a radiographic fluoroscopic assembly which are arranged on both sides of the conveying assembly along the second direction; the first line scanning assembly is used to shoot the first side of the food package through the gap between the belts by line scanning to obtain a first line scanning image; the second line scanning assembly shoots the second side of the food package by line scanning to obtain a second line scanning image; the radiographic fluoroscopic assembly is used to shoot the food package by radiographic fluoroscopic method to obtain a fluoroscopic image;
[0029] An image fusion and detection module is electrically connected to each component in the detection mechanism, and is used to detect the surface quality of the first surface based on the first line scan image, detect the surface quality of the second surface based on the second line scan image, obtain the first preprocessed image, obtain the second preprocessed image, obtain the fused image, and detect the internal quality of the food package based on the fused image.
[0030] In one embodiment of the present invention, a height difference is provided between the first conveyor belt and the second conveyor belt, and the height difference prevents the food package from being deflected along the first direction when passing through the gap between the belts.
[0031] In one embodiment of the present invention, in a first direction, a food package is photographed by a first line scanning assembly, a second line scanning assembly and a radiographic assembly in sequence; in a second direction, the first line scanning assembly is arranged on one side of a conveying mechanism, and the second line scanning assembly and the radiographic assembly are arranged on the other side of the conveying mechanism.
[0032] In one embodiment of the present invention, the first line scanning assembly is arranged opposite to the gap between the belts, and the second line scanning assembly and the radiographic assembly are arranged opposite to the second conveyor belt.
[0033] In one embodiment of the present invention, in a first direction, the length of the first conveyor belt is smaller than the length of the second conveyor belt.
[0034] In one embodiment of the present invention, the first line scan assembly includes a first line scan camera and a first light source device, and the first light source device is arranged on the optical path of the first line scan camera to provide lighting for it; the second line scan assembly includes a second line scan camera and a second light source device, and the second light source device is arranged on the optical path of the second line scan camera to provide lighting for it; the radiation perspective assembly includes a radiation source and a receiver, and at least a portion of the second conveyor belt is arranged between the radiation source and the receiver.
[0035] In one embodiment of the present invention, both the first light source device and the second light source device are tunnel light generating devices.
[0036] In one embodiment of the present invention, in the first direction, a rejection mechanism is further provided at the end of the second conveyor belt, and the rejection mechanism is provided with at least two flow guiding directions.
[0037] The above technical solution of the present invention has the following beneficial effects compared with the prior art:
[0038] Firstly, the present invention realizes a comprehensive inspection of the internal and external quality of food packaging by combining line scanning and radiographic perspective technology; wherein, the line scanning technology can clearly capture the surface condition of the food packaging, including surface damage, stains and product information; the rapid processing and fusion of radiographic perspective images and line scanning images provides a means of inspection that can see through the inside of the food packaging with clear boundaries, thereby identifying and detecting problems such as false seals, oil inclusions, and material inclusions; the present invention has comprehensive internal and external quality inspection of food packaging and product traceability functions, has a wide range of applications, and can be applied to most small package food industries.
[0039] Secondly, the present invention realizes high-precision detection of food packaging through automated equipment and efficient processing algorithms; by optimizing the belt line structure (the first conveyor belt that is shorter in the front and longer in the back and the second conveyor belt, and the height difference between the two), it ensures that the product will not be offset during material transfer, reduces the possibility of negative effects such as image stretching, and improves the accuracy of image fusion and subsequent rejection.
[0040] Finally, the present invention reduces the image processing operation time, shortens the belt length, and reduces the floor space through the optimized imaging sequence (first line scan camera, second line scan camera, and X-ray perspective camera), thereby improving the overall computing efficiency; at the same time, the multi-channel simultaneous detection and image fusion processing technology provided makes the image imaging complete and beautiful, realizes stable and high-sensitivity detection, and improves the equipment detection efficiency; in addition, the light source device uses tunnel light to make the imaging effect clearer and the defect judgment accuracy is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein:
[0042] Figure 1 It is a flow chart of the method for detecting false seal of food packaging of the present invention;
[0043] Figure 2 is a red R channel component image in one embodiment of the present invention Schematic diagram of
[0044] Figure 3 is an image of the saturation S component in one embodiment of the present invention Schematic diagram of
[0045] Figure 4 A mixed image in one embodiment of the present invention Schematic diagram of
[0046] Figure 5 is a binarized image in one embodiment of the present invention Schematic diagram of
[0047] Figure 6 In one embodiment of the present invention, the image is reversed Schematic diagram of
[0048] Figure 7 is a schematic diagram of selected blocks and filling in an embodiment of the present invention;
[0049] Figure 8 is a schematic diagram of a first preprocessed image in an embodiment of the present invention;
[0050] Fig. 9 is a schematic diagram of a calibration plate image acquired by line scanning in an embodiment of the present invention;
[0051] Fig.10 is a schematic diagram of a calibration plate image collected by a ray perspective method in one embodiment of the present invention;
[0052] Fig.11 is a schematic diagram of a fused image in an embodiment of the present invention;
[0053] Fig.12 is a first cross-sectional view of the food packaging virtual seal detection method of the present invention;
[0054] Fig.13 is a second cross-sectional view of the food packaging virtual seal detection method of the present invention;
[0055] Fig.14 yes Fig.12 A partial enlarged view of point A in the middle.
[0056] Explanation of the reference numerals in the specification: 20, conveying mechanism; 21, first conveyor belt; 22, second conveyor belt; 23, gap between belts; 30, detection mechanism; 31, first line scan assembly; 311, first line scan camera; 312, first light source device; 32, second line scan assembly; 321, second line scan camera; 322, second light source device; 33, radiographic assembly; 331, radiographic source; 332, receiver; 40, rejection mechanism. DETAILED DESCRIPTION
[0057] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention. Embodiment 1
[0058] Reference Figure 1 As shown, the present invention provides a method for detecting a food package seal deficiency, comprising the following steps:
[0059] S1: providing a segmented conveyor belt with gaps between the belts, on which a first position, a second position and a third position are sequentially arranged along a transmission direction; when a food package passes through the first position, photographing a first surface of the food package through the gaps between the belts by line scanning to obtain a first line scan image; and detecting a surface quality of the first surface based on the first line scan image;
[0060] S2: when the food package passes through the second position, photographing the second surface of the food package by line scanning to obtain a second line scan image; and at the same time, detecting the surface quality of the second surface based on the second line scan image;
[0061] S3: when the food package is transferred from the second position to the third position, preprocessing the second line scan image to remove surface information to obtain a first preprocessed image;
[0062] S4: when the food package passes through the third position, photograph the food package by means of ray perspective to obtain a perspective image; and linearly transform the perspective image by means of a linear transformation matrix to obtain a second preprocessed image;
[0063] S5: According to a preset fusion ratio, the first preprocessed image and the second preprocessed image are fused to obtain a fused image; and the internal quality of the food package is detected based on the fused image.
[0064] Specifically, in step S1, a segmented conveyor belt with gaps between belts is provided to provide a carrying space for transmission detection of food packages, wherein the first position, the second position, and the third position are three detection areas spaced apart in the transmission direction; usually, the first position is located on or near the gap between belts to ensure that the first side of the food package can be photographed through the gap between belts by line scanning; the first side refers to the side of the food package close to the conveyor belt, which is photographed by line scanning during the process of being transmitted from the first section of the conveyor belt to the second section of the conveyor belt; the surface quality of the first side can be detected by using the first line scan image and image processing technology, such as whether there is damage, stains, etc.; at the same time, based on the first line scan image, a data basis is also provided for obtaining product information on the first side.
[0065] In step S2, the second position is usually located on the second section of the conveyor belt, that is, behind the gap between the belts in the conveying direction; therefore, when the food package continues to be conveyed and passes through the second position, the second side of the food package can be photographed by line scanning, and the second side refers to the side of the food package away from the conveyor belt, so that the second line scan image can be obtained; similar to step S1, the surface quality of the second side can be detected based on the second line scan image; so far, through steps S1 and S2, comprehensive shooting and detection of both sides of the food package can be obtained, leaving no blind spots on the packaging surface.
[0066] In step S3, the third position is usually also located on the second conveyor belt and is located behind the second position in the transmission direction; in this step, the time for the food package to be transmitted from the second position to the third position is used to perform image preprocessing on the second first-arrival image; the purpose of this preprocessing is to deduct the surface information of the image, enhance the visibility of the boundary structure of the food package, and obtain the first preprocessed image in preparation for the subsequent fusion with the perspective image.
[0067] In step S4, when the food package reaches the third position, the food package is photographed using a ray perspective method (such as X-ray) to obtain a perspective image, which can provide an image of the interior of the food package; then, the perspective image is linearly transformed using a linear transformation matrix to correct image distortion and scale difference to obtain a second preprocessed image; linear transformation can ensure the consistency of the perspective image and the line scan image in space and scale, which facilitates subsequent image fusion.
[0068] In step S5, by fusion of images according to a preset fusion ratio, a fused image combining the advantages of line scanning and perspective shooting methods is obtained to comprehensively display the internal and external conditions of the food package, wherein the preset fusion ratio is based on ensuring the clarity of image fusion and the obviousness of feature display; at the same time, based on the fused image, the internal quality of the food package can be further detected, such as whether there are problems such as false seals, material clamping, oil seals, etc.; so far, the problem of the inability to accurately identify the sealing quality in the prior art is solved through image fusion detection, and the problem of the inability to perform appearance detection and information traceability in the prior art is solved through line scanning detection, thereby realizing comprehensive detection of the internal and external quality of food packaging, and providing an efficient and automated quality control method.
[0069] In a specific implementation, based on the first line scan image, product information on the first surface is collected and analyzed; based on the second line scan image, product information on the second surface is collected and analyzed; the product information includes production date and batch information. The product information on the first surface is analyzed by an OCR recognition algorithm and a defect recognition algorithm; the product information on the second surface is analyzed by an OCR recognition algorithm and a defect recognition algorithm.
[0070] Specifically, the OCR recognition algorithm can identify and extract text information in the first and second side images, and convert it into editable text by analyzing the morphological features of the text, thereby realizing the automatic reading of the production date and batch information on the food packaging; the intelligent defect recognition algorithm can perform quality inspection on the extracted text information and identify abnormal conditions such as blur, missing, and misaligned text; the information extraction and verification mechanism of the above algorithm provides reliable data support for food quality traceability.
[0071] Reference Figure 2-8 As shown, in a specific implementation, in S3, the method for preprocessing the second line scan image to remove surface information is as follows:
[0072] S31: Extracting a red R channel component image from the second line scan image according to the blue background ; This is based on the principle of color separation, by extracting the red channel information, strengthening the red-related information in the image to highlight the features; at the same time, the second line scan image is converted from the RGB color space to the HSV color space, and the image of the saturation S component is extracted ;By extracting the saturation component, we can better distinguish areas of different colors.
[0073] S32: The image With the image Mix at a preset mixing ratio of 7:3 to obtain a mixed image ; Through the mixing operation, the image information containing two components, red intensity information and color saturation information, can be comprehensively utilized, thereby improving the information content and recognition of the image.
[0074] S33: According to the preset hard threshold H=200, the mixed image Perform binarization operation to obtain a binary image ; Based on the hard threshold, the pixel values in the mixed image are converted to 0 or 1 to simplify the image information and facilitate subsequent processing and analysis.
[0075] S34: Binarizing the image Invert the image to obtain an inverted image .
[0076] S35: Reverse the image from The blocks that meet the preset features are selected from the image, and the closed areas in the blocks are filled. After all the blocks are filled, a first pre-processed image with surface information removed is obtained; wherein the preset features include a preset area range and an outer diameter range. By filling, the holes or discontinuous areas inside the blocks can be eliminated, making the blocks more complete and continuous; after all the blocks are filled, the image obtained is the first pre-processed image with surface information removed that is not associated with subsequent image fusion.
[0077] Reference Figure 9-11 As shown, in a specific implementation, in S4, the linear transformation matrix is obtained by image calibration, and the method of image calibration is as follows:
[0078] S41: collecting a plurality of groups of images within different fields of view of the calibration plate by line scanning and ray perspective respectively; wherein the calibration plate has an aspect ratio of 2:1, an outer contour is a rectangle, an inner hollow contour is a rectangle, and is made of an aluminum plate.
[0079] S42: Acquire coordinates of several boundary points of the calibration plate in each set of images; the boundary point coordinates include coordinates of the four corners of the outer contour of the calibration plate and coordinates of the four corners of the inner hollowed-out contour.
[0080] S43: Calculate the distance between the images collected by the line scanning shooting method and the ray perspective shooting method according to the boundary point coordinates. x , y Direction offset, x , y Directional expansion ratio and angle difference.
[0081] S44: Obtain a linear change matrix in the coordinate systems of the two shooting modes according to the offset, the scaling ratio and the angle difference. The linear change matrix is used to perform a linear transformation on the image and eliminate linear distortion of the image. Embodiment 2
[0082] Reference Fig.12 , 14 As shown, the present invention also provides a food packaging loose seal detection device, which is used to implement the food packaging loose seal detection method, and is characterized by comprising:
[0083] The conveying mechanism 20 includes a first conveyor belt 21 and a second conveyor belt 22 arranged along a first direction, wherein a gap 23 is provided between the first conveyor belt 21 and the second conveyor belt 22; the food packages are sequentially transported along the first direction through the first conveyor belt 21, the gap 23 and the second conveyor belt 22;
[0084] The detection mechanism 30 includes a first line scanning component 31, a second line scanning component 32 and a radiographic component 33 which are arranged on both sides of the conveying component along the second direction; the first line scanning component 31 is used to shoot the first side of the food package through the inter-belt gap 23 by line scanning to obtain a first line scanning image; the second line scanning component 32 shoots the second side of the food package by line scanning to obtain a second line scanning image; the radiographic component 33 is used to shoot the food package by radiographic perspective to obtain a perspective image;
[0085] An image fusion and detection module is electrically connected to each component in the detection mechanism 30, and is used to detect the surface quality of the first surface based on the first line scan image, detect the surface quality of the second surface based on the second line scan image, obtain the first preprocessed image, obtain the second preprocessed image, obtain the fused image, and detect the internal quality of the food package based on the fused image.
[0086] Specifically, the first direction is the transmission direction of the food package, and the second direction is the perpendicular direction of the first direction; in the specific implementation, the order of photographing the food package is the first line scanning component 31 (located below the conveying mechanism 20), the second line scanning component 32 (located above the conveying mechanism 20), and the ray perspective component 33 (located next to the second line scanning component 32); the reason for adopting the above arrangement structure is: when the transmission speed of the first conveyor belt 21 and the second conveyor belt 22 are consistent, the image fusion and detection module takes a long time to process the line scanning image, while for the processing time period of the perspective image, the line scanning component is placed at the front end of the ray perspective component 33, so that the image fusion and detection module can process the line scanning image first, thereby shortening the length from the second conveyor belt 22 to the subsequent mechanism, thereby reducing the total time of image processing, shortening the overall length of the conveyor belt, reducing the floor space, and improving the efficiency of the whole machine.
[0087] Reference Fig.13 As shown, a height difference is provided between the first conveyor belt and the second conveyor belt 22, and the height difference prevents the food package from being deviated along the first direction when passing through the gap 23 between the belts; at the same time, by setting the height difference, the clarity of the first line scan camera 311 in photographing the food package passing through the gap 23 between the belts can also be enhanced.
[0088] Reference Fig.12 , 14 As shown, in the first direction, the food package is photographed by the first line scanning assembly 31, the second line scanning assembly 32 and the radiographic assembly 33 in sequence; in the second direction, the first line scanning assembly 31 is arranged on one side of the conveying mechanism 20, and the second line scanning assembly 32 and the radiographic assembly 33 are arranged on the other side of the conveying mechanism 20.
[0089] Reference Fig.12 , 14 As shown, the first line scanning assembly 31 is arranged opposite to the inter-belt gap 23 , and the second line scanning assembly 32 and the radiographic assembly 33 are arranged opposite to the second conveyor belt 22 .
[0090] Reference Fig.12 , 14As shown, in the first direction, the length of the first conveyor belt 21 is less than the length of the second conveyor belt 22. In a specific implementation, the first line scanning component 31 detects the food packaging on the inter-belt gap 23, and the second first-arrival component and the radiographic component 33 detect the food packaging on the second conveyor belt 22; therefore, the length of the first conveyor belt 21 can be shortened, so that the food packaging can pass through the inter-belt gap 23 as quickly as possible and enter the subsequent detection process; and in order to achieve the accuracy of the fusion of the second line scanning image and the radiographic image, the second line scanning component 32 and the radiographic component 33 need to be set on the same belt surface (the second conveyor belt 22), specifically to avoid the deflection caused by the food packaging passing through the inter-belt gap 23, which affects the accuracy of image fusion; at the same time, this detection accuracy will also affect the accuracy of subsequent rejection operations.
[0091] Reference Fig.12 , 14 As shown, the first line scan assembly 31 includes a first line scan camera 311 and a first light source device 312, and the first light source device 312 is arranged on the optical path of the first line scan camera 311 to provide lighting for it; the second line scan assembly 32 includes a second line scan camera 321 and a second light source device 322, and the second light source device 322 is arranged on the optical path of the second line scan camera 321 to provide lighting for it; the ray perspective assembly 33 includes a ray source 331 and a receiver 332, and at least a part of the second conveyor belt 22 is arranged between the ray source 331 and the receiver 332. The first light source device 312 and the second light source device 322 both use tunnel light generating devices.
[0092] Specifically, the first light source device 312 in the first line scan component 31 is arranged on the optical path of the first line scan camera 311, aiming to provide stable and uniform lighting for it during the scanning and shooting process, so as to improve the accuracy of image recognition; wherein, the first light source device 312 adopts a tunnel light generating device, which can generate uniform and high-brightness light to optimize the lighting conditions; the second line scan component 32 adopts a structural setting similar to the first line scan component 31; the ray perspective component 33 is composed of a ray source 331 and a receiver 332, wherein at least a portion of the second conveyor belt 22 (usually the belt surface) is between the ray source 331 and the transmitter, and when the food packaging passes through this portion, the perspective image can be taken.
[0093] Reference Fig.12 , 14 As shown, in the first direction, a rejection mechanism 40 is further provided at the end of the second conveyor belt 22, and the rejection mechanism 40 is provided with at least two flow guiding directions.
[0094] Specifically, the rejection mechanism 40 can divert items to different processing paths according to different detection results; for example, when there are problems such as oil and material inclusions in the seal, internal foreign matter, surface contamination, surface text printing errors, etc., the rejection mechanism 40 can guide them to the defective product path, thereby removing the defective products from the main conveying flow to improve the intelligence and automation of automatic detection.
[0095] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0096] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0097] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0099] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.
Claims
1. A method for detecting false seal of food packaging, characterized in that: The steps include: S1: providing a segmented conveyor belt with gaps between the belts, on which a first position, a second position and a third position are sequentially arranged along a transmission direction; when a food package passes through the first position, photographing a first surface of the food package through the gaps between the belts by line scanning to obtain a first line scan image; and detecting a surface quality of the first surface based on the first line scan image; S2: when the food package passes through the second position, photographing the second surface of the food package by line scanning to obtain a second line scan image; and at the same time, detecting the surface quality of the second surface based on the second line scan image; S3: When the food package is transferred from the second position to the third position, the second line scan image is preprocessed to remove surface information to obtain a first preprocessed image; in S3, the method for preprocessing the second line scan image to remove surface information is as follows: S31: Extracting a red R channel component image I from the second line scan image according to the blue background R At the same time, the second line scan image is converted from the RGB color space to the HSV color space, and the saturation S component of the image I is extracted. S ; S32: The image I R With the image I S Mix at a preset mixing ratio to obtain a mixed image I M ; S33: According to a preset hard threshold H, the mixed image I M Perform the binarization operation to obtain the binary image I H ; S34: Binarization of the image I H Perform image inversion to obtain the inverted image I r ; S35: From the inverted image I r Selecting blocks that meet preset features and filling closed areas in the blocks, and obtaining a first preprocessed image with surface information removed after all blocks are filled, wherein the preset features include a preset area range and an outer diameter range; S4: When the food package passes through the third position, the food package is photographed by means of ray perspective to obtain a perspective image; the perspective image is linearly transformed by means of a linear transformation matrix to obtain a second preprocessed image; the linear transformation matrix is obtained by image calibration, and the method of image calibration is as follows: S41: collecting a plurality of groups of images within different fields of view of the calibration plate by using a line scanning shooting method and a ray perspective shooting method respectively; S42: Obtaining coordinates of several boundary points of the calibration plate in each group of images; S43: calculating, according to the coordinates of the boundary points, an offset, a scaling ratio, and an angle difference between images acquired by the line scan shooting method and the ray fluoroscopy shooting method; S44: Obtain a linear transformation matrix according to the offset, the scaling ratio, and the angle difference; S5: fusing the first preprocessed image with the second preprocessed image according to a preset fusion ratio to obtain a fused image; The internal quality of the food package is detected based on the fused image.
2. A method for detecting false seal of food packaging according to claim 1, characterized in that: Based on the first line scan image, product information on the first surface is collected and analyzed; based on the second line scan image, product information on the second surface is collected and analyzed; the product information includes production date and batch information.
3. A method for detecting false seal of food packaging according to claim 2, characterized in that: The product information on the first surface is analyzed by an OCR recognition algorithm and a defect recognition algorithm; the product information on the second surface is analyzed by an OCR recognition algorithm and a defect recognition algorithm.
4. A method for detecting false seal of food packaging according to claim 1, characterized in that: The calibration plate is provided with a polygonal hollowing out; the boundary point coordinates of the calibration plate include the vertex coordinates of the calibration plate and the vertex coordinates of the polygonal hollowing out.
5. A food packaging loose seal detection device, used to implement the food packaging loose seal detection method according to any one of claims 1 to 4, characterized in that: include: A conveying mechanism, comprising a first conveyor belt and a second conveyor belt arranged along a first direction, wherein a belt gap is provided between the first conveyor belt and the second conveyor belt; the food package is sequentially transported along the first direction through the first conveyor belt, the belt gap and the second conveyor belt; The detection mechanism comprises a first line scanning assembly, a second line scanning assembly and a radiographic fluoroscopic assembly which are arranged on both sides of the conveying assembly along the second direction; the first line scanning assembly is used to shoot the first side of the food package through the gap between the belts by line scanning to obtain a first line scanning image; the second line scanning assembly shoots the second side of the food package by line scanning to obtain a second line scanning image; the radiographic fluoroscopic assembly is used to shoot the food package by radiographic fluoroscopic method to obtain a fluoroscopic image; An image fusion and detection module is electrically connected to each component in the detection mechanism, and is used to detect the surface quality of the first surface based on the first line scan image, detect the surface quality of the second surface based on the second line scan image, obtain the first preprocessed image, obtain the second preprocessed image, obtain the fused image, and detect the internal quality of the food package based on the fused image.
6. A food packaging virtual seal detection device according to claim 5, characterized in that: A height difference is set between the first conveyor belt and the second conveyor belt.
7. A food packaging virtual seal detection device according to claim 5, characterized in that: In the first direction, the food package is photographed by the first line scanning assembly, the second line scanning assembly and the radiographic assembly in sequence; in the second direction, the first line scanning assembly is arranged on one side of the conveying mechanism, and the second line scanning assembly and the radiographic assembly are arranged on the other side of the conveying mechanism.
8. A food packaging virtual seal detection device according to claim 7, characterized in that: The first line scanning assembly is arranged opposite to the gap between the belts, and the second line scanning assembly and the ray perspective assembly are arranged opposite to the second conveyor belt.
9. A food packaging virtual seal detection device according to claim 5, characterized in that: In a first direction, a length of the first conveyor belt is smaller than a length of the second conveyor belt.
10. A food packaging virtual seal detection device according to claim 5, characterized in that: The first line scan assembly includes a first line scan camera and a first light source device, and the first light source device is arranged on the optical path of the first line scan camera to provide lighting for it; the second line scan assembly includes a second line scan camera and a second light source device, and the second light source device is arranged on the optical path of the second line scan camera to provide lighting for it; the radiation perspective assembly includes a radiation source and a receiver, and at least a portion of the second conveyor belt is arranged between the radiation source and the receiver.
11. A food packaging virtual seal detection device according to claim 10, characterized in that: The first light source device and the second light source device both adopt tunnel light generating devices.
12. A food packaging virtual seal detection device according to claim 5, characterized in that: In the first direction, a rejection mechanism is further provided at the end of the second conveyor belt, and the rejection mechanism is provided with at least two flow guiding directions.
