A method, apparatus and system for seal detection
The detection mechanism, consisting of a light source and a detection camera, combined with image processing technology, automatically detects the sealing line and tilt angle of the inner and outer packaging bags, solving the problems of low efficiency and poor accuracy of manual detection in existing technologies, and achieving efficient and accurate seal detection.
Patent Information
- Application Number
- CN202511658696.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-13
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-11-13
AI Technical Summary
Current technology for detecting the sealing of medical consumable packaging relies on manual inspection, which is costly, inefficient, and prone to omissions and misjudgments, leading to the risk of sealing failure.
The inspection mechanism, consisting of a light source and an inspection camera, automatically detects the sealing line and tilt angle of the inner and outer packaging bags through image processing technology. It combines the least squares method and the Canny edge detection algorithm to achieve automated judgment of the sealing performance.
This improves the efficiency and accuracy of seal detection, avoids human error, and ensures the integrity and safety of medical consumable packaging.
Smart Images

Figure CN121113402B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sealing testing equipment technology, and in particular to a sealing testing method, device and system. Background Technology
[0002] After the production of medical devices such as medical consumables is completed, two layers of packaging are required. The first layer is an inner packaging bag, which uses a light blue medical paper-plastic bag, and the second layer is a transparent polyvinyl chloride plastic packaging bag.
[0003] The requirements for sealed packaging are that the first layer of seal must not be unsealable, and the second layer of packaging bag must not be unsealable or misaligned. Otherwise, the seal will fail, and medical devices such as medical consumables may be contaminated, leading to medical accidents.
[0004] In existing technologies, the sealing of medical consumables and other medical supplies packaging is mostly checked by manual observation, which is costly, inefficient, and prone to omissions and misjudgments due to fatigue during long-term inspections. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a sealing detection method to alleviate the problems of high cost, low inspection efficiency, and easy omissions and misjudgments in the prior art due to manual observation.
[0006] In a first aspect, this application provides a sealing detection method applied to a control unit in a sealing detection system, the system further comprising:
[0007] The inspection mechanism includes a light source and an inspection camera. The light source includes a surface light source and an arched tunnel light source. The light-emitting end of the surface light source faces the object to be inspected. The arched tunnel light source is located on the side of the object to be inspected away from the surface light source. The inspection camera is located on the side of the arched tunnel light source away from the object to be inspected, with its inspection end facing the object to be inspected. There are two inspection mechanisms, forming a first inspection station and a second inspection station, which are used to inspect the two sides of the object to be inspected, respectively.
[0008] The method includes:
[0009] Acquire images taken at the target location;
[0010] Extract the inner packaging area and the outer packaging contour from the captured image;
[0011] Determine whether the distance between the edge of the inner packaging bag and the outline of the outer packaging is greater than a specified number of pixels;
[0012] If so, the sealing line of the inner packaging bag is fitted to obtain the sealing line fitting result. At the same time, the sealing line of the outer packaging is extracted, and the tilt angle of the outer packaging sealing line relative to the edge of the outer packaging is determined.
[0013] Based on the sealing line fitting results, the outer packaging sealing line, and the tilt angle of the outer packaging sealing line, the sealing test results are obtained.
[0014] In conjunction with the first aspect, the present invention provides a first possible implementation of the first aspect, comprising the step of obtaining a sealing detection result based on the fitting result of the inner packaging bag sealing line, the outer packaging sealing line, and the inclination angle of the outer packaging sealing line, including:
[0015] If the fitting result of the inner packaging bag sealing line, the outer packaging sealing line and the tilt angle all meet the preset requirements, the sealing test result is determined to be a good seal.
[0016] In conjunction with the first aspect, the present invention provides a first possible implementation of the first aspect, comprising the step of fitting a sealing line to the inner packaging bag to obtain a sealing line fitting result, including:
[0017] After extracting the edge lines from the captured image, each edge line is shifted inward by a specified number of pixels to obtain the baseline.
[0018] For each baseline, an edge-finding operator is used to find the sealing line, resulting in several points.
[0019] Determine whether a fitted sealing line can be obtained after applying a linear fit to several points using a specified algorithm.
[0020] If so, the sealing line fitting result is deemed acceptable.
[0021] If not, the sealing line fitting result is determined to be abnormal.
[0022] In conjunction with the first aspect, this embodiment of the invention provides a first possible implementation of the first aspect, specifying the algorithm as an improved least squares method; the step of determining whether a fitted sealing line can be obtained after linear fitting of several points using the specified algorithm includes:
[0023] Two sampling points are randomly selected from a number of points to determine a temporary straight line;
[0024] Calculate the distance from all other points to the temporary line, and include target points whose distance is less than a preset threshold into the consensus set to obtain multiple consensus sets;
[0025] The consensus set corresponding to the temporary straight line with the most target points in the consensus set is selected as the maximum consensus set.
[0026] Based on all target points in the consensus set, the least squares method is used to perform the final fitting to obtain the fitted straight line equation of the sealing line.
[0027] The continuity of the sealing line is judged based on the goodness of fit of the fitted linear equation or the proportion of internal target points in the consensus set.
[0028] In conjunction with the first aspect, the present invention provides a first possible implementation of the first aspect, the steps of extracting the outer packaging sealing line and determining the inclination angle of the outer packaging sealing line relative to the edge of the outer packaging further comprising:
[0029] The captured image is enhanced to obtain the enhanced captured image;
[0030] Canny edge extraction was performed on the captured image to extract the edge lines on both sides of the entire outer packaging bag.
[0031] For each edge line, shift inward by a specified number of pixels to extract the outer packaging seal line.
[0032] Determine whether the angle between the outer packaging seal line and the outer packaging edge line is less than a preset angle threshold.
[0033] If so, confirm that the outer packaging bag is properly sealed.
[0034] If not, check that the sealing line on the outer packaging bag is tilted.
[0035] In conjunction with the first aspect, embodiments of the present invention provide a first possible implementation of the first aspect, comprising the step of enhancing a captured image, including:
[0036] Obtain the preset target grayscale range;
[0037] Analyze the grayscale histogram of the captured image and determine the feature grayscale range representing effective information in the captured image based on the histogram shape;
[0038] Calculate the linear transformation coefficients based on the target grayscale range and the feature grayscale range; the linear transformation coefficients include the gain parameter and the offset parameter.
[0039] After performing point operations on the captured image to calculate the square of the gray level of each pixel, a linear transformation is performed based on the gain parameter and the offset parameter to obtain the enhanced captured image.
[0040] In conjunction with the first aspect, embodiments of the present invention provide a first possible implementation of the first aspect, comprising the step of calculating linear transformation coefficients based on a target grayscale range and a feature grayscale range, including:
[0041] Calculate using the following formula:
[0042] α = (Z_max - Z_min)÷(X_high - X_low);
[0043] β = Z_min - (α × X_low)
[0044] Where α is the gain parameter, β is the offset parameter, Z_max is the upper limit of the target grayscale range, Z_min is the lower limit of the target grayscale range, X_high is the upper limit of the feature grayscale range, and X_low is the lower limit of the feature grayscale range.
[0045] In conjunction with the first aspect, the present invention provides a first possible implementation of the first aspect, which further includes, before the step of acquiring the captured image at the target point:
[0046] Obtain the packaging type of the target workpiece.
[0047] Determine the target location based on the packaging type.
[0048] Move the target workpiece to the target location.
[0049] Secondly, this application provides a sealing detection device, applied to a control unit in a sealing detection system, the device comprising:
[0050] The acquisition module is used to acquire images captured at the target location.
[0051] The extraction module is used to extract the inner packaging area and the outer packaging contour from the captured image.
[0052] The judgment module is used to determine whether the distance between the edge of the inner packaging bag and the outline of the outer packaging bag is greater than a specified number of pixels.
[0053] The fitting module is used to fit the sealing line of the inner packaging bag when the distance between the edge of the inner packaging bag and the outline of the outer packaging bag is greater than a specified number of pixels, and to obtain the sealing line fitting result. At the same time, it extracts the sealing line of the outer packaging bag and determines the tilt angle of the sealing line of the outer packaging bag relative to the edge of the outer packaging bag.
[0054] The detection module is used to obtain the sealing detection result based on the sealing line fitting result, the outer packaging sealing line, and the tilt angle.
[0055] Thirdly, this application provides a sealing detection system, including a control unit, which is used to execute the sealing detection method provided above.
[0056] Furthermore, the system also includes:
[0057] The testing platform is made of a highly transparent material and is used to support the test object.
[0058] A transfer mechanism is used to pick up test items and transfer them to the testing platform, or to remove test items from the testing platform.
[0059] A conveying device is connected to the testing platform to drive the testing platform through the first testing station and the second testing station in sequence;
[0060] The first and second inspection stations each have multiple inspection points. The inspection platform stops at each inspection point so that the inspection camera can capture images of the object to be inspected at the corresponding location.
[0061] The embodiments of the present invention bring the following beneficial effects:
[0062] In this invention, the top and bottom surfaces of the object to be tested are photographed by a detection camera at the first and second detection stations, respectively. After the images are taken, the inner packaging area and the outer packaging contour are extracted. The sealing of the outer packaging is determined by whether the distance between the edge of the inner packaging bag and the outer packaging contour is greater than a specified number of pixels. After confirming that the outer packaging is sealed, the sealing performance of the inner packaging is determined by fitting the sealing line of the inner packaging bag. When both the inner and outer packaging are confirmed to be well sealed, the outer packaging sealing line is extracted again to determine the tilt angle of the outer packaging sealing line. Based on the above multiple tests, the sealing test result is finally obtained. The entire process does not require human intervention, has high detection efficiency, and is more accurate.
[0063] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0064] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0065] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0066] Figure 1 This is a flowchart provided for an embodiment of the present invention;
[0067] Figure 2 A schematic diagram of the sealing detection device is provided for embodiments of the present invention;
[0068] Figure 3 Axial view of the sealing detection system provided in the embodiment of the present invention Figure 1 ;
[0069] Figure 4 Axial view of the sealing detection system provided in the embodiment of the present invention Figure 2 ;
[0070] Figure 5 A top view of the sealing detection system provided in an embodiment of the invention;
[0071] Figure 6 This is a side view of the sealing detection system provided in an embodiment of the invention.
[0072] Figure label:
[0073] 1-Acquisition module; 2-Extraction module; 3-Judgment module; 4-Fitting module; 5-Detection module;
[0074] 100-Detection platform; 200-Detection mechanism; 210-Detection camera; 220-Surface light source; 230-Arch tunnel light source; 300-Transfer mechanism; 310-Horizontal drive assembly; 311-First drive component; 312-Second drive component; 320-Longitudinal drive assembly; 330-Pickup assembly; 400-Transfer device; 500-Storage assembly; 510-Storage slot; 520-Baffle; 530-Proximity sensor. Detailed Implementation
[0075] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0076] To facilitate understanding of this embodiment, the technical terms used in this application will be briefly introduced below.
[0077] Blob analysis (connected component analysis) is a fundamental technique in machine vision and image processing used to detect, analyze, and process the features of connected regions (i.e., "blobs") in an image. A "blob" can be understood as a set of connected pixels in an image that share similar attributes (such as grayscale values, color, and texture). It typically corresponds to a "blob" or "region" in an image, such as parts or product defects (e.g., black spots, scratches) in industrial inspection, cells or tumors in medical images, vehicles in traffic monitoring, apples or faces in natural scenes, etc. "Analysis" refers to extracting various attributes from these connected regions and then filtering, counting, and measuring them.
[0078] Canny Edge Detection is an edge detection algorithm used in image processing. It is used to extract precise, continuous, and delicate edges from images. It accurately locates the boundaries of grayscale changes in digital images through a process of "denoising > gradient calculation > non-maximum suppression > double thresholding".
[0079] Example 1
[0080] The embodiments of the present invention provided in this application provide a sealing detection method applied to a control unit in a sealing detection system. The system further includes: a detection mechanism 200, including a light source and a detection camera 210. The light source includes a surface light source 220 and an arched tunnel light source 230. The light-emitting end of the surface light source 220 faces the object to be detected. The arched tunnel light source 230 is located on the side of the object to be detected away from the surface light source 220. The detection camera 210 is located on the side of the arched tunnel light source 230 away from the object to be detected, with its detection end facing the object to be detected. There are two detection mechanisms 200, forming a first detection station and a second detection station, respectively used to detect two sides of the object to be detected.
[0081] Combination Figure 1 As shown, the method is as follows:
[0082] S100: Acquire images of the target location.
[0083] The S200 extracts the inner packaging area and the outer packaging outline from the captured image.
[0084] S300 determines whether the distance between the edge of the inner packaging bag and the outline of the outer packaging bag is greater than a specified number of pixels.
[0085] If so, proceed with steps S400-S500.
[0086] S400: Fit the sealing line of the inner packaging bag to obtain the sealing line fitting result. At the same time, extract the sealing line of the outer packaging and determine the tilt angle of the outer packaging sealing line relative to the edge of the outer packaging.
[0087] S500 obtains the sealing test results based on the sealing line fitting results, the outer packaging sealing line, and the tilt angle.
[0088] Specifically, in this embodiment, the top and bottom surfaces of the object under the target point are photographed by the detection camera 210 at the first and second detection stations, respectively. After photographing, the inner packaging area and outer packaging contour are extracted from the images captured by the detection camera 210. Then, the sealing of the outer packaging is determined by whether the distance between the edge of the inner packaging bag and the outer packaging contour is greater than a specified number of pixels. After confirming that the outer packaging is sealed, the sealing performance of the inner packaging is determined by fitting a sealing line to the inner packaging bag. When both the inner and outer packaging are confirmed to be well sealed, the outer packaging sealing line is extracted again to determine the tilt angle of the outer packaging sealing line. Based on the above multiple tests, the final sealing test result is obtained. The entire detection process requires no human intervention, resulting in high detection efficiency and greater accuracy.
[0089] During detection, the detection camera 210, being a surface light source with an arched tunnel light source 230 circumferentially positioned, alleviates the glare problem of the medical consumable packaging bag while highlighting the seal of the outer packaging bag, ensuring detection accuracy. The surface light source 220 can illuminate internal sealing defects and contents issues, while the arched tunnel light source 230 can capture surface sealing defects and appearance flaws. This embodiment combines the two to enable a one-time, comprehensive detection of the sealing status of the test item using a sealing detection method.
[0090] Furthermore, the combined use of the surface light source 220 and the arched tunnel light source 230 can meet the lighting requirements of sealed inspection objects of different materials and structures. At the same time, it can also improve image quality and inspection accuracy. For specific defect types, the most suitable light source illumination mode or combination mode can be used to obtain images with higher contrast, clearer details, and less interference, thereby improving the accuracy and reliability of the sealing inspection method.
[0091] Specifically, in this embodiment, there are multiple target points, all of which are located in the first detection station and the second detection station. After the object to be detected is moved to the first detection station and the second detection station, the object to be detected is illuminated by the surface light source 220 and the arched tunnel, and the detection camera 210 takes pictures of the object to obtain the captured image.
[0092] It should be noted that in this embodiment, the specified pixel is 150 pixels. The distance between the edge of the inner packaging bag and the outline of the outer packaging is the straight-line distance between the sealing edge of one side of the inner packaging and the sealing edge of the nearest outer packaging bag.
[0093] In this embodiment, after step S300, the method further includes:
[0094] If not, proceed to step S310.
[0095] S310, the seal test result indicates that the outer packaging bag is not sealed.
[0096] In the step of determining whether the distance between the edge of the inner packaging bag and the outline of the outer packaging is greater than a specified number of pixels, if the distance is not greater than the specified number of pixels, the sealing detection result is directly determined to be that the outer packaging bag is not sealed. There is no need to perform subsequent processing such as sealing line fitting and tilt angle judgment, which reduces processing steps and improves detection efficiency. At the same time, it also avoids misjudgment caused by the outer packaging not being sealed.
[0097] In this embodiment, step S500 includes:
[0098] S510, if the fitting result of the inner packaging bag sealing line, the outer packaging sealing line and the tilt angle all meet the preset requirements, the sealing test result is determined to be a good seal.
[0099] Specifically, in this embodiment, the sealing test result is ultimately determined by comprehensively judging whether the fitting result of the inner packaging bag sealing line, the existence of the outer packaging sealing line, and the tilt angle all meet the preset requirements. This achieves a comprehensive and automated judgment of the sealing quality of both inner and outer packaging. This ensures that a "good seal" is only determined when all key sealing indicators are qualified, significantly improving the accuracy and reliability of the test results, avoiding missed or incorrect judgments that may result from single-item testing, and further guaranteeing the integrity and safety of the tested item's packaging.
[0100] In this embodiment, step S500, the step of fitting the sealing line of the inner packaging bag to obtain the sealing line fitting result, further includes:
[0101] S501 extracts the edge lines of the captured image and then shifts each edge line inward by a specified number of pixels to obtain the baseline.
[0102] S502, for each baseline, the edge finding operator is used to find the sealing line and obtain several points.
[0103] S503, determine whether a fitted sealing line can be obtained after linearly fitting several points using a specified algorithm.
[0104] If yes, proceed to step S504; otherwise, proceed to step S505.
[0105] S504, the sealing line fitting result is deemed acceptable.
[0106] S505, the sealing line fitting result is determined to be abnormal.
[0107] In this embodiment, the extracted edge lines are the left and right edge lines of the inner packaging bag area, i.e., the actual boundary of the inner packaging bag. A baseline is generated by translating the edge lines inward (from the edge of the packaging bag towards the center of the packaging bag). Based on the accurate location of the baseline and the above-mentioned fitted sealing point, an algorithm is used for linear fitting and existence judgment, achieving high-precision and automated positioning and judgment of the inner packaging sealing line. This improves the accuracy and reliability of sealing defect identification, effectively avoids false detections or missed detections caused by blurred sealing lines or positional deviations, and further enhances the robustness and automation level of the entire detection system.
[0108] Specifically, in this embodiment, if the inner and outer edge line pixels are less than or equal to 150 pixels, it is directly determined that the outer packaging bag is not sealed. First, the inner packaging bag needs to be extracted from the captured image. The color of the sealed inner packaging is darker than that of the unsealed packaging, and the sealing line can be seen. Utilizing the color difference between the inner packaging bag (light blue), the outer packaging bag (transparent), and the background, the G channel is subtracted from the R channel (light blue has a higher value in the G channel and a lower value in the R channel). This subtraction can significantly enhance the contrast between the inner packaging area and the background, suppressing irrelevant information. Thus, the pixel value of the green channel is subtracted from the pixel value of the red channel, and linear image enhancement is performed simultaneously to highlight the light blue object while darkening the surrounding pixels, making the inner packaging area more prominent, thereby obtaining an image containing only the inner packaging bag.
[0109] Subsequently, blob (connected component analysis) is used to extract the inner packaging bag. The enhanced image is then converted into a binary image by setting a threshold. The inner packaging bag area becomes white (foreground, pixel value 255), and the background becomes black (background, pixel value 0). Blob analysis is performed on the binary image to identify and mark all connected white areas. At this point, based on the known approximate area and shape of the packaging bag, an appropriate filter (aspect ratio in this embodiment) is set to accurately extract the pixel area representing the inner packaging bag from all connected components, eliminating any possible noise points. The area is then converted into an edge, and only the edge lines at both ends are extracted. After translating the left and right edge lines inward by a specified number of pixels (150 pixels), two new baselines are obtained, thereby accurately positioning the search range of the sealing line to the location where the sealing line is most likely to appear.
[0110] Subsequently, a narrow "caliper"-shaped search area is set centered on each translated baseline. Within this area, an edge detection operator is used to search and locate points with the most drastic grayscale changes (i.e., edge points) along the baseline at fixed intervals. These points are potential sealing line feature points. All collected sealing line feature points are fitted with a straight line using the least squares method. If a line is successfully fitted, it indicates that enough points have been found and are linearly arranged, forming an effective sealing line, thus determining that the inner packaging bag is sealed. If a line cannot be fitted, it can be considered that the number of feature points found is extremely small and the points are too scattered, resulting in a large fitting error. In this case, the inner packaging bag on that side is determined to be unsealed or poorly sealed, indicating that no continuous linear edge features were found in that area, thus determining that the inner packaging bag is unsealed.
[0111] In the above process, although a narrow "caliper"-shaped search area is set, it cannot be ruled out that a "stain" on the sealing line may cause the edge point to jump to the boundary of the "stain" instead of the sealing line. If the conventional least squares method is used, it will be very sensitive to such points. Therefore, the algorithm specified in this application refers to the improved least squares method. The core idea of the improvement of the least squares method is to utilize the geometric feature that "the sealing line should be a continuous path within the caliper".
[0112] In conjunction with the first aspect, step S503 includes:
[0113] S5031, randomly select two sampling points from a number of points to determine a temporary straight line.
[0114] S5032, calculate the distance from all other points to the temporary straight line, and include target points whose distance is less than a preset threshold into the consensus set, thus obtaining multiple consensus sets.
[0115] S5033: Select the consensus set corresponding to the temporary straight line with the most target points in the consensus set as the maximum consensus set.
[0116] S5034, based on all target points in the consensus set, performs final fitting using the least squares method to obtain the fitted straight line equation of the sealing line.
[0117] S5035, determine whether the continuity of the sealing line is qualified based on the goodness of fit of the fitted linear equation or the proportion of internal target points in the consensus set.
[0118] First, random sampling is performed in step S5031: from all the points found in step S502, two points are randomly selected as sampling points. Based on the principle that two points determine a straight line, a straight line model is constructed with the minimum sample size.
[0119] Subsequently, in step S5032, a consensus set is constructed: for the temporary straight line determined in step S5031, the distance (specifically the vertical distance) from all points other than the sampling point to this straight line is calculated. Points with a distance less than a certain threshold (e.g., half the width of the caliper) are marked as "inner points" (i.e., target points), and are considered to have consensus with this temporary straight line.
[0120] Repeat the process of randomly selecting sampling points, constructing temporary lines, and determining consensus sets multiple times (e.g., 100 times, 1000 times) to obtain multiple consensus sets. Through a large number of repeated random sampling and evaluations, the algorithm traverses the possible model space in a "brute-force" but efficient manner.
[0121] Subsequently, in step S5033, the consensus set corresponding to the temporary model with the most target points (i.e. the largest consensus set size) is selected and named "the largest consensus set".
[0122] Understandably, the "correct points" generated by the true sealing line will become the mainstream in number. Even if there are as many as 30%-40% outlier points (outliers), as long as two "correct points" are sampled in a single run, the temporary line established from them will gain the support of a large number of other "correct points" (i.e., a large consensus set). On the other hand, a model that has sampled "tainted" points will find it difficult to gain the recognition of a large number of other points. Therefore, by declaring the consensus set corresponding to the temporary line with the largest number of target points as the largest consensus set, we can obtain a clean dataset. The points in this dataset have a very high probability of coming from the true sealing line, while those tainted and noisy points have been effectively excluded.
[0123] Subsequently, in step S5034, the final fitting is performed: after obtaining the filtered, high-quality "maximum consensus set", the least squares fitting is performed again on all points in this set using all points in this "maximum consensus set" to obtain the final fitted line equation.
[0124] Understandably, conventional least squares is very sensitive to outliers, but its advantage lies in providing the optimal fit without bias. Now, outliers have been eliminated in the previous steps, leaving only high-confidence target points. Using least squares again at this point allows it to fully leverage its high accuracy while avoiding its vulnerability to interference.
[0125] Finally, step S5035 is executed to perform a continuity judgment, which is based on two criteria: the proportion of target points or the goodness of fit of the fitted straight line equation.
[0126] Regarding the target point ratio: Target point ratio = Number of target points in the maximum consensus set ÷ Total number of points found in step S502. This ratio directly reflects the "coherence" or "cleanliness" of the sealing line. If the sealing line is continuous and clear, then the vast majority of edge points should fall within the maximum consensus set, and the ratio will be high (e.g., >85%). If the sealing line is broken or severely stained, then a large number of points will be excluded as outliers, resulting in a very low inlier ratio. A threshold can be set (e.g., 70%), and points below this threshold are considered unqualified.
[0127] For the goodness of fit of the fitted linear equation: for example, calculating the sum of squared residuals or R² of the final fitted line. 2 The coefficient of determination measures how closely the points within the largest consensus set fit the final straight line. Even if the proportion of inliers is high, if these inliers themselves are very scattered, the residual of the fitted straight line will be large, indicating that although the sealing line is continuous, it is not straight and may have bends or jitters, which is also a quality defect.
[0128] Based on the above indicators, a binary judgment of "qualified" or "unqualified" is given, thereby realizing automated detection of sealing quality.
[0129] In this way, by combining random sampling with a consensus set mechanism, the algorithm is ensured not to be affected by individual "blemishes" and is always committed to finding the geometric model that represents the continuous path of the sealing line, supported by the most evidence (edge points).
[0130] In this embodiment, step S400 further includes:
[0131] S410 enhances the captured image to obtain an enhanced image.
[0132] The S420 performs Canny edge extraction on the captured image to extract the edge lines on both sides of the entire outer packaging bag.
[0133] S430 extracts the outer packaging seal line by translating inward by a specified number of pixels for each edge line.
[0134] S440, determine whether the angle between the outer packaging sealing line and the outer packaging edge line is less than the preset angle threshold.
[0135] S450, if so, confirm that the outer packaging bag is sealed well.
[0136] S460, if not, check that the sealing line on the outer packaging bag is tilted.
[0137] In this embodiment, Canny edge extraction is performed on the captured image to accurately obtain the edge lines on both sides of the transparent outer packaging bag. The sealing line is then extracted based on the area shifted inward by a specified number of pixels, thus alleviating the technical challenge of low contrast between the edges and background of transparent materials, making accurate capture difficult. By calculating and determining whether the angle between the sealing line and the edge line of the outer packaging is less than a preset threshold, automated and quantitative determination of whether the outer packaging seal is skewed is achieved. This significantly improves the accuracy and reliability of the detection, eliminates seal failure caused by a tilted sealing line, and further ensures the integrity and safety of medical consumable packaging.
[0138] Specifically, in this embodiment, the outline of the outer packaging bag needs to be extracted first. Because the outer packaging uses transparent material, the contrast between its edges and the background (usually a white or gray glass plate) is very low, making it difficult for the human eye to distinguish, rendering traditional threshold segmentation methods largely ineffective. Therefore, the captured image is first enhanced. Then, Canny edge extraction is performed on the outer packaging bag image to extract the entire bag, and then the edges on the left and right sides are extracted. The sealing line is extracted by shifting 150 pixels inward from the left and right edges. The angle between the sealing line and the outer edge can then be determined.
[0139] The Canny edge detection algorithm used is as follows: First, the image is slightly blurred to remove interference such as camera noise and minor scratches on the packaging bag. The brightness gradient intensity and direction of each pixel in the image are then calculated. Although the grayscale change is slight at transparent edges, gradient changes still exist, which the Canny algorithm is very sensitive to. Next, only the points with the strongest gradient intensity in the gradient direction are retained, refining the edge lines. Then, the gradient intensity is compared with preset high and low thresholds. If the gradient intensity is greater than the high threshold, it is considered a strong edge (i.e., definitely a boundary); if the gradient intensity is between the low and high thresholds, it is considered a "weak edge" (i.e., possibly a boundary); if the gradient intensity is less than the low threshold, it is considered "suppressed" (i.e., not a boundary). Finally, only "weak edges" connected to "strong edges" are retained to effectively ensure that the extracted edges are continuous and complete contour lines, rather than discontinuous points. This results in a binary image where white pixels constitute the left, right, top, and bottom edge lines of the outer packaging bag.
[0140] In conjunction with the first aspect, step S410 includes:
[0141] S411, Obtain the preset target grayscale range;
[0142] S412, Analyze the grayscale histogram of the captured image, and determine the feature grayscale range representing effective information in the captured image based on the histogram shape;
[0143] S413, Calculate the linear transformation coefficients based on the target grayscale range and the feature grayscale range; wherein, the linear transformation coefficients include the gain parameter and the offset parameter;
[0144] S414 performs point operations on the captured image to calculate the square of the gray level of each pixel, and then performs a linear transformation based on the gain parameter and the offset parameter to obtain the enhanced captured image.
[0145] Specifically, in step S411,
[0146] (1) For display: typically [0, 255] (8-bit image).
[0147] (2) For subsequent processing: depending on your camera bit depth or library function requirements, it may be [0, 1023] (10 bits), [0, 4095] (12 bits), or [0.0, 1.0] (floating-point normalization).
[0148] We denote the minimum target value as Z_min and the maximum target value as Z_max, thereby determining the target grayscale range [Z_min, Z_max] of the output image.
[0149] This step sets the "starting line" Z_min and the "finish line" Z_max for grayscale based on the needs of downstream applications.
[0150] S412, Analyze the grayscale histogram of the input image, and determine the feature grayscale range representing effective information in the input image based on the histogram shape.
[0151] Specifically, the feature grayscale range [X_low, X_high] of the input image is statistically defined, where X_low is the minimum value of the feature grayscale range, specifically the critical point where the number of pixels on the low grayscale side of the histogram begins to increase steadily, and X_high is the maximum value of the feature grayscale range, specifically the critical point where the number of pixels on the high grayscale side of the histogram begins to decrease significantly.
[0152] This is the most crucial step. Directly using the minimum and maximum grayscale values (I_min and I_max) of the image is problematic because they may only be determined by a few extreme noise or saturated pixels and cannot represent the true dynamic range of the image's main content. Using them directly for calculations will result in poor transformation effects and insufficient contrast stretching. Therefore, we need to analyze the shape of the grayscale histogram to find the boundaries of "effective information," that is, to find the range that represents "effective information."
[0153] Drawing a grayscale histogram: Analyze the grayscale histogram of the input image I after square enhancement.
[0154] Determining the low threshold X_low: On the histogram, starting from the low grayscale value end, ignore the small number of pixels on the left that may represent "pure background noise," and find a grayscale point X_low. To the right of this point, the number of pixels begins to increase significantly and steadily. This point represents the starting point of the effective signal area, indicating that the real object information begins to appear. This point is X_low, which effectively filters out noise in the dark field.
[0155] Determining the high threshold X_high: Similarly, at the high grayscale end of the histogram, ignoring the very few "saturated pixels" or bright spot noise that may exist on the right, find a grayscale point X_high. To the left of this point, the number of pixels begins to decrease significantly. This point represents the end of the effective signal area; this point is X_high, which effectively filters out noise and overexposed points in bright areas.
[0156] The [X_low, X_high] interval determined by the above method can accurately capture the grayscale dynamic range of the distribution of most of the useful information contained in the image (such as edges and textures in the image), which is a key prerequisite for achieving high-quality adaptive enhancement. Our goal is to map this interval to [Z_min, Z_max].
[0157] S413, Calculate the linear transformation coefficients based on the target grayscale range and the feature grayscale range. The linear transformation coefficients include the gain parameter α and the offset parameter β.
[0158] Specifically, the calculation formula is as follows:
[0159] α = (Total width of the target output range) ÷ (Width of the valid input signal range)
[0160] Expressed as a formula:
[0161] α = (Z_max - Z_min)÷ (X_high - X_low)
[0162] Here, (X_high - X_low) is the "width" of the input signal, and (Z_max - Z_min) is the desired "width" of the output signal. The gain parameter α is the ratio of these two widths. If α > 1, it means the contrast is amplified; if α < 1, it means the contrast is compressed. Based on the description (making bright areas brighter and dark areas darker), α is usually greater than 1.
[0163] At the same time, the preset value β (offset parameter) is calculated. Specifically, the calculation formula is as follows:
[0164] β = Starting point of target output - (Starting point of stretched input)
[0165] Expressed as a formula:
[0166] β = Z_min - (α × X_low)
[0167] After the gain α, the original effective input signal starting point X_low becomes α × X_low. However, we want it to be mapped to Z_min. Therefore, we need to add an offset β such that α × X_low + β = Z_min, which leads to the formula above.
[0168] The following are examples:
[0169] Assumption:
[0170] The target output range is [0, 255].
[0171] After analyzing the histogram, the effective grayscale range of the input image is determined to be [100, 600].
[0172] calculate:
[0173] α = (255 - 0)÷(600 - 100) = 255÷500 = 0.51
[0174] Here, α < 1 because the input range (500) is wider than the output range (255), thus compressing the contrast. To force amplification, [X_low, X_high] needs to be adjusted. For example, if only [300, 600] is used, then α = 255 ÷ 300 = 0.85 (still less than 1). To make it greater than 1, the input range must be less than 255. For example, if [100, 300] is used, then α = 255 ÷ 200 ≈ 1.28.
[0175] β = 0 - 0.51 × 100 = -51
[0176] The final transformation is: I_out = 0.51 × I_in - 51
[0177] When I_in = 100 (the starting point of the valid range), I_out = 0.51×100 - 51 = 0.
[0178] When I_in = 600 (the end of the valid range), I_out = 0.51×600 - 51 = 255.
[0179] This accurately maps the valid range to the entire output range.
[0180] Subsequently, point operations are performed on the captured image to calculate the square of the gray level of each pixel. Then, based on the gain parameter and the offset parameter, a linear transformation is performed to obtain the enhanced captured image.
[0181] Specifically, image enhancement is achieved by performing a multiplication operation between the image and itself. Specifically, for each pixel in the input image, the gray value I in the new image is calculated and output by squaring the original gray value I(x,y). new (x,y), I new The operation (x,y) = I(x,y) × I(x,y) greatly amplifies the contrast between the faint target (edge) and the background, making the originally indistinct edges very prominent. Then, based on the above square operation, a linear transformation is performed: I_final(x,y) = α × [I(x,y) × I(x,y)] + β; where α is the gain parameter and β is the bias parameter. α is usually a gain parameter greater than 1, its function is to further amplify the contrast difference after square enhancement, making bright areas brighter and dark areas darker, thus strengthening the edge signal; β is a bias parameter, its function is to adjust the overall brightness level, because after the sum of squares multiplied by a coefficient, the overall grayscale value of the image becomes very large, possibly exceeding the standard display range (0-255) or the camera bit depth (e.g., 0-4095). Adding a fixed value can shift it back to a suitable range, or set a more ideal brightness baseline for the subsequent Canny algorithm.
[0182] In this embodiment, before step S100, the following steps are also included:
[0183] S10, Obtain the packaging type of the target workpiece.
[0184] S20, determine the target location based on packaging type.
[0185] S30, move the target workpiece to the target position.
[0186] Specifically, in this embodiment, before the test item is tested, the model number is queried according to the preset database to determine whether its packaging type is "long packaging" (length ≥ 150mm) or "short packaging" (length < 150mm).
[0187] The system's main control unit (such as a PLC or industrial computer) retrieves a preset movement and image-taking program from memory based on the determined packaging type. For short packages, one target point is set: the center point directly below the detection camera 210. Taking an image from this point will cover the entire sealed area of the workpiece. For long packages, two target points are set: a first point (for capturing the sealed area on the left side of the package) and a second point (for capturing the sealed area on the right side of the package). The system must move sequentially to these two points to capture images to obtain a complete inspection image.
[0188] Subsequently, the workpiece is accurately positioned sequentially at each of the aforementioned target points in the first and second inspection stations, and images are acquired using an inspection camera.
[0189] This embodiment avoids the inefficiency caused by taking a single photo of short packages and two photos of long packages, which would otherwise require taking multiple photos of all workpieces. It also prevents problems such as insufficient edge resolution or increased distortion that may result from taking only one image of a long workpiece. This approach maximizes system throughput while ensuring detection quality.
[0190] This embodiment provides a sealing detection device, which is applied to the control unit of the provided sealing detection system. Combined with... Figure 2 As shown, the device includes: acquisition module 1, extraction module 2, judgment module 3, fitting module 4, and detection module 5.
[0191] The acquisition module 1 is used to acquire images captured at the target location.
[0192] Extraction module 2 is used to extract the inner packaging area and the outer packaging contour from the captured image.
[0193] The judgment module 3 is used to determine whether the distance between the edge of the inner packaging bag and the outline of the outer packaging is greater than a specified number of pixels.
[0194] The fitting module 4 is used to fit the sealing line of the inner packaging bag when the distance between the edge of the inner packaging bag and the outline of the outer packaging bag is greater than a specified number of pixels, and at the same time, extract the sealing line of the outer packaging bag.
[0195] The detection module 5 is used to obtain the sealing detection result based on the sealing line fitting result, the outer packaging sealing line and the tilt angle.
[0196] Thirdly, this application also provides a sealing detection system, please refer to... Figures 3 to 6 The sealing detection system provided in this embodiment includes a control unit for executing the sealing detection method described above. The system also includes a detection platform 100, a transfer mechanism 300, and a conveying device 400.
[0197] The bottom surface of the testing platform 100 is made of a highly transparent material and is used to support the test object. The transfer mechanism 300 is used to pick up the test object and transfer it to the testing platform 100, or to remove the test object from the testing platform 100. The conveying device 400 is connected to the testing platform 100 in a transmission manner.
[0198] The conveyor 400 drives the testing platform 100 to pass through the first testing station and the second testing station in sequence.
[0199] Furthermore, in this embodiment, the two testing mechanisms 200 form a first testing station and a second testing station in the circumference of the testing platform 100.
[0200] Specifically, in this embodiment, the light-emitting end of the surface light source 220 faces the detection platform 100, the arched tunnel light source 230 is located on the side of the detection platform 100 away from the surface light source 220, and the detection camera 210 is located on the side of the arched tunnel light source 230 away from the detection platform 100 with its detection end facing the detection platform 100.
[0201] Specifically, after the medical consumables are packaged, the medical consumables with packaging bags are stacked at the picking position of the transfer mechanism 300. Then, the transfer mechanism 300 picks up the packaged medical consumables and moves them to the testing platform 100. At this time, the testing platform 100 is in its initial position, the transfer mechanism 300 stays in this position, and the conveying device 400 runs the drive to make the testing platform 100 reach the testing position of the testing mechanism 200.
[0202] After the detection platform 100 reaches the detection position, the light source illuminates the detection platform 100, and the first detection position and the second detection position respectively take pictures of the upper and lower sides of the packaged medical consumables to detect the outer packaging of the medical consumables.
[0203] During testing, since the testing camera 210 is set to surface light and has an arched tunnel light source 230 arranged around its perimeter, it can alleviate the reflection problem of the packaging bag of medical consumables, while also highlighting the seal of the outer packaging bag, thus ensuring the accuracy of the test.
[0204] The surface light source 220 can illuminate internal sealing defects and contents problems, while the arched tunnel light source 230 can capture surface sealing defects and appearance flaws. In this embodiment, the two are combined to enable a one-time, all-around inspection of the sealing condition of the object being tested.
[0205] Furthermore, the combined use of the surface light source 220 and the arched tunnel light source 230 can meet the lighting requirements of sealed inspection objects of different materials and structures. At the same time, it can also improve image quality and inspection accuracy. For specific defect types, the most suitable light source illumination mode or combination mode can be used to obtain images with higher contrast, clearer details, and less interference, thereby improving the recognition accuracy and reliability of machine vision algorithms.
[0206] Furthermore, when inspecting packaging bags of different specifications, the conveying device 400 can accurately place the packaging bags of medical consumables at the inspection point of the inspection agency 200, so as to realize the inspection of packaging bags of medical consumables of different specifications.
[0207] After the test is completed, the conveying device 400 drives the testing platform 100 to reset, and the testing platform 100 moves back to the initial position. The transfer mechanism 300 picks up the tested object again and transfers it to the next area according to the test results.
[0208] In this embodiment, multiple detection points (i.e., the aforementioned target points) are set in both the first and second detection stations. The detection platform 100 stops at the detection points so that the detection camera 210 can capture images of the objects to be detected at the corresponding locations.
[0209] In this embodiment, packaging bags with a length of less than 150mm are considered short packaging bags. When inspecting short packaging bags, the conveying device 400 drives the short packaging bag to the opposite position of the inspection mechanism 200. The inspection mechanism 200 can capture the entire short packaging bag by photographing the middle portion of the bag; that is, a detection point is set in both the first and second inspection stations. When the inspection platform 100 reaches the detection point, the inspection mechanism 200 can capture the entire short packaging bag. Subsequently, image analysis of the captured image can be performed to detect the sealing performance of the short packaging bag.
[0210] In this embodiment, a packaging bag with a length of 150mm-300mm is a long packaging bag. When inspecting the long packaging bag, the conveying device 400 drives the inspection platform 100 or the inspection mechanism 200, so that the inspection mechanism 200 takes two pictures of the long packaging bag. That is, two inspection points are respectively set in the first inspection station and the second inspection station to take pictures of both sides of the long packaging bag separately. Then, the images obtained from the two pictures are analyzed to detect the sealing performance of the long packaging bag.
[0211] In this structure, the sealing detection device provided in this embodiment uses a moving shooting method to shoot and detect the sealing performance of the packaging bag of medical consumables. Multiple detection points can be set in the first detection station and the second detection station to correspond to packaging of different lengths. It can accurately detect both short and long packaging and is compatible with the sealing detection of medical consumable packaging of different lengths, thus having excellent applicability.
[0212] Specifically, in this embodiment, the conveying device 400 adopts a linear module. The linear module in this embodiment includes a ball-bearing linear guide rail and a servo motor with a transmission connection, enabling smooth linear motion. This allows the driving detection platform 100 to accurately move the packaging bag to the preset detection point of the detection mechanism 200, thereby ensuring that the target area of the packaging bag (especially the sealing opening) is located at a fixed position within the imaging field of view during each image capture.
[0213] In this embodiment, the sealing detection device further includes a storage component 500. The storage component 500 has a first storage space for placing qualified products and a second storage space for placing unqualified products, both of which are located on the movement trajectory of the transfer mechanism 300.
[0214] In this embodiment, after the testing institution 200 completes the sealing test of the medical consumable packaging bag on the testing platform 100, it can automatically make a judgment based on the image analysis results (qualified or unqualified).
[0215] Subsequently, based on the judgment result, if the product is determined to be qualified, the transfer mechanism 300 transfers it and places it in the first storage space. If the product is determined to be unqualified, the transfer mechanism 300 transfers it and places it in the second storage space, thereby realizing fully automated detection and classification of packaging bags.
[0216] In this embodiment, the storage component 500 includes a storage slot 510 and a partition 520. The inner wall of the storage slot 510 is provided with a plurality of slots along the extending direction of the storage slot 510. The partition 520 is adapted to the slots, and the plurality of partitions 520 are detachably inserted into the storage slot 510 to form a first storage space and a second storage space.
[0217] The storage slot 510 has multiple slots on its inner wall along its extension direction. A partition 520 is fitted into the slots, and the multiple partitions 520 are detachably inserted into the storage slot 510 to form a first storage space and a second storage space.
[0218] In this embodiment, multiple slots are provided along the length of the inner wall of the storage slot 510. The partition 520 is detachably inserted into the slots to divide the space inside the storage slot 510, thereby forming a first storage space (qualified product area) and a second storage space (unqualified product area). The size and position of the first storage space and the second storage space can be quickly and flexibly adjusted according to actual needs.
[0219] When storing short packaging bags, more partitions 520 can be inserted to divide the storage slot 510 into multiple smaller, independent spaces, facilitating categorized stacking and preventing tipping. When storing long packaging bags, some partitions 520 can be reduced or even removed to create a longer storage space to accommodate longer packaging bags (up to 400mm in length). This structure allows for the storage of medical consumable packaging bags of different sizes without replacing the entire storage assembly 500, greatly improving the adaptability and ease of operation of the equipment.
[0220] It should be noted that in this embodiment, the undetected packaging bags containing medical consumables are placed in the storage box, which is also equipped with multiple storage slots 510. The undetected packaging bags containing medical consumables are stacked in the storage box.
[0221] In this embodiment, the storage component 500 includes proximity sensors 530. Multiple proximity sensors 530 are spaced apart on the outer wall of the storage slot 510.
[0222] Specifically, in this embodiment, multiple proximity sensors 530 are arranged on the outer wall of the storage slot 510 and spaced apart. The proximity sensor 530 can detect the distance between itself and the detection mechanism 200. The detection result of the proximity sensor 530 can determine whether the storage slot 510 is placed in the preset position, so as to ensure that the transfer mechanism 300 can put the detected packaging bag into the storage slot 510.
[0223] In this embodiment, the transfer mechanism 300 includes a horizontal drive component 310, a vertical drive component 320, and a pickup component 330.
[0224] The horizontal drive assembly 310 has a horizontal moving end and is located on one side of the detection platform 100. The vertical drive assembly 320 has a vertical moving end and is drivenly connected to the horizontal moving end. The pickup assembly 330 includes a pickup member for picking up the object to be detected, and the pickup member is drivenly connected to the vertical moving end.
[0225] In this embodiment, the horizontal drive component 310 can drive the horizontal moving end to move in the horizontal plane. The vertical drive component 320 is installed on the horizontal moving end, so that it moves horizontally along with the horizontal moving end, and can drive the vertical moving end to perform lifting and lowering movements in the vertical direction, thereby driving the pickup to move in the horizontal and vertical directions.
[0226] Furthermore, in this embodiment, the movement trajectory of the horizontal moving end is relative to the material stacking area, the storage slot 510, and the detection platform 100, so that the picking component can perform downward material picking, material transfer, and downward material release under the drive of the linkage structure of the horizontal driving component 310 and the vertical driving component 320.
[0227] In this embodiment, the horizontal drive assembly 310 includes a first drive member 311 and a second drive member 312. The first drive member 311 is disposed on one side of the detection platform 100 and has a first moving end. The second drive member 312 is disposed on the first moving end, and the moving end of the second drive member 312 is a horizontal moving end.
[0228] In this embodiment, a horizontal moving structure is formed by the first driving member 311 and the second driving member 312 which is connected to the first driving member 311 in a transmission manner.
[0229] In one feasible approach, the first drive unit 311 can be selected as a drive unit with a large range of movement, and the second drive unit 312 can be selected as a drive unit with a small range of fine adjustment. The two are used together to achieve accurate movement of the pickup unit.
[0230] In this embodiment, both the first driving member 311 and the second driving member 312 achieve horizontal driving through a rotating structure, meaning that the movement trajectories of the first moving end and the moving end of the second driving member 312 are both arc-shaped. This forms a working area covering the area from the material picking position, the detection platform 100 to the storage component 500. Compared to a straight back-and-forth movement trajectory, the arc-shaped movement path is generally shorter and smoother, reducing ineffective travel and thus significantly improving the efficiency of picking up parts over a large range of movement.
[0231] Furthermore, with this structure, the second drive component 312 can perform fine and flexible micro-adjustments to the position of the first drive component 311 after positioning. The superposition of the two arcs expands the reachable working range and positioning flexibility of the pickup component in the horizontal plane.
[0232] In this embodiment, the moving mechanism further includes a positioning camera. The positioning camera is disposed on the longitudinal drive assembly 320, and the shooting direction of the positioning camera is downward.
[0233] Specifically, the positioning camera in this embodiment is a 3D camera. The 3D camera is located on one side of the first drive member 311, and the shooting direction of the 3D camera is downward. When the transfer mechanism 300 picks up an undetected packaging bag containing medical consumables, the 3D camera can capture the relative position of the pickup component 330 and the packaging bag, thereby determining the size of the packaging bag, determining the specifications of the packaging bag and the detection method of the packaging bag, and driving the first drive member 311, the second drive member 312 and the longitudinal drive component 320 according to the specific position of the packaging bag, so that the pickup component 330 can accurately pick up the packaging bag.
[0234] In this embodiment, the pickup element is a vacuum suction cup. The pickup assembly 330 also includes a vacuum generator, which is connected to the vacuum suction cup.
[0235] Vacuum suction cups pick up packaging bags containing medical consumables using negative pressure adsorption. They have a large contact area and even force distribution, making it less likely to damage the packaging bags.
[0236] During pickup, the horizontal drive component 310 drives the vertical drive component 320 and the vacuum suction cup to move above the packaging bag. Then, the vertical drive component 320 drives the vacuum suction cup to move down until the vacuum suction cup is in contact with the packaging bag. The vacuum generator generates negative pressure, so that the suction cup is firmly attached to the surface of the packaging bag.
[0237] During placement, the vacuum generator quickly releases negative pressure (or switches to positive pressure blowing), allowing the suction cup to detach from the packaging bag instantly, achieving rapid and reliable release, significantly shortening the pick-and-place cycle time and improving overall efficiency.
[0238] Furthermore, multiple vacuum suction cups can be set. At least two vacuum suction cups are arranged at a straight interval to form a suction cup group, and there are multiple suction cup groups arranged side by side.
[0239] Multiple vacuum suction cups are arranged at intervals along a straight line to form a suction cup group, thereby forming a multi-point adsorption and pickup of the packaging bag to ensure stable adsorption.
[0240] With multiple suction cups arranged in parallel, multiple packaging bags can be picked up and picked up simultaneously, thereby improving detection efficiency.
[0241] Specifically, in this embodiment, there are four vacuum suction cups, and every two form a suction cup group for adsorbing and picking up one packaging bag. Two suction cup groups can adsorb and pick up two packaging bags at the same time, which improves the detection efficiency.
[0242] In this embodiment, the detection platform 100 is made of high-transparency glass.
[0243] The conveying device 400 is directly driven to the detection platform 100 to drive the detection platform 100 to move along the setting direction of the first sub-light source and the second sub-light source, so that the first detection piece and the second detection piece can sequentially detect the top and bottom surfaces of the packaging bag on the detection platform 100.
[0244] Meanwhile, the flatness and optical uniformity of the high-transparency glass help maintain the stability and uniformity of the "arched light" field formed by the second sub-light source and the second detection element. The smooth glass surface reduces unnecessary diffuse reflection, allowing the arched light to illuminate the sealed area on the bottom of the packaging bag more concentratedly and regularly, further highlighting defect features and improving the sensitivity and reliability of bottom surface detection. This provides a clear and distortion-free optical channel for bottom surface detection (especially the critical arched light imaging).
[0245] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0246] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0247] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0248] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0249] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do 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, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting a seal, characterized in that, A control unit is used in a seal detection system, the system further comprising: The inspection mechanism includes a light source and an inspection camera. The light source includes a surface light source and an arched tunnel light source. The light-emitting end of the surface light source faces the object to be inspected. The arched tunnel light source is located on the side of the object to be inspected away from the surface light source. The inspection camera is located on the side of the arched tunnel light source away from the object to be inspected, with its inspection end facing the object to be inspected. The inspection mechanism has two parts, forming a first inspection station and a second inspection station, for inspecting two sides of the object to be inspected, respectively. The method includes: Acquire images taken at the target location; The inner packaging area and outer packaging contour are extracted from the captured image; Determine whether the distance between the edge of the inner packaging bag and the outline of the outer packaging is greater than a specified number of pixels; If so, the sealing line of the inner packaging bag is fitted to obtain the sealing line fitting result. At the same time, the outer packaging sealing line is extracted, and the inclination angle of the outer packaging sealing line relative to the edge of the outer packaging is determined. Based on the sealing line fitting results, the outer packaging sealing line, and the tilt angle, the sealing test results are obtained.
2. The method according to claim 1, characterized in that, The steps for obtaining the seal detection result based on the seal line fitting result, the outer packaging seal line, and the tilt angle include: If the fitting result of the inner packaging bag sealing line, the outer packaging sealing line, and the tilt angle all meet the preset requirements, the sealing test result is determined to be a good seal.
3. The method according to claim 1, characterized in that, The step of fitting the sealing line of the inner packaging bag to obtain the sealing line fitting result includes: After extracting the edge lines from the captured image, for each edge line, shift it inward by a specified number of pixels to obtain the baseline. For each of the aforementioned baselines, an edge-finding operator is used to find the sealing line, resulting in several points; Determine whether a fitted sealing line can be obtained after linearly fitting the specified number of points using a designated algorithm; If so, the sealing line fitting result is deemed acceptable; If not, the sealing line fitting result is determined to be abnormal.
4. The method according to claim 3, characterized in that, The specified algorithm is an improved least squares method; the step of determining whether a fitted seal line can be obtained after linearly fitting the specified algorithm to the several points includes: Two sampling points are randomly selected from the aforementioned points to determine a temporary straight line; Calculate the distance from all other points to the temporary straight line, and include target points whose distance is less than a preset threshold into a consensus set to obtain multiple consensus sets; The consensus set corresponding to the temporary straight line with the largest number of target points in the consensus set is selected as the maximum consensus set. Based on all the target points in the consensus set, the least squares method is used to perform a final fitting to obtain the fitted straight line equation of the sealing line. The continuity of the sealing line is determined based on the goodness of fit of the fitted linear equation or the proportion of the target points within the consensus set.
5. The method according to claim 1, characterized in that, The step of extracting the outer packaging seal line and determining the inclination angle of the outer packaging seal line relative to the edge of the outer packaging further includes: The captured image is enhanced to obtain the enhanced captured image; Canny edge extraction is performed on the captured image to extract the edge lines on both sides of the entire outer packaging bag; For each of the aforementioned edge lines, the specified pixel is translated inward to extract the outer packaging sealing line; Determine whether the angle between the outer packaging sealing line and the edge line of the outer packaging is less than a preset angle threshold. If so, confirm that the outer packaging bag is sealed properly; If not, check that the sealing line on the outer packaging bag is tilted.
6. The method according to claim 5, characterized in that, The step of enhancing the captured image includes: Obtain the preset target grayscale range; Analyze the grayscale histogram of the captured image, and determine the feature grayscale range representing effective information in the captured image based on the histogram shape; Based on the target grayscale range and the feature grayscale range, linear transformation coefficients are calculated; wherein, the linear transformation coefficients include a gain parameter and an offset parameter; After performing point operations on the captured image to calculate the square of the gray level of each pixel, a linear transformation is performed based on the gain parameter and the offset parameter to obtain the enhanced captured image.
7. The method according to claim 6, characterized in that, The step of calculating the linear transformation coefficients based on the target grayscale range and the feature grayscale range includes: Calculate using the following formula: α = (Z_max - Z_min)÷(X_high - X_low); β = Z_min - (α × X_low) Wherein, α is the gain parameter, β is the offset parameter, Z_max is the upper limit of the target grayscale range, Z_min is the lower limit of the target grayscale range, X_high is the upper limit of the feature grayscale range, and X_low is the lower limit of the feature grayscale range.
8. The method according to claim 1, characterized in that, Before the step of acquiring the captured image at the target location, the method further includes: Obtain the packaging type of the target workpiece; Based on the packaging type, determine the target location; Move the target workpiece to the target point.
9. A sealing detection device, characterized in that, A control unit applied in a sealing detection system; the device includes: The acquisition module is used to acquire images captured at the target location; The extraction module is used to extract the inner packaging area and the outer packaging contour from the captured image; The judgment module is used to determine whether the distance between the edge of the inner packaging bag and the outline of the outer packaging is greater than a specified number of pixels; The fitting module is used to perform sealing line fitting on the inner packaging bag when the distance between the edge of the inner packaging bag and the outline of the outer packaging bag is greater than a specified number of pixels, and to obtain the sealing line fitting result. At the same time, the outer packaging sealing line is extracted and the tilt angle of the outer packaging sealing line relative to the edge of the outer packaging is determined. The detection module is used to obtain the sealing detection result based on the sealing line fitting result, the outer packaging sealing line, and the tilt angle.
10. A sealing detection system, characterized in that, The system includes a control unit for performing the method as described in any one of claims 1-8; the system further includes: The testing platform is made of a highly transparent material and is used to support the test items; A transfer mechanism is used to pick up the object to be tested and transfer it to the testing platform, or to remove the object to be tested from the testing platform; A conveying device is connected to the detection platform to drive the detection platform to pass through the first detection station and the second detection station in sequence; Both the first and second testing stations are equipped with multiple testing points. The detection platform stops at the detection point so that the detection camera can capture the detection object at the corresponding location.
Citation Information
Patent Citations
Abnormal monitoring system of automatic packaging machine
CN116958124A
Linear defect detection method, defect detection equipment, storage medium and product
CN119579565A