A casing shrink tube image grading system and method
Through the casing sleeve image grading system, image processing and support vector machine technology are used to automatically extract and classify suspicious points of the casing sleeve, solving the problems of slow manual grading speed and inconsistent quality in the existing technology, and achieving high efficiency. , unified automatic grading of casing sleeves.
Patent Information
- Application Number
- CN202210045956.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-17
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-01-17
AI Technical Summary
Existing technology cannot realize automatic image grading of casing sleeves, resulting in manual grading that is slow, costly and of uneven quality.
Design an image grading system for casing sleeves. The RGB image is received through the image receiving module. The image processing module extracts color and black and white suspicious points. The support vector machine module calculates the comprehensive value of the suspicious points. The grading processing module determines the casing shrinkage based on the comprehensive value. The level of the tube to achieve automatic grading.
Automatic quality grading of casing shrink tubes has been realized, grading efficiency and quality have been improved, manual intervention has been reduced, and grading standards have been unified.
Smart Images

Figure CN114299063B
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image data processing, and in particular relates to a casing shrink tube image grading system and method. Background Art
[0002] Casings can extend the shelf life of products to a certain extent. They are often used as casings for stuffed sausages and sausages in the food processing field. They are mainly divided into natural casings, collagen casings, and polyvinylidene chloride (PVDC) casings. Natural casings have the disadvantages of being basically entirely manual and uneven in thickness, while collagen casings have advantages that natural casings and PVDC casings cannot match, such as ease of use, good taste, high transparency, and uniform diameter. In addition, their compressive strength is more than four times that of natural casings, so they are widely used.
[0003] In order to facilitate the transportation and storage of casings, the produced collagen casings are usually folded and shrunk into a tube to form a casing shrink tube, so that it can be put on the enema rod to achieve high-speed mechanical enema. In order to improve the quality control of the casing shrink tube, a grading operation is pre-set. Manual grading is not only slow, but also requires a lot of people, which greatly increases the labor cost; and the degree of manual control is different, resulting in the phenomenon that the graded casing shrink tubes still have uneven quality.
[0004] Chinese invention patent application 202010519505.4 discloses a jujube grading detection method based on machine vision, which uses the least squares support vector machine in machine learning to train the original images of jujubes with and without defects on the surface, obtains the classification result, that is, the feature library template of jujube images of different grades, obtains the feature parameters of the image from the image of the jujube to be graded, and uses the Euclidean distance algorithm to calculate the Euclidean distance between the feature parameters of the jujube to be graded and the parameters in the feature library template to obtain the classification result. Although it realizes the automatic grading of jujubes, its image processing is performed on the macroscopic object of jujube, and cannot support the automatic grading of casing shrink tubes with complex image features.
[0005] Therefore, the applicant also envisioned that the image grading of casing shrink tubes could be automatically completed by software, which would not only greatly reduce the labor, but also unify the grading standards. Completing software development is the primary task to achieve the goal of automatic grading. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a casing shrink tube image grading system and method, which can realize the quality grading of casing shrink tubes according to images by software.
[0007] In order to solve the above technical problems, the technical solution of the present invention is to design a casing shrink tube image grading system, which is characterized by comprising:
[0008] Image receiving module: used for receiving the RGB image of the outer wall of the casing shrink tube acquired by the imaging device;
[0009] Image processing module: extracts the casing shrinkage tube image from the RGB image received by the image receiving module.
[0010] The casing shrink tube image is converted into a Lab image, and the Lab image is filtered and binarized by a dynamic threshold to obtain the color suspicious points in the casing shrink tube image;
[0011] The casing shrink tube image is grayed to obtain a gray image, and the gray image is filtered and binarized by a dynamic threshold to obtain black and white suspicious points in the casing shrink tube image;
[0012] Merge the color suspicious points and the black and white suspicious points to obtain all the suspicious points in the casing shrink tube image, and correspond all the suspicious points to the casing shrink tube image;
[0013] Setting module: used to set the level of each suspicious point in the casing shrink tube image;
[0014] Support vector machine module: The support vector machine calculates the comprehensive value of the image of the area where each suspicious point in each level is located, and determines the value range of the suspicious points at each level;
[0015] Grading processing module: Determine the grade of each suspicious point according to the numerical range of the comprehensive value of the image of the area where each suspicious point is located in the casing shrink tube image to be graded, and determine the grade of the casing shrink tube according to the grade of the lowest grade suspicious point in the casing shrink tube.
[0016] Preferably, it also includes a clearing module for clearing the numerical ranges of suspicious points of various levels in the support vector machine module.
[0017] Preferably, the image processing module further performs enhancement processing on the casing shrinkage tube image, and the casing shrinkage tube image after enhancement processing is converted into a Lab image and grayscaled.
[0018] Preferably, the filtering is mean filtering, and the dynamic threshold refers to mean-subtracted filtering.
[0019] Preferably, the image processing module further performs opening and closing operations on the obtained binary image.
[0020] The present invention also provides a casing shrink tube image grading method, which is characterized by comprising the following steps:
[0021] (1) Determine the suspicious points of the casing shrinkage tube to be graded: Process the RGB image of the casing shrinkage tube into a Lab image and a grayscale image. After filtering, the Lab image is binarized using a dynamic threshold to obtain the color suspicious points in the casing shrinkage tube image. After filtering, the grayscale image is binarized using a dynamic threshold to obtain the black and white suspicious points in the casing shrinkage tube image. The color suspicious points and the black and white suspicious points are merged to obtain all the suspicious points of the casing shrinkage tube.
[0022] (2) Determining the level of each suspicious point in the casing shrink tube to be graded: Corresponding the suspicious points obtained in step (1) to the RGB image of the casing shrink tube, using a support vector machine to calculate the comprehensive value of the image corresponding to each suspicious point in the RGB image, and determining the level of each suspicious point based on the numerical range to which the comprehensive value belongs;
[0023] (3) Determining the grade of the casing shrink tube: Determine the grade of the casing shrink tube according to the lowest grade of the suspicious points in the casing shrink tube obtained in step (2).
[0024] Preferably, the numerical range in step (2) is obtained by a support vector machine self-learning step: the RGB image of the casing shrink tube is processed into a Lab image and a grayscale image, the Lab image is filtered and binarized by a dynamic threshold to obtain suspicious color sample points in the casing shrink tube image, the grayscale image is filtered and binarized by a dynamic threshold to obtain suspicious black and white sample points in the casing shrink tube image, the suspicious color sample points and the suspicious black and white sample points are merged to obtain all suspicious sample points of the casing shrink tube, and each obtained suspicious sample point is matched to the RGB image of the casing shrink tube for level setting;
[0025] The support vector machine calculates the comprehensive value of the image corresponding to each sample suspicious point of the set level and determines the value range of each level of suspicious points.
[0026] Preferably, in the support vector machine self-learning step, the number of samples of suspicious points at each level is more than 100 points.
[0027] Preferably, the comprehensive value is determined by image features, and the image features include pixel mean, pixel variance, texture, pixel maximum value and / or pixel minimum value.
[0028] Preferably, in step (1) and the support vector machine self-learning step, the casing shrinkage tube image is first enhanced and then converted into a Lab image and grayed out; the filtering is mean filtering, and the dynamic threshold refers to mean subtraction filtering; the binarized image is opened and closed to obtain suspicious points.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. The present invention obtains suspicious points in the casing shrinkage tube image based on image processing, takes the image corresponding to the suspicious point as the research object, performs sample self-learning on it by a support vector machine, and then classifies the suspicious points in the casing shrinkage tube image to be graded, determines the grade of the casing shrinkage tube according to the classification level of the suspicious point, and realizes automatic classification of the casing shrinkage tube image.
[0031] 2. The enhancement, filtering, opening and closing operations of the image can accurately identify the boundaries of suspicious points and highlight the suspicious points, which can provide a more accurate basis for the classification of casing shrink tubes and help improve their grading quality.
[0032] 3. The present invention can realize automatic quality grading of casing shrink tubes by using images, which not only improves the efficiency of the grading machine, but also unifies the grading standards, is conducive to improving the grading quality, and is convenient for promotion and application in this field. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a program flow chart of the present invention;
[0034] Figure 2 It is a sub-flow chart for determining the numerical range of suspicious points at each level;
[0035] Figure 3 It is a sub-flow chart for determining the level of each suspicious point in the casing shrink tube image to be graded. DETAILED DESCRIPTION
[0036] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0037] The present invention sets an image receiving module, an image processing module, a setting module, a support vector machine module, a classification processing module and a clearing module in the image classification management software. Among them:
[0038] The image receiving module is used to receive the RGB image of the outer wall of the casing shrink tube acquired by the imaging device.
[0039] The image processing module first extracts the casing shrinkage tube image in the RGB image received by the image receiving module, removes the image of the surrounding environment of the casing shrinkage tube during video recording, and only retains the casing shrinkage tube's own image, so that only the casing shrinkage tube image can be analyzed later to avoid the surrounding noise affecting the grading effect. Then the image processing module converts the casing shrinkage tube image into a Lab image and a grayscale image after enhancement. The Lab image is filtered by 5x5 mean, then binarized by subtracting the mean filter, and then the binarized image is subjected to 3x3 opening and closing operations to obtain the color suspicious points in the casing shrinkage tube image; the grayscale image is filtered by 5x5 mean, then binarized by subtracting the mean filter, and then the binarized image is subjected to 3x3 opening and closing operations to obtain the black and white suspicious points in the casing shrinkage tube image; the color suspicious points and the black and white suspicious points are merged to obtain all the suspicious points in the casing shrinkage tube image, and all the suspicious points are matched to the casing shrinkage tube image;
[0040] The setting module is used to set the level of each suspicious point in the casing shrinkage image. The number of levels set for the suspicious points is consistent with the number of levels of the casing shrinkage pre-grading. For example, if the casing shrinkage is to be divided into 3 levels, the suspicious points are set to 3 levels, specifically level 1 suspicious points, level 2 suspicious points and level 3 suspicious points. Specifically, keyboard input, touch screen selection or writing, or voice input can be used. In short, as long as it supports manual level setting based on the performance characteristics of the image at the suspicious point, it will be fine. The setting personnel are professional engineers who have been trained and screened according to the company's casing grading standards. The judgment basis is only based on the performance characteristics of the image and is not affected by social attributes such as personal preferences.
[0041] The support vector machine module, on the one hand, learns the image features of the area where each suspicious point is located in each set level, calculates the comprehensive value of the image in the area where the suspicious point is located, and determines the numerical range of suspicious points at each level; on the other hand, it is used to calculate the comprehensive value of the image in the area where each suspicious point is located in the casing shrink tube image to be graded. The number of images of the area where the suspicious point is located in each level is at least 100. The image features based on which the comprehensive value is calculated include image color, image grayscale, image contrast, texture, pixel mean, pixel variance, pixel maximum and pixel minimum, etc.
[0042] The grading processing module is used to determine the grade of each suspicious point according to the numerical range of the comprehensive value of the image of the area where each suspicious point is located in the casing shrink tube image to be graded, and determine the grade of the casing shrink tube according to the grade of the lowest grade suspicious point in the casing shrink tube.
[0043] The clearing module is used to clear the numerical ranges of suspicious points of various levels that have been learned and determined in the support vector machine module, so as to facilitate timely change of the numerical ranges corresponding to the grading standards as the grading standards are improved.
[0044] The present invention also provides a method for grading casing shrink tube images. Figure 1 As shown, this is achieved through the following steps:
[0045] (1) Determine the suspicious points of the casing shrinkage tube to be graded: Figure 3 As shown, the RGB image of the casing shrink tube is processed into a Lab image and a grayscale image after enhancement. The Lab image is filtered by a 5x5 mean filter and then binarized by a mean-reducing filter. The binarized image is subjected to a 3x3 opening and closing operation to obtain the color suspicious points in the casing shrink tube image. The grayscale image is filtered by a 5x5 mean filter and then binarized by a mean-reducing filter. The binarized image is subjected to a 3x3 opening and closing operation to obtain the black and white suspicious points in the casing shrink tube image. The color suspicious points and the black and white suspicious points are merged to obtain all the suspicious points of the casing shrink tube.
[0046] (2) Determining the level of each suspicious point in the casing shrink tube to be graded: Corresponding the suspicious points obtained in step (1) to the RGB image of the casing shrink tube, using a support vector machine to calculate the comprehensive value of the image corresponding to each suspicious point in the RGB image, and determining the level of each suspicious point based on the numerical range to which the comprehensive value belongs;
[0047] (3) Determine the grade of the casing shrink tube: Determine the grade of the casing shrink tube according to the lowest grade of the suspicious points in the casing shrink tube obtained in step (2). As shown in the figure, take the case where the grade number of the casing shrink tube is set to 3 as an example, that is, the casing shrink tube is divided into 3 grades: grade 1, grade 2 and grade 3, and the grades of the suspicious points are also corresponding to grade 1, grade 2 and grade 3. If all the suspicious points in the image of the casing shrink tube to be graded are grade 1, then the casing shrink tube is judged as a grade 1 product; if among all the suspicious points in the image of the casing shrink tube to be graded, there are not only grade 1 points, but also grade 2 points, but no grade 3 points, then the casing shrink tube is judged as a grade 2 product; if among all the suspicious points in the image of the casing shrink tube to be graded, there are not only grade 1 points, but also grade 2 points, but no grade 3 points, then the casing shrink tube is judged as a grade 2 product; if among all the suspicious points in the image of the casing shrink tube to be graded, there are not only grade 1 points, grade 2 points, but also grade 3 points, then the casing shrink tube is judged as a grade 3 product. In this way, the quality grading of the casing shrink tube is completed.
[0048] In the above step (2), the numerical range used by the support vector machine to determine the level of each suspicious point can be obtained by the image grading device provider through self-learning by the support vector machine before leaving the factory; or the image grading device provider can determine it through self-learning before grading. The process of self-learning is as follows: Figure 2As shown in the figure: the RGB image of the sample casing shrink tube is processed into a Lab image and a grayscale image after being enhanced. The Lab image is filtered by 5x5 mean and then binarized by subtracting mean filtering. The binarized image is then subjected to 3x3 opening and closing operations to obtain the color suspicious points in the casing shrink tube image; the grayscale image is filtered by 5x5 mean and then binarized by subtracting mean filtering. The binarized image is then subjected to 3x3 opening and closing operations to obtain the black and white suspicious points in the casing shrink tube image; the color suspicious points and the black and white suspicious points are merged to obtain all the suspicious points of the sample casing shrink tube, and the obtained sample suspicious points are matched to the RGB image of the casing shrink tube for level setting. Then the support vector machine calculates the comprehensive value of the corresponding image of each sample suspicious point of the set level. The number of samples of each level of suspicious points is more than 100 points, and then the numerical range of each level of suspicious points is determined according to the distribution of the comprehensive value. The image features used to calculate the comprehensive value include image color, image grayscale, image contrast, texture, pixel mean, pixel variance, pixel maximum value and pixel minimum value.
[0049] In addition to the mean filtering method in the above embodiment, the filtering method in the present invention can also adopt other conventional image filtering methods, as long as it can reduce the noise of the image, and there is no specific requirement for its implementation method; similarly, in addition to using the above-mentioned mean reduction filtering to realize the dynamic threshold, other dynamic threshold methods can also be used.
[0050] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
Claims
1. A casing shrink tube image grading system, characterized by: include: Image receiving module: used for receiving the RGB image of the outer wall of the casing shrink tube acquired by the imaging device; Image processing module: extracts the casing shrinkage tube image from the RGB image received by the image receiving module. The casing shrink tube image is converted into a Lab image, and the Lab image is filtered and binarized by a dynamic threshold to obtain the color suspicious points in the casing shrink tube image; The casing shrink tube image is grayed to obtain a gray image, and the gray image is filtered and binarized by a dynamic threshold to obtain black and white suspicious points in the casing shrink tube image; Merge the color suspicious points and the black and white suspicious points to obtain all the suspicious points in the casing shrink tube image, and correspond all the suspicious points to the casing shrink tube image; Setting module: used to set the level of each suspicious point in the casing shrink tube image; Support vector machine module: The support vector machine calculates the comprehensive value of the image of the area where each suspicious point in each level is located, and determines the value range of the suspicious points at each level; Grading processing module: Determine the grade of each suspicious point according to the numerical range of the comprehensive value of the image of the area where each suspicious point is located in the casing shrink tube image to be graded, and determine the grade of the casing shrink tube according to the grade of the lowest grade suspicious point in the casing shrink tube.
2. The casing shrink tube image grading system according to claim 1, characterized in that: It also includes a clearing module for clearing the numerical ranges of suspicious points at various levels in the support vector machine module.
3. The casing shrink tube image grading system according to claim 1 or 2, characterized in that: The image processing module further performs enhancement processing on the casing shrinkage tube image, and the casing shrinkage tube image after enhancement processing is converted into a Lab image and grayscale processing.
4. The casing shrink tube image grading system according to claim 3, characterized in that: The filtering is mean filtering, and the dynamic threshold refers to mean-subtracted filtering.
5. The sausage casing shrink tube image grading system according to claim 3, characterized in that: The image processing module also performs opening and closing operations on the obtained binary image.
6. A method for grading sausage casing shrinkage tube images, characterized in that: The following steps are involved: (1) Determine the suspicious points of the casing shrinkage tube to be graded: The RGB image of the casing shrinkage tube is processed into a Lab image and a grayscale image respectively. The Lab image is filtered and binarized by a dynamic threshold to obtain the color suspicious points in the casing shrinkage tube image. The grayscale image is filtered and binarized by a dynamic threshold to obtain the black and white suspicious points in the casing shrinkage tube image. The color suspicious points and the black and white suspicious points are merged to obtain all the suspicious points of the casing shrinkage tube. (2) Determining the level of each suspicious point in the casing shrink tube to be graded: Corresponding the suspicious points obtained in step (1) to the RGB image of the casing shrink tube, using a support vector machine to calculate the comprehensive value of the image corresponding to each suspicious point in the RGB image, and determining the level of each suspicious point based on the numerical range to which the comprehensive value belongs; (3) Determining the grade of the casing shrink tube: Determine the grade of the casing shrink tube according to the lowest grade of the suspicious points in the casing shrink tube obtained in step (2).
7. The method for grading sausage casing shrinkage tube images according to claim 6, characterized in that: The numerical range in step (2) is obtained by the self-learning step of the support vector machine: the RGB image of the casing shrink tube is processed into a Lab image and a grayscale image respectively, the Lab image is filtered and binarized by a dynamic threshold to obtain the color sample suspicious points in the casing shrink tube image, the grayscale image is filtered and binarized by a dynamic threshold to obtain the black and white sample suspicious points in the casing shrink tube image, the color sample suspicious points and the black and white sample suspicious points are merged to obtain all the sample suspicious points of the casing shrink tube, and each obtained sample suspicious point is corresponded to the RGB image of the casing shrink tube for level setting; The support vector machine calculates the comprehensive value of the image corresponding to each sample suspicious point of the set level and determines the value range of each level of suspicious points.
8. The method for grading sausage casing shrinkage tube images according to claim 7, characterized in that: In the support vector machine self-learning step, the number of samples of suspicious points at each level is more than 100 points.
9. The method for grading sausage casing shrinkage tube images according to claim 7, characterized in that: The comprehensive value is determined by image features, and the image features include one of image color, image grayscale, image contrast, texture, pixel mean, pixel variance, pixel maximum value and pixel minimum value, or a combination of any two or more thereof.
10. The method for grading sausage casing shrinkage tube images according to claim 7, characterized in that: In step (1) and the support vector machine self-learning step, the casing shrinkage tube image is first enhanced and then converted into a Lab image and grayed out; the filtering is mean filtering, and the dynamic threshold refers to mean subtraction filtering; the binarized image is opened and closed to obtain suspicious points.
