Tobacco leaf length and color measuring method based on machine vision

By using non-contact measurement methods based on machine vision technology, the problem of low efficiency in measuring tobacco leaf length and color has been solved, enabling rapid and accurate measurement and online automatic detection, thereby improving the detection accuracy and efficiency of tobacco leaf production.

CN120876518APending Publication Date: 2025-10-31CHINA JILIANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510986184.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Existing methods for measuring tobacco leaf length mainly rely on manual measurement, which suffers from low efficiency and large errors.

Method used

A non-contact measurement method based on machine vision is adopted, which uses a high-resolution camera and parallel light source in conjunction with computer technology and digital image processing technology to measure the length and color of tobacco leaves through image preprocessing, edge detection and Hough circle transformation.

Benefits of technology

It enables rapid and accurate measurement of tobacco leaf length and color, avoiding the damage caused by manual measurement, improving detection accuracy and production efficiency, and is suitable for online automatic detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876518A_ABST
    Figure CN120876518A_ABST
Patent Text Reader

Abstract

The invention relates to a tobacco leaf length and color detection method based on machine vision. The method comprises the steps of tobacco leaf image acquisition, camera calibration, image preprocessing, HSV color space conversion feature extraction, edge detection, color extraction and tobacco leaf length calculation. According to the method for measuring the length and the color of the tobacco leaves, the digital image processing technology and the computer technology are fused according to the machine vision technology, extra damage and deformation cannot be caused in the detection process, the detection precision is high, convenience and rapidness are achieved, online automatic detection is easy to achieve, and the tobacco leaf detection and acceptance efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for measuring the length and color of tobacco leaves, and more particularly to a non-contact method for comprehensively measuring the geometric length and color of tobacco leaves based on machine vision technology. Background Technology

[0002] Existing methods for measuring the length of tobacco leaves are generally manual, which suffers from low efficiency and large errors. Based on the above-mentioned measurement status and existing problems, this invention proposes a non-contact measurement method for tobacco leaf length and color based on machine vision. Utilizing a high-resolution camera and lens, combined with an industrial parallel light source for imaging, and integrating computer technology and digital image processing technology, the method can complete the measurement of tobacco leaf length and color without causing any damage to the tobacco leaves, providing a reliable guarantee for the correct production and acceptance of tobacco leaves. Summary of the Invention

[0003] The purpose of this invention is to utilize machine vision technology to achieve non-contact measurement of physical indicators such as tobacco leaf length and color, providing a reliable guarantee for tobacco leaf production acceptance. The specific technical solution is as follows:

[0004] A non-contact method for measuring the physical properties of tobacco leaves based on machine vision includes the following steps:

[0005] Step S1: Use a high-resolution CCD camera and a parallel light source to photograph the tobacco leaves placed on the shooting platform to acquire the tobacco leaf image.

[0006] Step S2: Use a CCD camera to photograph the standard calibration board. The calibration board needs to be placed on the shooting stage and kept at a distance from the camera for calibration. Calculate the calibration results and obtain the pixel-to-distance conversion formula.

[0007] Step S3: Perform image preprocessing on the original tobacco leaf image acquired in S1, adjust the brightness by frequency domain filtering, and denoise the image by combining median filtering and Gaussian filtering.

[0008] Step S4: Use HSV color space conversion to adjust the threshold based on the image's hue (H), saturation (S), and lightness (V) to retain the main tobacco leaf image and remove unnecessary background.

[0009] Step S5: Use the Canny edge detection operator to detect tobacco leaf edges in the image processed in S4, and extract edge features.

[0010] Step S6: Calculate the RGB values ​​of the pixels within the tobacco leaf outline obtained in S5, and use the average value of the RGB values ​​of all pixels within the outline as the color feature of the tobacco leaf;

[0011] Step S7: Use Hough circle transform to obtain the maximum circumcircle of the tobacco leaf edge contour extracted in S5. The diameter of the circumcircle of the contour can be obtained, which is the length of the tobacco leaf. Calculate the length of the tobacco leaf according to the pixel conversion formula obtained in S2.

[0012] In a preferred embodiment of the present invention, step S3, image preprocessing, refers to performing image filtering and noise reduction on the original tobacco leaf image loaded into the processing program. The purpose is to highlight the area where the tobacco leaf is located, distinguish the background part, and facilitate the subsequent drawing of the outline circumcircle and the accurate positioning of the edge outline pixels of the tobacco leaf.

[0013] In a preferred embodiment of the present invention, step S2, camera calibration, refers to using a calibration board to determine the transformation relationship between the image coordinate system and the spatial coordinate system to calculate the actual size, and obtaining the pixel-to-actual-size conversion formula, the calculation formula is as follows:

[0014] k = D / P (1) In the formula: D is the spatial distance, and P is the corresponding number of pixels.

[0015] Compared with other measurement methods, the beneficial effects of this invention are: it achieves non-contact comprehensive measurement of tobacco leaves through machine vision technology, the measurement process does not damage the target, and the detection time can be greatly shortened by relying on computer vision technology, ensuring detection accuracy, and it is convenient, fast, and easy to realize online automatic detection, thereby improving production efficiency. Attached Figure Description

[0016] When considered in conjunction with the accompanying drawings, the invention will be better understood and its many accompanying advantages will readily become apparent from the following detailed description. However, the accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, are used to explain the invention and do not constitute an undue limitation thereof.

[0017] Figure 1 This is a flowchart of the machine vision-based tobacco leaf length and color detection process of the present invention.

[0018] Figure 2 This is a flowchart of the image preprocessing process of the present invention.

[0019] Figure 3 This is a flowchart of the sub-algorithm for calculating tobacco leaf length and color according to the present invention.

[0020] Figure 4 This invention is an image processing effect diagram. Detailed Implementation

[0021] The present invention will be further illustrated below with reference to the accompanying drawings and embodiments. However, these embodiments are merely illustrative, and the scope of protection of the present invention is not limited to these embodiments.

[0022] like Figure 1 As shown, a non-contact method for measuring the physical properties of tobacco leaves based on machine vision includes the following specific implementation steps:

[0023] Step S1, Acquisition of tobacco leaf images: Imaging is performed by a high-resolution area array CCD camera and a parallel surface light source above the tobacco leaf. After the complete image is obtained, it can be transmitted in real time to the host computer software algorithm for subsequent processing.

[0024] Step S3, Image preprocessing: such as Figure 2 As shown, image filtering is performed on the original tobacco leaf image. The filtering method combines median filtering and Gaussian filtering, which can effectively remove image edge noise and improve edge recognition accuracy.

[0025] Step S4, HSV color space conversion feature extraction: The filtered image is processed by the preset H, S, V threshold range to retain the main tobacco leaf part, which is convenient for subsequent edge extraction and contour drawing.

[0026] Step S5, tobacco leaf edge detection and feature extraction: The preprocessed tobacco leaf image is processed by the Canny edge detection operator to determine the edge pixels, and then the edge contour of the tobacco leaf is extracted by recognizing the edge contour of the tobacco leaf.

[0027] Step S6, as follows Figure 4 As shown, the average values ​​of R, G, and B of the pixels within the tobacco leaf outline obtained in S5 are calculated as the color of the tobacco leaf.

[0028] Step S7, Length Calculation: (e.g.) Figure 4 As shown, the outline of the tobacco leaf is obtained after processing in step S5, and the circumcircle of the tobacco leaf is drawn. The diameter of the circumcircle, which is the length of the tobacco leaf, is obtained by the number of pixels. Then, the specific length of the tobacco leaf is calculated based on the camera calibration results in S2.

[0029] This invention enables rapid and accurate calculation of tobacco leaf length and color through HSV tobacco leaf spatial transformation and Hough circle transformation, which can ensure product quality, improve production efficiency, and reduce raw material waste in the tobacco production process.

[0030] The above examples are only for the purpose of helping to understand the core idea of ​​the present invention; at the same time, those skilled in the art will know that there will be changes in the specific implementation methods and application scope based on the idea of ​​the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for detecting the length and color of tobacco leaves based on machine vision, characterized in that: Step S1: Acquisition of tobacco leaf image; Step S2: Camera calibration; Step S3: HSV color space conversion feature extraction; Step S4: Image preprocessing; Step S5: Edge detection; Step S6: Color extraction; Step S7: Length calculation.

2. The method for acquiring the tobacco leaf image in step S1 according to claim 1, characterized in that, The tobacco leaf images must be captured using a high-resolution area array CCD camera in conjunction with a parallel surface light source. The camera's field of view must be greater than the length of the tobacco leaf to ensure that the image can be completed and transmitted to the host computer.

3. The camera calibration in step S2 according to claim 1, characterized in that, The acquired images are calibrated using a standard calibration board to obtain the correspondence between pixels and actual lengths, enabling the calculation of tobacco leaf length.

4. The HSV color space conversion feature extraction step S3 according to claim 1, characterized in that, HSV color space conversion determines the threshold ranges for hue, saturation, and brightness, and extracts the tobacco leaf portion from the image.

5. The image preprocessing step S4 according to claim 1, characterized in that, By setting a 5×5 median filter operator and a 5×5 Gaussian filter operator, noise removal processing is performed on the tobacco leaf image to remove salt-and-pepper noise and Gaussian noise contained in the image.

6. The edge detection in step S5 according to claim 1, characterized in that, The Canny edge detection operator is used to search for abrupt changes in grayscale values ​​in the horizontal and vertical directions of the image to determine edge pixels and draw the outline of the tobacco leaves.

7. The color extraction in step S6 according to claim 1, characterized in that, The color characteristics of the tobacco leaf are obtained by identifying the RGB values ​​of the pixels within the contour curve obtained by S5.

8. The length calculation in step S7 according to claim 1, characterized in that, The tobacco leaf contour curve obtained in S5 is used to convert the number of pixels in the length direction within the contour into the actual length using the conversion coefficient obtained from camera calibration in step S2.