A method and system for determining a cigar leaf section
By acquiring and digitally processing cigar tobacco leaf image data in real time, generating contour images and determining the parts, the problem of misjudgment of parts in cigar tobacco leaf grading is solved, and unified and standardized automated grading is achieved.
Patent Information
- Application Number
- CN202310591039.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-24
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2043-05-24
AI Technical Summary
Existing technologies make it difficult to accurately determine the leaf part during the grading process of cigar tobacco leaves, leading to misjudgments and affecting the uniformity and reliability of grading standards.
By acquiring cigar tobacco leaf image data in real time, preprocessing and digitizing it, generating cigar tobacco leaf outline images, and dividing them into equal parts to determine their location, the system uses an industrial camera and OpenCV programming technology to measure pixels.
It improves the uniformity and standardization of cigar tobacco leaf segmentation, is suitable for automated grading processes, and reduces human error.
Smart Images

Figure CN116660261B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of cigar tobacco leaf processing, and particularly relates to a method and system for determining the parts of cigar tobacco leaves. Background Art
[0002] Currently, the procurement method for cigars differs significantly from traditional flue-cured tobacco. Cigars are purchased from fresh tobacco leaves that haven't been processed by processes like baking or air-drying, and are available in only seven grades (upper grades 1 and 2, middle grades 1 and 2, lower grades 1 and 2, and final grade). In practice, cigars are affected by variety, natural conditions, and cultivation practices, and tobacco leaves from the same part of the tobacco leaf can have different characteristics in different locations. The use of these grading standards can mislead graders and lead to misjudgments. Graders must understand the actual conditions in their area and the characteristics of the leaf parts of their particular variety. Only with a thorough understanding of production practices can they truly distinguish between different leaf parts.
[0003] Due to the short history of cigar cultivation, limited knowledge, and insufficient experience, grading is primarily based on vein pattern and leaf shape, rather than location. This means that traditional grading methods still rely primarily on manual measurement using rulers.
[0004] Therefore, in view of the above-mentioned technical problems and defects, it is urgent to design and develop a method and system suitable for determining the parts of cigar tobacco leaves. Summary of the Invention
[0005] In order to overcome the above-mentioned deficiencies and difficulties in the prior art, the first object of the present invention is to provide a method for determining the parts of cigar tobacco leaves.
[0006] A second object of the present invention is to provide a system for determining the position of cigar tobacco leaves.
[0007] The first object of the present invention is achieved in this way: the method specifically comprises the following steps:
[0008] Acquire image data corresponding to cigar tobacco leaves in real time, and pre-process the image data of the cigar tobacco leaves; wherein the image data is complete data of the tobacco leaves;
[0009] generating a cigar leaf contour image corresponding to the cigar leaf according to preprocessed data of the cigar leaf image, and processing the cigar leaf contour image in equal parts;
[0010] Based on the equally divided tobacco leaf contour image, the part data corresponding to the cigar tobacco leaf is determined and generated.
[0011] The second object of the present invention is achieved in that the system specifically comprises:
[0012] A data acquisition unit for acquiring image data corresponding to cigar tobacco leaves in real time and preprocessing the image data of the cigar tobacco leaves; wherein the image data is complete data of the tobacco leaves;
[0013] a generating and dividing processing unit for generating a cigar leaf contour image corresponding to the cigar leaf according to pre-processed data of the cigar leaf image, and dividing the contour image into equal parts;
[0014] A determination and generation unit for determining and generating part data corresponding to a cigar tobacco leaf based on an equally divided tobacco leaf contour image.
[0015] The solution of the present invention uses a method to obtain image data corresponding to cigar tobacco leaves in real time and preprocess the image data of the cigar tobacco leaves; wherein the image data is complete tobacco leaf data; based on the preprocessed data of the cigar tobacco leaf image, a cigar tobacco leaf contour image corresponding to the cigar tobacco leaf is generated, and the tobacco leaf contour image is equally divided; based on the equally divided tobacco leaf contour image, part data corresponding to the cigar tobacco leaf is determined and generated; and a system corresponding to the method uses digital processing of photos and measures the positions of the pixel points of the tobacco leaves, thereby improving the uniformity and standardization of the cigar tobacco part division and can also be used in an automated grading process. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is a schematic diagram of the contour characteristics of the lower part of the tobacco leaf;
[0017] Figure 2 This is a schematic diagram of the contour characteristics of the parts of the tobacco leaf;
[0018] Figure 3 This is a schematic diagram of the contour characteristics of the upper parts of the tobacco leaf;
[0019] Figure 4 This is a schematic diagram of collecting cigar tobacco leaves of the present invention;
[0020] Figure 5 This is a schematic diagram of a grayscale image of a cigar tobacco leaf after pretreatment according to the present invention;
[0021] Figure 6 This is a schematic diagram of a cigar tobacco leaf image after binarization processing according to the present invention;
[0022] Figure 7 This is a schematic diagram of the outline image of a cigar leaf according to the present invention;
[0023] Figure 8 This is a schematic diagram of a data image of a cigar leaf image embodiment of the present invention;
[0024] Figure 9 Schematic diagram of an equally divided image of a cigar leaf image embodiment of the present invention;
[0025] Figure 10 Schematic diagram of the process of the method for determining the parts of cigar tobacco leaves according to the present invention;
[0026] Figure 11 Schematic diagram of the framework of the system for determining the position of cigar tobacco leaves according to the present invention;
[0027] Figure 12 This is a schematic diagram of tobacco leaves of Example 1 of the cigar of the present invention;
[0028] Figure 13 This is a schematic diagram of tobacco leaves of Example 2 of the cigar of the present invention;
[0029] Figure 14 This is a schematic diagram of tobacco leaves for cigar Example 3 of the present invention. DETAILED DESCRIPTION
[0030] The present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention fall within the scope of protection of the present invention.
[0031] As attached Figures 1-14 As shown, the present invention provides a method for determining the parts of cigar tobacco leaves, and the method specifically comprises the following steps:
[0032] S1. Acquire image data corresponding to cigar tobacco leaves in real time and pre-process the image data of the cigar tobacco leaves; wherein the image data is complete data of the tobacco leaves;
[0033] S2. generating a cigar leaf contour image corresponding to the cigar leaf based on the preprocessed data of the cigar leaf image, and processing the cigar leaf contour image in equal parts;
[0034] S3. Determine and generate the part data corresponding to the cigar tobacco leaf based on the equally divided tobacco leaf contour image.
[0035] The real-time acquisition of image data corresponding to cigar tobacco leaves and pre-processing of the image data of the cigar tobacco leaves further includes:
[0036] S11, acquiring image data corresponding to the RGB color mode of the cigar tobacco leaves in real time;
[0037] S12, processing the image data in the RGB color mode according to three components, and generating grayscale image data corresponding to the image data of the cigar tobacco leaf;
[0038] S13. Binarize the grayscale image data corresponding to the image data of the cigar tobacco leaf and generate binary image data corresponding to the grayscale image data of the cigar tobacco leaf.
[0039] The method of generating a cigar leaf contour image corresponding to the cigar leaf based on the pre-processed data of the cigar leaf image and equally dividing the leaf contour image further includes:
[0040] S21, generating a rectangular image corresponding to the cigar leaf outline according to the cigar leaf outline image;
[0041] S22, respectively generating rectangular diagram corner coordinate data, rectangular diagram length data, width data, and tobacco leaf center point coordinate data corresponding to the rectangular diagram; wherein the rectangular diagram corner coordinate data is the coordinate point data of the upper left corner of the rectangle;
[0042] S23. Based on the coordinate data of the tobacco leaf center point, the tobacco leaf contour image is divided into equal parts, and coordinate data of the tobacco leaf contour at the equal parts are generated.
[0043] The method of generating a cigar leaf contour image corresponding to the cigar leaf based on the pre-processed data of the cigar leaf image and equally dividing the leaf contour image further includes:
[0044] S24, scaling the rectangular image corresponding to the cigar leaf outline to generate first starting point coordinate data, first ending point coordinate data, and first midpoint coordinate data corresponding to the rectangular image;
[0045] S25 , respectively generate and obtain second starting point coordinate data, second ending point coordinate data, and second midpoint coordinate data corresponding to the translated rectangular image.
[0046] The step of determining and generating the position data corresponding to the cigar tobacco leaf based on the equally divided tobacco leaf contour image further includes:
[0047] S31, generating length change rate data corresponding to the rectangular diagram length data in real time based on the rectangular diagram length data corresponding to the cigar leaf outline, and performing weighting processing on the length change rate data;
[0048] S32, processing the data according to the weight of the length change rate data to generate midpoint coordinate data corresponding to the length;
[0049] S33. Based on the weighted processing data and the midpoint coordinate data corresponding to the length, determine and generate the part data corresponding to the cigar tobacco leaf in real time.
[0050] To achieve the purpose of the present invention, a system for determining the position of cigar tobacco leaves is provided. The system specifically comprises:
[0051] A data acquisition unit for acquiring image data corresponding to cigar tobacco leaves in real time and preprocessing the image data of the cigar tobacco leaves; wherein the image data is complete data of the tobacco leaves;
[0052] a generating and dividing processing unit for generating a cigar leaf contour image corresponding to the cigar leaf according to pre-processed data of the cigar leaf image, and dividing the contour image into equal parts;
[0053] A determination and generation unit for determining and generating part data corresponding to a cigar tobacco leaf based on an equally divided tobacco leaf contour image.
[0054] The data acquisition unit further includes:
[0055] an acquisition module for acquiring image data in RGB color mode corresponding to cigar tobacco leaves in real time; an eighth generation module for processing the image data in RGB color mode according to three components and generating grayscale image data corresponding to the image data of the cigar tobacco leaves;
[0056] A ninth generation module is used for binarizing the grayscale image data corresponding to the image data of the cigar tobacco leaf and generating binary image data corresponding to the grayscale image data of the cigar tobacco leaf.
[0057] The generating equal division processing unit further includes:
[0058] A first generation module is used to generate a rectangular diagram corresponding to the cigar tobacco leaf contour based on the cigar tobacco leaf contour image; a second generation module is used to generate rectangular diagram corner coordinate data, rectangular diagram length data, width data and tobacco leaf center point coordinate data corresponding to the rectangular diagram respectively; wherein the rectangular diagram corner coordinate data is the coordinate point data of the upper left corner of the rectangle; and a third generation module is used to divide the tobacco leaf contour image into equal parts based on the tobacco leaf center point coordinate data, and generate coordinate data of the tobacco leaf contour at the equal divisions.
[0059] The generating equal division processing unit further includes:
[0060] a fourth generating module for scaling a rectangular image corresponding to the outline of a cigar leaf and generating first starting point coordinate data, first ending coordinate data, and first midpoint coordinate data corresponding to the rectangular image;
[0061] A fifth generating module is used to respectively generate and obtain the second starting point coordinate data, the second ending point coordinate data and the second midpoint coordinate data corresponding to the translated rectangular image.
[0062] The determination generating unit further includes:
[0063] a sixth generating module for generating, in real time, length change rate data corresponding to the rectangular diagram length data corresponding to the cigar leaf contour, and performing weighting processing on the length change rate data;
[0064] a seventh generating module for processing data according to the weight of the length change rate data to generate midpoint coordinate data corresponding to the length;
[0065] A determination and generation module is used to determine and generate part data corresponding to the cigar tobacco leaf in real time based on the weighted processing data and the midpoint coordinate data corresponding to the length.
[0066] Specifically, in a specific embodiment of the present invention, the purchase grade is closely linked to the tobacco farmers' planting benefits, and also serves as the basis for the subsequent processing of cigars and improving the usability of tobacco leaves. The most important thing in the grading process is to distinguish the parts of the tobacco leaves. The parts referred to here do not only refer to the parts where the tobacco leaves are attached to the tobacco plants. They are also related to the four aspects of the tobacco leaves: vein phase, leaf shape, leaf surface, and thickness. Different parts present different characteristics. Cigars are divided into lower leaves, middle leaves, and upper leaves from bottom to top, represented by the letters X, C, and B respectively. From bottom to top, the leaf veins become thicker, the leaf shape becomes narrower, the leaf tip becomes sharper, the leaf structure becomes looser, the leaf thickness becomes thicker, and the leaf color becomes darker.
[0067] like Figure 1-Figure 3 As shown in the figure, the leaf shape characteristics of different parts of the tobacco leaf have different contour characteristics. The figure also shows the length and variation of the tobacco leaf in the identification of tobacco leaves. The lower tobacco leaf shape is close to round, the middle tobacco leaf shape is oval, and the upper tobacco leaf shape is long and narrow. Furthermore, the widest point of the tobacco leaf shifts back as the leaf position increases. Therefore, the length, width, and maximum width of the tobacco leaf can be used to classify the parts of the cigar tobacco leaf.
[0068] Measurement method: The method of the present invention uses digital processing of photos to measure the position of the pixels of the tobacco leaves. This method mainly uses industrial cameras and Opencv programming technology to achieve this.
[0069] The implementation method is as follows:
[0070] Tobacco leaf image acquisition: An industrial camera is used to capture images of tobacco leaves. This method uses pixel location rather than the actual distance to the tobacco leaf, eliminating the need to consider the focal length and object distance of the entire sampling system. The only requirement is to fully sample the tobacco leaf.
[0071] Image preprocessing:
[0072] 1. Grayscale conversion of tobacco leaf images: The collected tobacco leaf images are in RGB color mode. In actual use, RGB cannot reflect the morphological characteristics of the image. When processing the image, the three RGB components must be processed separately, and the colors are blended based on optical principles to form a grayscale image.
[0073] 2. Image binarization: In order to further find out the outline of tobacco leaves and other morphological targets, the image is binarized and digital image processing is performed.
[0074] Data collection:
[0075] Based on the binary image, we find the outline of the tobacco leaf and collect several frames of the original tobacco leaf image. The main data are:
[0076] 1. The coordinates of the upper left corner of the largest rectangle of the outline (x, y), the length l and width w of the largest rectangle, and the center point (a, b) of the tobacco leaf.
[0077] 2. Starting from the center point (a, b), press Divide the tobacco leaf into equal parts and take points on the outline from left to right to get cd.
[0078]
[0079] Data processing:
[0080] 1. Data standardization
[0081] Since the length and width of the tobacco leaves are not uniform, the length and width of the tobacco leaves are unified and placed in a uniform rectangle.
[0082] Assume that the length of the uniform rectangle is L = 200 and the width is W = 200; so the lengthwise scaling of the tobacco leaf is
[0083] The width direction is scaled to
[0084] So the corresponding coordinates become:
[0085] Coordinates of the starting point (cdqix×α,cdqiy×β), where i=1,2,...,11
[0086] The coordinates of the ending point are (cdzix×α,cdziy×β), where i=1,2,...,11;
[0087] The coordinates of the midpoint become (a×α, b×β).
[0088] 2. Data translation
[0089] Since the positions of the tobacco leaves are different, the coordinates of the upper left corner of the rectangle will be different. We translate it and move it to (0,0), so the coordinates of each point become:
[0090] Coordinates of the starting point (cdqix×α-x, cdqiy×β-y), where i=1,2,...,11
[0091] The coordinates of the termination are (cdzix×α-x, cdziy×β-y), where i=1,2,...,11.
[0092] The coordinates of the midpoint become (a×α-x, b×β-y)
[0093] Therefore, the final data is unified as follows:
[0094] The coordinates of the starting point are (x qi ,y qi ), where i = 1, 2, ..., 11
[0095] The coordinates of the end point are (x zi ,y zi ), where i = 1, 2, ..., 11
[0096] The coordinates of the center point are (c x ,c y ).
[0097] Identification method:
[0098] (1) Find the length corresponding to cd Calculate the rate of change of the length of L1---L11 and find the variance Δδ of the rate of change.
[0099] (2) Find the maximum length l of cd max , identified according to the accompanying drawings.
[0100] (3) Find the coordinates of the midpoint corresponding to the maximum length of cd
[0101] (IV) Find the distance between the midpoint and the center point corresponding to the maximum length of cd
[0102]
[0103] Method for determining the location:
[0104] Distance between midpoints cl Variance of the rate of change Δδ lower leaves cl<0.5 1000<Δδ middle leaves 0.5≤cl≤1.5 Δδ<500 Upper leaves cl>1.5 500≤Δδ≤1000
[0105] Example 1
[0106] 1. The coordinates of the upper left corner of the largest rectangle of the outline are (9, 20), the length l = 413 and the width w = 209 of the largest rectangle, and the center point of the tobacco leaf is (215, 124).
[0107] 2. Starting from the center point (215,124), press Divide the tobacco leaf into equal parts and take points on the outline from left to right to get cd
[0108]
[0109] Data processing:
[0110] 1. Data standardization
[0111] Since the length and width of the tobacco leaves are not uniform, the length and width of the tobacco leaves are unified and placed in a uniform rectangle.
[0112] Assume that the length of the uniform rectangle is L = 200 and the width is W = 200; so the lengthwise scaling of the tobacco leaf is The width direction is scaled to
[0113] Therefore, the corresponding coordinates become: starting point coordinates (cdqix×α, cdqiy×β), where i=1, 2, ..., 11, ending coordinates (cdzix×α, cdziy×β), where i=1, 2, ..., 11; the coordinates of the midpoint become (103.2, 117.8).
[0114]
[0115] 2. Data translation
[0116] Since the positions of the tobacco leaves are different, the coordinates of the upper left corner of the rectangle will be different. We translate it and move it to (0,0), so the coordinates of each point become:
[0117] The coordinates of the starting point are (cdqix×α-x,cdqiy×β-y), where i=1,2,...,11; the coordinates of the ending point are (cdzix×α-x,cdziy×β-y), where i=1,2,...,11; the coordinates of the midpoint become (94.2,97.8);
[0118] Therefore, the final data is unified as follows: the coordinates of the starting point are (x qi ,y qi ), the coordinates of the end point are (x zi ,y zi ), where i = 1, 2, ..., 11, and the coordinates of the center point are (c x ,c y ).
[0119]
[0120]
[0121] Identification method:
[0122] (1) Find the length corresponding to cd Calculate the rate of change of the length of L1---L11 and find the variance Δδ of the rate of change.
[0123] length Rate of change cdq1 73.15 cdq2 61.75 15.58441558 cdq3 115.9 87.69230769 cdq4 158.65 36.8852459 cdq5 181.45 14.37125749 cdq6 191.9 5.759162304 cdq7 190.95 0.495049505 cdq8 178.6 6.467661692 cdq9 154.85 13.29787234 cdq10 113.05 26.99386503 cdq11 59.85 47.05882353 Variance of rate of change Δδ 690.304
[0124] (2) Find the maximum length l of cd max , i.e. cdq6 is the longest (identified according to the attached figure);
[0125] (3) Find the coordinates of the midpoint corresponding to the maximum length of cd is (94.2, 95.9).
[0126] (IV) Find the distance between the midpoint and the center point corresponding to cd:
[0127] The coordinates of the midpoint become (94.2, 97.8); cl = 1.9; Δδ = 690.304; combined with the obtained midpoint distance and the variance of the change rate, the tobacco leaf is determined to be an upper leaf.
[0128] Example 2
[0129] 1. The coordinates of the upper left corner of the largest rectangle of the outline are (10, 28), the length l = 705 and the width w = 344 of the largest rectangle, and the center point of the tobacco leaf is (362, 200).
[0130] 2. Starting from the center point (362,200), press Divide the tobacco leaf into equal parts and take points on the outline from left to right to get cd
[0131]
[0132]
[0133] Data processing:
[0134] 1. Data standardization
[0135] Since the length and width of the tobacco leaves are not uniform, the length and width of the tobacco leaves are unified and placed in a uniform rectangle.
[0136] Assume that the length of the uniform rectangle is L = 200 and the width is W = 200; so the lengthwise scaling of the tobacco leaf is The width direction is scaled to
[0137] Therefore, the corresponding coordinates become: starting point coordinates (cdqix×α, cdqiy×β), where i=1, 2, ..., 11, ending coordinates (cdzix×α, cdziy×β), where i=1, 2, ..., 11; the coordinates of the midpoint become (102.4, 116.2).
[0138]
[0139] 2. Data translation
[0140] Due to the different positions of the tobacco leaves, there will be different coordinates of the upper left corner of the rectangle. It is translated and moved to (0,0), so the coordinates of each point become: starting point coordinates (cdqix×α-x,cdqiy×β-y), where i=1,2,...,11, ending coordinates (cdzix×α-x,cdziy×β-y), where i=1,2,...,11; the coordinates of the midpoint become (92.446,88.2).
[0141]
[0142] Identification method:
[0143] (1) Find the length corresponding to cd Calculate the rate of change of the length of L1---L11 and find the variance Δδ of the rate of change.
[0144] length Rate of change cd1 61.586 cd2 82.502 33.96226415 cd3 141.764 71.83098592 cd4 174.881 23.36065574 cd5 196.378 12.2923588 cd6 198.121 0.887573964 cd7 188.244 4.985337243 cd8 169.652 9.87654321 cd9 144.088 15.06849315 cd10 108.066 25 cd11 55.776 48.38709677 Variance of rate of change Δδ 476.89
[0145] (2) Find the maximum length l of cd max , that is, cdq6 is the longest (identified according to the attached figure).
[0146] (3) Find the coordinates of the midpoint corresponding to the maximum length of cd is (92.446, 87.325).
[0147] (IV) Find the distance between the midpoint and the center point corresponding to cd:
[0148] The coordinates of the midpoint become (92.446, 88.2); cl = 0.871; Δδ = 476.89; combined with the obtained midpoint distance and variance of the change rate, the tobacco leaf is determined to be a middle leaf.
[0149] Example 3
[0150] 1. The coordinates of the upper left corner of the largest rectangle of the outline are (18, 11), the length l = 407 and the width w = 272 of the largest rectangle, and the center point of the tobacco leaf is (221, 147).
[0151] 2. Starting from the center point (221,147), press Divide the tobacco leaf into equal parts and take points on the contour from left to right to get cd:
[0152]
[0153] Data processing:
[0154] 1. Data standardization
[0155] Since the length and width of the tobacco leaves are not uniform, the length and width of the tobacco leaves are unified and placed in a uniform rectangle.
[0156] Assume that the length of the uniform rectangle is L = 200 and the width is W = 200; so the lengthwise scaling of the tobacco leaf is The width direction is scaled to
[0157] Therefore, the corresponding coordinates become: starting point coordinates (cdqix×α, cdqiy×β), where i=1, 2, ..., 11, ending coordinates (cdzix×α, cdziy×β), where i=1, 2, ..., 11; the coordinates of the midpoint become (108.29, 107.31).
[0158]
[0159]
[0160] 2. Data translation
[0161] Since the positions of the tobacco leaves are different, there will be different coordinates of the upper left corner of the rectangle. It is translated and moved to (0,0), so the coordinates of each point become: starting point coordinates (cdqix×α-x,cdqiy×β-y), where i=1,2,...,11, and ending coordinates (cdzix×α-x,cdziy×β-y), where i=1,2,...,11.
[0162] The coordinates of the midpoint become (92.446, 88.2); therefore, the final data is unified as follows: the coordinates of the starting point are (x qi ,y qi ), the coordinates of the end point are (x zi ,y zi ), where i = 1, 2, ..., 11, and the coordinates of the center point are (90.29, 96.31).
[0163]
[0164] Identification method:
[0165] (1) Find the length corresponding to cd Calculate the rate of change of the length of L1---L11 and find the variance Δδ of the rate of change.
[0166]
[0167]
[0168] (2) Find the maximum length l of cd max , i.e. cdq6 is the longest (identified according to the attached figure);
[0169] (3) Find the coordinates of the midpoint corresponding to the maximum length of cd is (90.29, 95.949).
[0170] (IV) Find the distance between the midpoint and the center point corresponding to cd: The coordinates of the midpoint become (90.29, 96.31); cl = 0.365; Δδ = 2059.768; combined with the obtained midpoint distance and the variance of the change rate, the tobacco leaf is determined to be a lower leaf.
Claims
1. A method for determining the position of cigar tobacco leaves, characterized in that: The method specifically comprises the following steps: S1. Acquire image data corresponding to cigar tobacco leaves in real time and pre-process the image data of the cigar tobacco leaves; wherein the image data is complete data of the tobacco leaves; S2. Generating a cigar leaf contour image corresponding to the cigar leaf based on the pre-processed data of the cigar leaf image, and equally dividing the leaf contour image, further comprising: S21, generating a rectangular image corresponding to the cigar leaf outline according to the cigar leaf outline image; S22, respectively generating rectangular diagram corner coordinate data, rectangular diagram length data, width data, and tobacco leaf center point coordinate data corresponding to the rectangular diagram; wherein the rectangular diagram corner coordinate data is the coordinate point data of the upper left corner of the rectangle; S23, dividing the tobacco leaf contour image into equal parts based on the coordinate data of the tobacco leaf center point, and generating coordinate data of the tobacco leaf contour at the equal parts; S24, scaling the rectangular image corresponding to the cigar leaf outline to generate first starting point coordinate data, first ending point coordinate data, and first midpoint coordinate data corresponding to the rectangular image; S25, respectively generating and acquiring second starting point coordinate data, second ending point coordinate data, and second midpoint coordinate data corresponding to the translated rectangular image; S3, determining and generating the part data corresponding to the cigar tobacco leaf based on the equally divided tobacco leaf contour image, further comprising: S31, generating length change rate data corresponding to the rectangular diagram length data in real time based on the rectangular diagram length data corresponding to the cigar leaf outline, and performing weighting processing on the length change rate data; S32, processing the data according to the weight of the length change rate data to generate midpoint coordinate data corresponding to the length; S33. Based on the weighted processing data and the midpoint coordinate data corresponding to the length, determine and generate the part data corresponding to the cigar tobacco leaf in real time.
2. The method for determining the position of cigar tobacco leaves according to claim 1, wherein: Said S1 further comprises: S11, acquiring image data corresponding to the RGB color mode of the cigar tobacco leaves in real time; S12, processing the image data in the RGB color mode according to three components, and generating grayscale image data corresponding to the image data of the cigar tobacco leaf; S13. Binarize the grayscale image data corresponding to the image data of the cigar tobacco leaf and generate binary image data corresponding to the grayscale image data of the cigar tobacco leaf.
3. A system for determining the position of cigar tobacco leaves, characterized in that: The system specifically includes: A data acquisition unit for acquiring image data corresponding to cigar tobacco leaves in real time and preprocessing the image data of the cigar tobacco leaves; wherein the image data is complete data of the tobacco leaves; The generating and dividing processing unit is configured to generate a cigar leaf contour image corresponding to the cigar leaf according to the pre-processed data of the cigar leaf image, and to divide the contour image into equal parts, and further includes: a first generating module for generating a rectangular diagram corresponding to the cigar tobacco leaf contour based on the cigar tobacco leaf contour image; a second generating module for respectively generating rectangular diagram corner coordinate data, rectangular diagram length data, rectangular diagram width data, and tobacco leaf center point coordinate data corresponding to the rectangular diagram, wherein the rectangular diagram corner coordinate data is the coordinate point data of the upper left corner of the rectangle; and a third generating module for equally dividing the tobacco leaf contour image based on the tobacco leaf center point coordinate data and generating coordinate data for the equally divided tobacco leaf contours; a fourth generating module for scaling the rectangular diagram corresponding to the cigar tobacco leaf contour and respectively generating first starting point coordinate data, first ending coordinate data, and first midpoint coordinate data corresponding to the rectangular diagram; and a fifth generating module for respectively generating and acquiring second starting point coordinate data, second ending coordinate data, and second midpoint coordinate data corresponding to the translated rectangular diagram; The determination and generation unit is configured to determine and generate part data corresponding to the cigar tobacco leaf based on the equally divided tobacco leaf contour image, and further includes: a sixth generating module for generating, in real time, length change rate data corresponding to the rectangular diagram length data according to the rectangular diagram length data corresponding to the cigar leaf contour, and performing weighting processing on the length change rate data; a seventh generating module for processing data according to the weight of the length change rate data to generate midpoint coordinate data corresponding to the length; A determination and generation module is used to determine and generate part data corresponding to the cigar tobacco leaf in real time based on the weighted processing data and the midpoint coordinate data corresponding to the length.
4. The system for determining the position of cigar tobacco leaves according to claim 3, characterized in that: The data acquisition unit further includes: An acquisition module for acquiring image data corresponding to the RGB color mode of cigar tobacco leaves in real time; an eighth generating module for processing the image data in the RGB color mode according to three components and generating grayscale image data corresponding to the image data of the cigar tobacco leaf; A ninth generation module is used for binarizing the grayscale image data corresponding to the image data of the cigar tobacco leaf and generating binary image data corresponding to the grayscale image data of the cigar tobacco leaf.
Citation Information
Patent Citations
Machine vision-based tobacco leaf portion identification method, electronic device and storage medium
CN108268895A
Fresh cigarette part identification method based on machine vision
CN115170862A