CN114304699A - Method for extracting green and yellow ratio of primary flue-cured tobacco leaves - Google Patents

Method for extracting green and yellow ratio of primary flue-cured tobacco leaves Download PDF

Info

Publication number
CN114304699A
CN114304699A CN202111613968.8A CN202111613968A CN114304699A CN 114304699 A CN114304699 A CN 114304699A CN 202111613968 A CN202111613968 A CN 202111613968A CN 114304699 A CN114304699 A CN 114304699A
Authority
CN
China
Prior art keywords
image
tobacco leaves
yellow
tobacco
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111613968.8A
Other languages
Chinese (zh)
Inventor
薛辰
林珈夷
彭云发
张军
石超
薛庆逾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Microvision Technology Co ltd
Original Assignee
Shanghai Microvision Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Microvision Technology Co ltd filed Critical Shanghai Microvision Technology Co ltd
Priority to CN202111613968.8A priority Critical patent/CN114304699A/en
Publication of CN114304699A publication Critical patent/CN114304699A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Manufacture Of Tobacco Products (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a method for extracting the proportion of green and yellow of tobacco leaf primary baking, which comprises the steps of collecting an image of fresh tobacco leaf in a baking room, reading the image, converting the image data into RGB color space, and obtaining the RGB channel pixel value of the image; setting a threshold value based on the difference value of the pixel values of the two channels R, G to set the background part except the tobacco leaves in the image to be white, obtaining an image which only represents the tobacco leaves by taking the white as the background, further converting the image into HSV color space numerical values to represent, obtaining the pixel point number of the yellow part of the tobacco leaves by setting the threshold value on the pixel value of the H channel, and finally dividing the pixel point number of the yellow part of the tobacco leaves by the pixel point number representing the whole tobacco leaves, wherein the obtained percentage is the yellow proportion of the tobacco leaves. The method for extracting the green-yellow ratio of the primary flue-cured tobacco can improve the regulation efficiency for realizing the machine vision digital curing of the tobacco when applied to the primary flue-cured tobacco.

Description

Method for extracting green and yellow ratio of primary flue-cured tobacco leaves
Technical Field
The invention belongs to the technical field of computer machine vision, and particularly relates to a method for extracting the green-yellow ratio of primary flue-cured tobacco leaves.
Background
The primary process of tobacco primary curing is to change planted tobacco into cigarette raw materials, and is a process that farmers place fresh tobacco harvested from the field into a curing barn to cure and modulate the fresh tobacco to become cigarette raw materials. Different baking temperatures are respectively set in the fresh tobacco leaf yellowing stage, the color fixing stage and the stem drying stage, so that the fresh tobacco leaves are sequentially baked to reach the tobacco leaf states of yellowing area, soft collapse and main vein softening in a certain proportion, and the yellow leaf yellow stem tip-hooked and curled tobacco leaf form is formed, and further the final main vein baked raw tobacco is obtained. The whole process not only needs to observe the change state of the tobacco leaves in real time to control the temperature and humidity of the curing barn through a flexible handle, but also needs to adjust the environment of the curing barn according to the change of the environment or the climate temperature and humidity. In the prior art, the tobacco leaf is primarily baked by adopting a manual judgment mode, time and labor are consumed, and the speed can be increased and the labor consumption can be reduced by applying a machine vision method.
In the traditional method, an expert judges the tobacco state through human eye recognition to serve as a judgment basis for adjusting the temperature and the humidity of a curing barn, and the method is dependent on manpower and consumes time. In the prior art, an intelligent controller is adopted to regulate the temperature and the humidity of a curing barn, however, the most critical factor of tobacco curing is the actual change state of fresh tobacco leaves, so that the yellowing proportion characteristic changed along with the tobacco curing process is not effectively extracted.
Disclosure of Invention
The invention is carried out to solve the problems and aims to provide a method for extracting the green-yellow ratio of flue-cured tobacco leaves based on computer machine vision judgment.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention provides a method for extracting the proportion of green and yellow of flue-cured tobacco leaves, which is characterized by comprising the following steps of: step one, acquiring an image of a primary flue-cured raw tobacco sample to be detected; reading an image, converting the image into an RGB color space, and acquiring an RGB channel pixel value of the image; setting a threshold value based on the difference value of the pixel values of the two channels RG to set the background part except the tobacco leaves in the image to be white, and obtaining an image which only represents the tobacco leaves by taking the white as the background; converting the image into an HSV color space numerical value to express, and setting a threshold value for the pixel value of the H channel to obtain the number of pixels of the yellow part of the tobacco leaf; and step five, dividing the number of yellow pixel points by the number of pixel points representing the whole tobacco leaves, wherein the obtained percentage is the yellow proportion of the tobacco leaves.
Further, in the method for extracting the proportion of green and yellow of the flue-cured tobacco leaves provided by the invention, the method can also have the following characteristics: wherein, the image acquisition in the first step is specifically as follows: and aligning the camera lens to the primary grill in the primary curing barn to form a bundle of vertically hung tobacco leaves, flattening each tobacco leaf to be vertical, and further obtaining a complete primary cured tobacco leaf image.
Further, in the method for extracting the proportion of green and yellow of the flue-cured tobacco leaves provided by the invention, the method can also have the following characteristics: wherein, the step two of obtaining the pixel values of the image RGB channels comprises the following steps: step 2-1, reading in an image and acquiring a BGR value of the image; and 2-2, converting the BGR value of the image into an RGB color space to obtain pixel values of three channels of the RGB image.
Further, in the method for extracting the proportion of green and yellow of the flue-cured tobacco leaves provided by the invention, the method can also have the following characteristics: wherein, the step three, obtaining the number of the pixel points representing the tobacco leaves on the image comprises: step 3-1, calculating R, G the difference of the pixel values of the two channels; and 3-2, setting a threshold value for the difference value, assigning the RGB channels of the pixel point positions in the threshold value range to be 255, replacing the background part of the non-tobacco leaves in the image with pure white, and obtaining the image which only represents the tobacco leaves by taking the white as the background.
Further, in the method for extracting the proportion of green and yellow of the flue-cured tobacco leaves provided by the invention, the method can also have the following characteristics: wherein, the step four, acquiring the number of the pixel points representing the whole tobacco leaves and the yellow part on the image comprises: step 4-1, converting the BGR channel pixel value of the image into an HSV color space value to represent; 4-2, setting a threshold range for the pixel value of the H channel, and respectively defining a yellowing part and a cyan part except the yellow part of the tobacco leaf; and 4-3, respectively counting the pixel point quantity of the yellow part of the tobacco leaves and the pixel point quantity of the whole tobacco leaves.
Further, in the method for extracting the proportion of green and yellow of the flue-cured tobacco leaves provided by the invention, the method can also have the following characteristics: and the fifth step further comprises displaying the yellow proportion of the tobacco leaves on the image of the flue-cured tobacco leaves.
The invention has the beneficial effects that:
in the method for extracting the green-yellow ratio of the primary flue-cured tobacco leaves, the images of the fresh tobacco leaves in a curing barn are collected, the images are read in, the image data are converted into RGB color space, and the RGB channel pixel values of the images are obtained; setting a threshold value based on the difference value of the pixel values of the two channels R, G to set the background part except the tobacco leaves in the image to be white, obtaining an image which only represents the tobacco leaves by taking the white as the background, further converting the image into HSV color space numerical values to represent, obtaining the pixel point number of the yellow part of the tobacco leaves by setting the threshold value on the pixel value of the H channel, and finally dividing the pixel point number of the yellow part of the tobacco leaves by the pixel point number representing the whole tobacco leaves, wherein the obtained percentage is the yellow proportion of the tobacco leaves. The method can obtain the primary tobacco curing yellowing state without depending on the manual monitoring of experts by setting corresponding threshold values according to requirements and obtaining the primary tobacco curing yellowing state through the computer program of the method, thereby accelerating the industrial process speed and further realizing the industrial automation. The method has high robustness and no damage, and can be used for intelligent regulation of machine vision tobacco primary baking. In addition, the method for extracting the green-yellow ratio of the primary flue-cured tobacco leaves is applied to digital curing, and the incorporation of the green-yellow ratio characteristics of the primary flue-cured tobacco leaves further improves the efficiency of the digital curing of the tobacco leaves.
Drawings
FIG. 1 is a flow chart of a method for extracting the green-yellow ratio of flue-cured tobacco leaves in the embodiment of the invention;
FIG. 2 is a fresh tobacco leaf collection image in an embodiment of the present invention;
FIG. 3 is an image of fresh tobacco leaves after background removal according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating the extraction of a yellowing partial image of fresh tobacco leaves according to an embodiment of the present invention;
FIG. 5 is an image of cyan portion of fresh tobacco leaf extracted according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating a yellowing ratio of tobacco leaves on an original image according to an embodiment of the present invention.
Detailed Description
In order to make the technical means, the creation features, the achievement purposes and the effects of the invention easy to understand, the following embodiments are specifically described in the technical scheme of the invention with reference to the attached drawings.
< example >
In the embodiment, fresh tobacco leaves in the baking process are used as test objects, and the evaluation of the yellowing degree of an expert in the baking process of a sample is shown in the right column, and is shown in the following table:
TABLE 1 samples of freshly roasted tobacco leaves and expert evaluation
Image name Degree of yellowing
08272227 3 yellowing or less
08280905 3 yellowing or less
08281151 3 yellowing or less
08281208 3 yellowing or less
08281515 3 yellowing or less
08281258 3 yellowing or less
08300319 4-5 yellowing
08300542 5-6 to yellow
08300611 5-6 to yellow
08300915 6-7 yellowing
08310319 7-8 to yellow
08310600 8-9 yellowing
In this embodiment, 2021 year-old fresh flue-cured tobacco leaves in yunnan chuxiong producing area are selected as samples, and referring to fig. 1, the following tobacco leaf texture included angle extraction method is adopted to extract the green-yellow ratio characteristics of the tobacco leaves from the samples:
step one, carrying out image acquisition on a primary flue-cured raw tobacco sample to be detected:
the camera lens is aligned to the primary grill in the primary curing barn to form a bundle of vertically hung tobacco leaves, each tobacco leaf is flattened as much as possible and is vertical, and then a complete primary cured tobacco leaf image (fresh tobacco leaf image) is obtained, as shown in fig. 2.
Reading in an image, converting the image into an RGB color space, and acquiring an image RGB channel pixel value:
step 2-1, reading in an image and acquiring a BGR value of the image;
and 2-2, converting the BGR value of the image into an RGB color space to obtain pixel values of three channels of the RGB image.
Setting a threshold value based on the difference value of the pixel values of the two channels RG to set the background part except the tobacco leaves in the image to be white, and obtaining an image which only represents the tobacco leaves by taking the white as the background:
step 3-1, calculating R, G the difference of the pixel values of the two channels;
and 3-2, assigning the RGB channels of the pixel point positions with the difference values smaller than 30 and larger than 237 to be 255, replacing the background part of the non-tobacco leaves in the image with pure white, and obtaining the image which only represents the tobacco leaves by taking white as the background, as shown in fig. 3.
Step four, converting the image into an HSV color space numerical value to express, and setting a threshold value for the pixel value of the H channel to obtain the pixel number of the yellow part of the tobacco leaf:
step 4-1, converting the BGR value of the image into an HSV color space value to represent;
step 4-2, regarding pixel points with H-channel pixel values larger than 0 and smaller than 32 as yellow parts of the tobacco leaves (as shown in FIG. 4), and defining pixel points with H-channel pixel values between 32 and 58 as cyan parts of the tobacco leaves (as shown in FIG. 5) except yellow;
and 4-3, respectively counting the pixel point quantity of the yellow part of the tobacco leaves and the pixel point quantity of the whole tobacco leaves.
Step five, calculating to obtain the percentage of yellow ratio of the tobacco leaves:
the yellow pixel number is divided by the pixel number representing the whole tobacco leaf, the obtained percentage is the extracted tobacco leaf yellow proportion, and the proportion is displayed on the original fresh tobacco leaf collection image, as shown in fig. 6, which illustrates that the tobacco leaf yellow proportion is 57.75%.
< verification of extraction result of tobacco leaf yellowing ratio >
Table 1 above shows the samples of freshly cured tobacco leaves and expert evaluations, and the following table shows the results of the extraction of the yellowing scale characteristics of the collected images of these samples of freshly cured tobacco leaves in this example:
TABLE 2 the extracted yellowing ratio of this example
Figure BDA0003436414860000051
Figure BDA0003436414860000061
The verification method comprises the following steps:
the yellowing ratio extracted by the method is compared with the evaluation of the cured tobacco by experts.
And (4) verification result:
the yellowing ratio extracted by the method is compared with the evaluation of the cured tobacco by experts, and the comparison result is shown in Table 3.
TABLE 3 comparison of yellowing ratios
Image sequence number Image name Yellowing ratio Degree of yellowing Comparison results
1 08272227 0.87% 3 yellowing or less Uniformity
2 08280905 2.10% 3 yellowing or less Uniformity
3 08281151 2.50% 3 yellowing or less Uniformity
4 08281208 2.63% 3 yellowing or less Uniformity
5 08281515 3.76% 3 yellowing or less Uniformity
6 08281258 26.98% 3 yellowing or less Uniformity
7 08300319 46.80% 4-5 yellowing Uniformity
8 08300542 51.22% 5-6 to yellow Uniformity
9 08300611 51.63% 5-6 to yellow Uniformity
10 08300915 57.75% 6-7 yellowing Whether or not
11 08310319 81.14% 7-8 to yellow Whether or not
12 08310600 82.71% 8-9 yellowing Uniformity
As can be seen from Table 3, the evaluation of the yellowing degree of the tobacco leaves by experts in the curing process and the comparison of the yellowing degree by applying the method of the invention show that the ratio of the evaluation results of the two is 83.33 percent, and the accuracy is higher; and the results of the image serial numbers 10 and 11 with errors are relatively close to the evaluation of experts, and the error range is small, so that the method for extracting the green-yellow ratio of the primarily baked tobacco leaves provides a research basis for the improvement of the efficiency of digitally baking the tobacco leaves by incorporating the green-yellow ratio characteristics of the primarily baked tobacco leaves when being applied to digital baking in the future.
The above embodiments are merely preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (6)

1. The method for extracting the green-yellow ratio of the primary flue-cured tobacco leaves is characterized by comprising the following steps of:
step one, acquiring an image of a primary flue-cured raw tobacco sample to be detected;
reading an image, converting the image into an RGB color space, and acquiring an RGB channel pixel value of the image;
setting a threshold value based on the R, G two-channel pixel value difference value to set the background part except the tobacco leaves in the image to be white, and obtaining an image which only represents the tobacco leaves by taking the white as the background;
converting the image into an HSV color space numerical value to express, and setting a threshold value for the pixel value of the H channel to obtain the number of pixels of the yellow part of the tobacco leaf;
and step five, dividing the number of yellow pixel points by the number of pixel points representing the whole tobacco leaves, wherein the obtained percentage is the yellow proportion of the tobacco leaves.
2. The method for extracting the green-yellow ratio of the flue-cured tobacco leaves according to claim 1, wherein the method comprises the following steps:
wherein, the image acquisition in the first step is specifically as follows: and aligning the camera lens to the primary grill in the primary curing barn to form a bundle of vertically hung tobacco leaves, flattening each tobacco leaf to be vertical, and further obtaining a complete primary cured tobacco leaf image.
3. The method for extracting the green-yellow ratio of the flue-cured tobacco leaves according to claim 1, wherein the method comprises the following steps:
wherein, the step two of obtaining the pixel values of the image RGB channels comprises the following steps:
step 2-1, reading in an image, and acquiring pixel values of three channels of BGR of the image;
and 2-2, converting the BGR value of the image into an RGB color space to obtain pixel values of three channels of the RGB image.
4. The method for extracting the green-yellow ratio of the flue-cured tobacco leaves according to claim 1, which is characterized in that:
wherein, the step three, acquiring the image which only represents the tobacco leaves with white as the background comprises:
step 3-1, calculating R, G the difference of the pixel values of the two channels;
and 3-2, setting a threshold value for the difference value, assigning the RGB channels of the pixel point positions in the threshold value range to be 255, replacing the background part of the non-tobacco leaves in the image with pure white, and obtaining the image which only represents the tobacco leaves by taking the white as the background.
5. The method for extracting the green-yellow ratio of the flue-cured tobacco leaves according to claim 1, which is characterized in that:
wherein, the step four, the step of obtaining the quantity of yellow pixel points on the image for representing the tobacco leaves comprises the following steps:
step 4-1, converting the BGR channel pixel value of the image into an HSV color space value to represent;
4-2, setting a threshold range for the pixel value of the H channel, and respectively defining a yellowing part and a cyan part except the yellow part of the tobacco leaf;
and 4-3, respectively counting the pixel point quantity of the yellow part of the tobacco leaves and the pixel point quantity of the whole tobacco leaves.
6. The method for extracting the green-yellow ratio of the flue-cured tobacco leaves according to claim 1, wherein the method comprises the following steps:
and the fifth step further comprises displaying the yellow proportion of the tobacco leaves on the image of the flue-cured tobacco leaves.
CN202111613968.8A 2021-12-27 2021-12-27 Method for extracting green and yellow ratio of primary flue-cured tobacco leaves Pending CN114304699A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111613968.8A CN114304699A (en) 2021-12-27 2021-12-27 Method for extracting green and yellow ratio of primary flue-cured tobacco leaves

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111613968.8A CN114304699A (en) 2021-12-27 2021-12-27 Method for extracting green and yellow ratio of primary flue-cured tobacco leaves

Publications (1)

Publication Number Publication Date
CN114304699A true CN114304699A (en) 2022-04-12

Family

ID=81013579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111613968.8A Pending CN114304699A (en) 2021-12-27 2021-12-27 Method for extracting green and yellow ratio of primary flue-cured tobacco leaves

Country Status (1)

Country Link
CN (1) CN114304699A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117876380A (en) * 2024-03-13 2024-04-12 昆明昊拜农业科技有限公司 Tobacco leaf environment temperature and humidity and microlayer difference prediction method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111199545A (en) * 2020-01-07 2020-05-26 云南省烟草烟叶公司 Method for identifying color of flue-cured tobacco leaves based on machine vision
CN111466605A (en) * 2020-04-23 2020-07-31 贵州省烟草科学研究院 Method, system and device for measuring yellowing and browning degree of tobacco leaf baking based on RGB value
CN112949663A (en) * 2021-01-28 2021-06-11 贵州省烟草科学研究院 Tobacco leaf baking control system and method based on image recognition
US20210358171A1 (en) * 2020-05-13 2021-11-18 Walmart Apollo, Llc Extracting color from item images
CN113808153A (en) * 2021-09-22 2021-12-17 航天新气象科技有限公司 Tomato maturity detection method and device, computer equipment and storage medium
CN113838081A (en) * 2021-09-15 2021-12-24 浙江中烟工业有限责任公司 Method and device for distinguishing color uniformity of flue-cured tobacco leaves based on machine vision

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111199545A (en) * 2020-01-07 2020-05-26 云南省烟草烟叶公司 Method for identifying color of flue-cured tobacco leaves based on machine vision
CN111466605A (en) * 2020-04-23 2020-07-31 贵州省烟草科学研究院 Method, system and device for measuring yellowing and browning degree of tobacco leaf baking based on RGB value
US20210358171A1 (en) * 2020-05-13 2021-11-18 Walmart Apollo, Llc Extracting color from item images
CN112949663A (en) * 2021-01-28 2021-06-11 贵州省烟草科学研究院 Tobacco leaf baking control system and method based on image recognition
CN113838081A (en) * 2021-09-15 2021-12-24 浙江中烟工业有限责任公司 Method and device for distinguishing color uniformity of flue-cured tobacco leaves based on machine vision
CN113808153A (en) * 2021-09-22 2021-12-17 航天新气象科技有限公司 Tomato maturity detection method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
汪懋华和李民赞: "《现代精细农业理论与实践》", 31 October 2012, 中国农业大学出版社 *
陈进等: "基于机器视觉的水稻杂质及破碎籽粒在线识别方法", 《农业工程学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117876380A (en) * 2024-03-13 2024-04-12 昆明昊拜农业科技有限公司 Tobacco leaf environment temperature and humidity and microlayer difference prediction method and system
CN117876380B (en) * 2024-03-13 2024-05-14 昆明昊拜农业科技有限公司 Tobacco leaf environment temperature and humidity and microlayer difference prediction method and system

Similar Documents

Publication Publication Date Title
CN104914720B (en) Electronic nose intelligence baking control system and control method with autolearn feature
CN105002321B (en) A kind of gas treatment stream center dynamic tracking and gas utilization rate monitoring method
CN106503695B (en) A kind of tobacco plant identification and method of counting based on Aerial Images
CN102663397B (en) Automatic detection method of wheat seedling emergence
CN109859101B (en) Crop canopy thermal infrared image identification method and system
CN104636759A (en) Method for obtaining picture recommending filter information and picture filter information recommending system
CN104408473B (en) Cotton grade sorting technique and device based on learning distance metric
CN114304699A (en) Method for extracting green and yellow ratio of primary flue-cured tobacco leaves
CN112949663A (en) Tobacco leaf baking control system and method based on image recognition
CN110866547B (en) Automatic classification system and method for traditional Chinese medicine decoction pieces based on multiple features and random forests
CN107886497A (en) A kind of wheat flag leaf automatic nondestructive detection and measuring method based on image
CN107454266A (en) Crop nutrition diagnosis device and diagnostic method based on smart mobile phone
CN109308464A (en) A kind of rice tassel recognition methods based on digital camera images
CN116449713A (en) Tobacco leaf baking simulation method and system based on high-temperature baking room
CN113838081A (en) Method and device for distinguishing color uniformity of flue-cured tobacco leaves based on machine vision
CN115169751B (en) Method and system for improving maintenance quality of traditional Chinese medicine decoction pieces
Astuti et al. Oil palm fruit ripeness detection using K-Nearest neighbour
CN109272416B (en) Greenhouse crop planting system
CN113011467A (en) Angelica sinensis medicinal material producing area identification method based on image structure texture information
CN111199545A (en) Method for identifying color of flue-cured tobacco leaves based on machine vision
CN112069953B (en) Automatic identification method and device for rice seedling growth period
He et al. Method for grade identification of tobacco based on machine vision
CN109726641B (en) Remote sensing image cyclic classification method based on automatic optimization of training samples
CN113283378A (en) Pig face detection method based on trapezoidal region normalized pixel difference characteristics
CN113554675A (en) Edible fungus yield estimation method based on unmanned aerial vehicle visible light remote sensing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20220412

WD01 Invention patent application deemed withdrawn after publication