A method for distinguishing the front and back of tobacco leaves based on multi-feature elements of machine vision

Through machine vision technology, combined with multi-feature element identification method, characteristic elements are used to judge tobacco leaves in different parts, solving the problem of low accuracy in discrimination of front and back sides of tobacco leaves, achieving high accuracy tobacco leaves recognition, and providing intelligent grading of tobacco leaves Technical support.

CN114998305BInactive Publication Date: 2024-12-03KUNMING UNIV OF SCI & TECH +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202210763123.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2024-12-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art has low accuracy in the discrimination of the front and back sides of tobacco leaves, especially in different parts of the thresholds of tobacco leaves, making it difficult to accurately identify a single factor judgment, resulting in a decrease in the accuracy of tobacco leaves grading.

Method used

Using a multi-feature element discrimination method based on machine vision, the color information and shape texture characteristics of tobacco leaves are extracted through equipment irrelevant processing and image preprocessing. Combined with HSV color space and RGB color space, different tobacco leaves are adopted for the upper, middle and lower parts. The characteristic elements are determined, including color saturation, lemon yellow proportion, orange yellow proportion and leaf vein area proportion.

Benefits of technology

It has achieved high accuracy identification of tobacco leaves in different parts, overcomes the shortcomings of single factor judgment, improves the accuracy of the discrimination of the front and back sides of tobacco leaves, and provides technical support for intelligent grading of tobacco leaves.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114998305B_ABST
    Figure CN114998305B_ABST
Patent Text Reader

Abstract

The present invention provides a method for distinguishing the front and back of tobacco leaves based on multi-feature elements of machine vision, which relates to the field of computer image processing and includes the following steps: collecting tobacco leaf images at the top, middle and bottom parts independently of equipment and preprocessing the images; extracting color information of preprocessed tobacco leaf images; extracting tobacco leaf shape and texture features; and judging the front and back of tobacco leaves based on multi-feature elements. The present invention has the advantages of wide applicability and high accuracy, and provides effective technical support for tobacco leaf grading.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of machine vision, and in particular relates to a method for distinguishing the front and back sides of tobacco leaves based on multiple feature elements of machine vision. Background Art

[0002] With the continuous development of computer information technology, machine learning has been widely used in the cigarette industry. In tobacco leaf grading, the color and texture information on the front of the tobacco leaf plays a decisive role, and the front and back identification of the tobacco leaf is the first step in tobacco leaf grading. If the computer misjudges the front and back of the tobacco leaf, it will cause the tobacco leaf grade to be misclassified, resulting in a decrease in the accuracy of tobacco leaf grading. Therefore, the industry urgently needs to study a fast and highly accurate intelligent grading system.

[0003] However, the information of the front and back of tobacco leaves at different parts is relatively complex, and the accuracy rate of judging the front and back of tobacco leaves by a single factor is low. Invention CN114463275A provides an online front and back identification method of tobacco leaves based on an image acquisition device, but the thresholds of tobacco leaves at different parts are different, and the applicability to the front and back of tobacco leaves at all parts is not strong. Summary of the invention

[0004] In order to solve the above problems, the present invention provides a method for distinguishing the front and back sides of tobacco leaves based on multi-feature elements of machine vision, which can achieve good recognition accuracy for tobacco leaves in different parts. The method is simple to operate and has a high recognition accuracy for tobacco leaves in different parts, thus overcoming the defects of the above-mentioned prior art.

[0005] The present invention is implemented by the following technical scheme: A method for distinguishing the front and back sides of tobacco leaves based on multiple feature elements of machine vision, comprising the following steps:

[0006] S1: After device-independent processing, collect tobacco leaf images at the top, middle and bottom parts and pre-process the images;

[0007] S2: Extracting the color information of the preprocessed tobacco leaf image: converting the tobacco leaf minimum circumscribed rectangle image of S1 into an array format, not reading the pixels of R=0, B=0, G=0, so as to filter out the pixels irrelevant to the tobacco leaf in the image, filter out all the black background in the minimum circumscribed rectangle of the tobacco leaf, and only retain the pixels related to the tobacco leaf; split the RGB three channels of the image, and obtain the mean value of the R channel, the mean value of the G channel, and the mean value of the B channel, as well as the lemon yellow proportion, orange yellow proportion, and red brown proportion of the tobacco leaf;

[0008] The collected tobacco leaf image is converted into the HSV color space. The black pixels in the image are filtered out by not reading R=0, B=0, and G=0, and the color saturation mean X under the S component is obtained:

[0009]

[0010] Where X1 is the pixel value, and X2 is the total number of pixels;

[0011] S3: Extracting tobacco leaf shape and texture features: Based on the tobacco leaf minimum circumscribed rectangle image in S1, extract the tobacco leaf vein area and obtain the tobacco leaf vein area ratio;

[0012] S4: Determine the front and back of tobacco leaves based on multiple feature elements, which is divided into three parts: the upper, middle and lower parts of the tobacco leaves. Because the color brightness of the front and back of the tobacco leaves is different, the color saturation of the S component of the HSV color space is used as the main feature determination factor, and the other feature elements are auxiliary determination factors; specifically, it can be divided into the following steps:

[0013] Upper smoke: The color saturation of the S component of the HSV color space is used as the main feature determination factor; the upper smoke has sufficient light, and the lemon yellow distribution on the front and back is obvious, so lemon yellow is used as an auxiliary determination factor; the red-brown proportion and the B channel mean are then used for auxiliary feature determination;

[0014] Central smoke: The main feature determination factor is the color saturation of the S component of the HSV color space; the B channel mean, lemon yellow proportion and orange yellow proportion are auxiliary determination bases;

[0015] Lower tobacco: The color saturation of the S component in the HSV color space is used as the main feature determination factor; the leaf surface of lower tobacco is relatively flat, the wrinkles are finer and smaller, and the veins are easier to extract. Therefore, in addition to selecting the B channel mean and the proportion of lemon yellow as auxiliary determination bases, the vein area proportion is used as an auxiliary determination factor.

[0016] The device-independent processing in S1 is to perform black and white field and color curve correction on the camera, perform color error management on the image acquisition device and the display device, fix the standard light source, use black as the acquisition background, and the vertical distance between the center position of the industrial camera and the tobacco leaf collection area to be detected is 70 cm, so as to obtain device-independent image information to the maximum extent and collect images.

[0017] The image preprocessing in S1 is to use median filtering and image morphology to remove tobacco leaf noise, obtain the image contour boundary after graying the image, and use image geometric transformation to obtain the tobacco leaf minimum circumscribed rectangle image.

[0018] The determination range of the S4 upper smoke is as follows:

[0019] 1) Determine the color saturation of the S component in the HSV color space: the average color saturation is between 245-255, indicating the front side of the tobacco leaf, and between 210-235 indicating the back side;

[0020] 2) When the color saturation of the S component is between 235 and 245, the B channel mean value in the RGB color space is used for judgment: when the B channel mean value is between 0 and 5, the tobacco leaf is on the front side, and when the B channel mean value is between 15 and 50, the tobacco leaf is on the back side;

[0021] 3) For the B channel mean between 5 and 15, the lemon yellow percentage is used for judgment, 0-10% for the positive side, and 35%-95% for the negative side;

[0022] 4) When the proportion of lemon yellow is between 10% and 35%, use the proportion of red and brown and retrograde judgment, and 35% to 95% is positive.

[0023] The determination range of the S4 middle smoke is as follows:

[0024] 1) Determine the front and back of the tobacco leaf by color saturation. The color saturation mean X under the S component is 245-255 for the front side and 205-235 for the back side;

[0025] 2) When the color saturation mean X of the S component is between 235 and 245, the mean of the B channel in the BGR color space is used for judgment: 0-5 is positive, and 15-40 is negative;

[0026] 3) If the mean value of channel B is between 5 and 15, the proportion of lemon yellow is used for judgment: 0-20% is positive; 70%-95% is negative;

[0027] 4) When the lemon yellow ratio is between 20% and 70%, the orange yellow ratio is used for judgment: 0-30% is the front side, and 70%-95% is the back side.

[0028] The determination range of the lower smoke of S4 is as follows:

[0029] 1) Determine the front and back of the tobacco leaf by color saturation. The color saturation mean X under the S component is 240-255 for the front side and 200-240 for the back side;

[0030] 2) When the color saturation mean X of the S component is between 235 and 245, the mean of the B channel in the BGR color space is used for judgment: 0-5 is positive, and 25-50 is negative;

[0031] 3) For those with a mean value of channel B between 5 and 15, the proportion of lemon yellow is used for judgment: 0-35% is positive; 70%-95% is negative;

[0032] 4) When the lemon yellow ratio is between 20% and 70%, the leaf vein ratio is used for judgment: 0-1% is the front side, and 2%-10% is the back side.

[0033] The beneficial effects of the present invention are:

[0034] The present invention provides a method for distinguishing the front and back sides of tobacco leaves based on machine vision using multiple characteristic elements of tobacco leaves, extracts tobacco leaf color space, color proportion, and tobacco leaf vein area, and adopts different characteristic elements to distinguish the front and back sides of tobacco leaves according to tobacco leaves in different parts. The method has the characteristics of wide applicability and high recognition accuracy for tobacco leaves in different parts. The present invention solves the problem of low accuracy in distinguishing the front and back sides of tobacco leaves caused by tobacco leaves being in different parts, and provides technical support for intelligent grading of tobacco leaves. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a flow chart for judging the front and back sides of tobacco leaves of the present invention;

[0036] Figure 2 This is a schematic diagram of tobacco leaf identification according to the present invention;

[0037] Figure 3 is the upper smoke color saturation threshold distribution map;

[0038] Figure 4 It is the distribution map of the color saturation threshold of the smoke in the middle;

[0039] Figure 5 It is the distribution map of the lower smoke color saturation threshold. DETAILED DESCRIPTION

[0040] In order to clearly and completely describe the technical solution and technical effects of the present invention, they are described in detail through the following embodiments.

[0041] Example 1

[0042] like Figure 1 As shown, the method for distinguishing the front and back sides of tobacco leaves based on multi-feature elements of machine vision includes the following steps:

[0043] S1: Device-independent processing is performed, black and white field and color curve correction is performed on the camera, color error management is performed on the image acquisition device and display device, a standard light source is fixed, black is used as the acquisition background, and the vertical distance between the center position of the industrial camera and the tobacco leaf collection area to be tested is 70 cm, so as to obtain device-independent image information to the maximum extent and collect images.

[0044] Then collect tobacco leaf images at the upper, middle and lower parts and pre-process the images;

[0045] Lay out tobacco leaves from all parts and put them on the conveyor belt. Use image sensors and high-definition industrial cameras to collect images of tobacco leaves from the upper, middle and lower parts under a standard white light source. When collecting tobacco leaf images, the center of the rectangular collection area and the center of the camera lens are on the same vertical line, and the distance between the white light source and the tobacco leaves to be tested is 60CM.

[0046] In order to avoid the loss of tobacco leaf surface image due to the color of tobacco leaf page being similar to the background color of the collection area in subsequent image processing, black is selected as the tobacco leaf collection background, and it is ensured that there should be no extra colors in the background color at the center of the collection area.

[0047] For image preprocessing, median filtering and image morphology are used to remove tobacco leaf noise. After the image is grayed out, the image contour boundary is obtained, and the minimum circumscribed rectangle image of the tobacco leaf is obtained by image geometric transformation.

[0048] S2: Extracting the color information of the preprocessed tobacco leaf image: converting the tobacco leaf minimum circumscribed rectangle image of S1 into an array format, not reading the pixels of R=0, B=0, G=0, so as to filter out the pixels irrelevant to the tobacco leaf in the image, filter out all the black background in the minimum circumscribed rectangle of the tobacco leaf, and only retain the pixels related to the tobacco leaf; split the RGB three channels of the image, and obtain the mean value of the R channel, the mean value of the G channel, and the mean value of the B channel, as well as the lemon yellow proportion, orange yellow proportion, and red brown proportion of the tobacco leaf;

[0049] The collected tobacco leaf image is converted into the HSV color space. The black pixels in the image are filtered out by not reading R=0, B=0, and G=0, and the color saturation mean X under the S component is obtained:

[0050]

[0051] Where X1 is the pixel value, and X2 is the total number of pixels;

[0052] S3: Extracting tobacco leaf shape and texture features: Based on the tobacco leaf minimum circumscribed rectangle image in S1, extract the tobacco leaf vein area and obtain the tobacco leaf vein area ratio;

[0053] S4: Determine the front and back of tobacco leaves based on multiple feature elements: Figure 2 As shown in the figure, different characteristic elements are selected for determination for tobacco leaves in different parts. Since the color brightness of the front and back sides of tobacco leaves is different, the color saturation of the S component of the HSV color space is used as the main characteristic determination element, and the other characteristic elements are auxiliary determination elements; since the R channel means of tobacco leaves in the three parts are all in the range of 100-200, and the R channel and the G channel determine the hue of the tobacco leaves, the RGB color space only uses the B channel as the characteristic determination element; according to the national standard, XL, CL, and BL belong to the lemon yellow group, and XF, CF, and BF belong to the orange group, so lemon yellow and orange can be used as auxiliary determination elements; according to the national standard, reddish brown is mainly concentrated in the upper tobacco leaves, so reddish brown is used as the auxiliary characteristic determination element for the upper tobacco leaves; according to the characteristics of the tobacco leaf parts, the lower tobacco leaves have flatter pages and smaller wrinkles, so the veins are easy to extract, and the vein ratio is used as the characteristic determination element for the lower tobacco leaves; as shown in the figure, Figure 3-5 ;

[0054] The specific steps are as follows:

[0055] Upper smoke: The main feature determination factor is the color saturation of the S component of the HSV color space; the upper smoke has sufficient light, and the front and back sides have obvious lemon yellow distribution, so lemon yellow is used as an auxiliary determination factor; the B channel mean and the red-brown ratio are used for auxiliary determination, and the determination range is as follows:

[0056] 1) Determine the color saturation of the S component in the HSV color space: the average color saturation is between 245-255, indicating the front side of the tobacco leaf, and between 210-235 indicating the back side;

[0057] 2) When the color saturation of the S component is between 235 and 245, the B channel mean value in the RGB color space is used for judgment: when the B channel mean value is between 0 and 5, the tobacco leaf is on the front side, and when the B channel mean value is between 15 and 50, the tobacco leaf is on the back side;

[0058] 3) For the B channel mean between 5 and 15, the lemon yellow percentage is used for judgment, 0-10% for the positive side, and 35%-95% for the negative side;

[0059] 4) If the lemon yellow ratio is between 10% and 35%, use the red-brown ratio and retrograde judgment, and 35% to 95% is positive;

[0060] 5) A small amount of tobacco leaves that cannot be identified shall be identified manually;

[0061] Middle tobacco: Based on the national standard and the characteristics of the front and back of the tobacco leaves, the color saturation of the S component of the HSV color space is used as the main feature determination factor; the middle tobacco grows and matures under the conditions of good ventilation and light transmission, and its characteristics and features are more obvious. The B channel mean, lemon yellow ratio, and orange yellow ratio are used as auxiliary judgment bases; the judgment range is as follows:

[0062] 1) Determine the front and back of the tobacco leaf by color saturation. The color saturation mean X under the S component is 245-255 for the front side and 205-235 for the back side;

[0063] 2) When the color saturation mean X of the S component is between 235 and 245, the mean of the B channel in the BGR color space is used for judgment: 0-5 is positive, and 15-40 is negative;

[0064] 3) If the mean value of channel B is between 5 and 15, the proportion of lemon yellow is used for judgment: 0-20% is positive; 70%-95% is negative;

[0065] 4) If the lemon yellow ratio is between 20% and 70%, the orange yellow ratio is used for judgment: 0-30% is the front side, and 70%-95% is the back side;

[0066] 5) A small amount of judgment is made by manual judgment;

[0067] Lower tobacco: The color saturation of the S component of the HSV color space is used as the main feature determination factor; because the lower tobacco leaf surface is relatively flat, the wrinkles are thinner and smaller, and the leaf veins are easier to extract, in addition to selecting the B channel mean and the lemon yellow ratio as auxiliary determination criteria, the leaf vein area ratio is used as an auxiliary determination basis; the determination range is as follows:

[0068] 1) Determine the front and back of the tobacco leaf by color saturation. The color saturation mean X under the S component is 240-255 for the front side and 200-240 for the back side;

[0069] 2) When the color saturation mean X of the S component is between 235 and 245, the mean of the B channel in the BGR color space is used for judgment: 0-5 is positive, and 25-50 is negative;

[0070] 3) For those with a mean value of channel B between 5 and 15, the proportion of lemon yellow is used for judgment: 0-35% is positive; 70%-95% is negative;

[0071] 4) If the lemon yellow ratio is between 20% and 70%, the leaf vein ratio is used for judgment: 0-1% is the front side, and 2%-10% is the back side;

[0072] 5) A small amount of judgment is made manually.

Claims

1. A method for distinguishing the front and back sides of tobacco leaves based on multi-feature elements of machine vision, characterized in that The steps include: S1: After device-independent processing, collect tobacco leaf images at the top, middle and bottom parts and pre-process the images; S2: Extract color information of preprocessed tobacco leaf image: convert the tobacco leaf minimum circumscribed rectangle image of S1 into array format, do not read the pixels of R=0, B=0, G=0, filter out all black background in the minimum circumscribed rectangle of tobacco leaves, and only keep the relevant pixels of tobacco leaves; split the RGB three channels of the image, and obtain the mean of the R channel, the mean of the G channel and the mean of the B channel, as well as the lemon yellow proportion, the orange yellow proportion, and the red brown proportion of tobacco leaves; The collected tobacco leaf image is converted into the HSV color space. The black pixels in the image are filtered out by not reading R=0, B=0, and G=0, and the color saturation mean X under the S component is obtained: Where X1 is the pixel value, and X2 is the total number of pixels; S3: Extracting tobacco leaf shape and texture features: Based on the tobacco leaf minimum circumscribed rectangle image in S1, extract the tobacco leaf vein area and obtain the tobacco leaf vein area ratio; S4: Determine the front and back of tobacco leaves based on multiple feature elements, which is divided into three parts: the upper, middle and lower parts of tobacco leaves. Because the color brightness of the front and back of tobacco leaves is different, the color saturation of the S component of the HSV color space is used as the main feature determination factor, and the other feature elements are auxiliary determination factors; the specific steps are as follows: Upper smoke: The main feature determination factor is the color saturation of the S component in the HSV color space; The upper part has sufficient light, and the front and back sides have obvious distribution of lemon yellow, so lemon yellow is used as an auxiliary judgment factor; the red-brown ratio and the mean value of the B channel are then used for auxiliary feature judgment; Central smoke: The main feature determination factor is the color saturation of the S component of the HSV color space; the B channel mean, lemon yellow proportion and orange yellow proportion are auxiliary determination bases; Lower smoke: The main feature determination factor is the color saturation of the S component in the HSV color space; The lower tobacco leaf surface is relatively flat, the wrinkles are finer and smaller, and the veins are easier to extract. Therefore, in addition to selecting the B channel mean and the proportion of lemon yellow as auxiliary judgment bases, the vein area proportion is used as an auxiliary judgment factor.

2. The method for distinguishing the front and back sides of tobacco leaves based on multiple feature elements of machine vision according to claim 1, characterized in that: The device-independent processing in S1 is to perform black and white field and color curve correction on the camera, perform color error management on the image acquisition device and the display device, fix the standard light source, use black as the acquisition background, and the vertical distance between the center position of the industrial camera and the tobacco leaf collection area to be detected is 70 cm, so as to obtain device-independent image information to the maximum extent and collect images.

3. The method for distinguishing the front and back sides of tobacco leaves based on multiple feature elements of machine vision according to claim 1, characterized in that: The image preprocessing in S1 is to use median filtering and image morphology to remove tobacco leaf noise, obtain the image contour boundary after graying the image, and use image geometric transformation to obtain the tobacco leaf minimum circumscribed rectangle image.

4. The method for distinguishing the front and back sides of tobacco leaves based on multiple feature elements of machine vision according to claim 1, characterized in that: The determination range of the S4 upper smoke is as follows: 1) Determine the color saturation of the S component in the HSV color space: the average color saturation is between 245-255, indicating the front side of the tobacco leaf, and between 210-235 indicating the back side; 2) When the color saturation of the S component is between 235 and 245, the B channel mean value in the RGB color space is used for judgment: when the B channel mean value is between 0 and 5, the tobacco leaf is on the front side, and when the B channel mean value is between 15 and 50, the tobacco leaf is on the back side; 3) For the B channel mean between 5 and 15, the lemon yellow percentage is used for judgment, 0-10% for the positive side, and 35%-95% for the negative side; 4) When the proportion of lemon yellow is between 10% and 35%, use the proportion of red and brown and retrograde judgment, and 35% to 95% is positive.

5. The method for distinguishing the front and back sides of tobacco leaves based on multiple feature elements of machine vision according to claim 1, characterized in that: The determination range of the S4 middle smoke is as follows: 1) Determine the front and back of the tobacco leaf by color saturation. The color saturation mean X under the S component is 245-255 for the front side and 205-235 for the back side; 2) When the color saturation mean X of the S component is between 235 and 245, the mean of the B channel in the BGR color space is used for judgment: 0-5 is positive, and 15-40 is negative; 3) If the mean value of channel B is between 5 and 15, the proportion of lemon yellow is used for judgment: 0-20% is positive; 70%-95% are reverse; 4) When the lemon yellow ratio is between 20% and 70%, the orange yellow ratio is used for judgment: 0-30% is the front side, and 70%-95% is the back side.

6. The method for distinguishing the front and back sides of tobacco leaves based on multiple feature elements of machine vision according to claim 1, characterized in that: The determination range of the lower smoke of S4 is as follows: 1) Determine the front and back of the tobacco leaf by color saturation. The color saturation mean X under the S component is 240-255 for the front side and 200-240 for the back side; 2) When the color saturation mean X of the S component is between 235 and 245, the mean of the B channel in the BGR color space is used for judgment: 0-5 is positive, and 25-50 is negative; 3) If the mean value of channel B is between 5 and 15, the proportion of lemon yellow is used for judgment: 0-35% is positive; 70%-95% are reverse; 4) When the lemon yellow ratio is between 20% and 70%, the leaf vein ratio is used for judgment: 0-1% is the front side, and 2%-10% is the back side.

Citation Information

Cited By

  • Method and equipment for automatically identifying front and back sides of tobacco leaves and extracting features

    CN121190784A