Method, device, equipment, medium and product for determining rule degree of tobacco shreds
By binarizing and filtering the tobacco sample images, the parameters of the tobacco string rule degree are calculated, and the problems of manual judgment of the tobacco string rule degree are solved in the prior art, and the efficiency and accuracy of tobacco string quality evaluation are achieved.
Patent Information
- Application Number
- CN202411741165.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, there are problems of low efficiency and low accuracy based on manual judgment of the degree of tobacco string rules, and it is difficult to accurately determine the quality of tobacco strings.
By collecting the tobacco silk sample tobacco samples, performing binarization and filtering processing, the tobacco silk area and length information of the tobacco silk sample is determined, and the regularity parameters of the tobacco silk batch are calculated based on this information, and the regularity parameters of the tobacco silk batch are determined.
An objective and accurate assessment of the degree of tobacco strips is achieved, and the efficiency and accuracy of the quality assessment of tobacco strips after cutting is improved.
Smart Images

Figure CN119693309A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of tobacco regularity, and in particular to a method, device, equipment, medium and product for determining the regularity of tobacco. Background Art
[0002] In the process of cigarette manufacturing, the shredded tobacco is one of the key processes. The shredded tobacco quality is closely related to the tobacco structure, the sensory quality of cigarettes and the physical quality, such as the draw resistance, hardness, and single cigarette weight.
[0003] The main method for evaluating the quality of shredded tobacco is to obtain a certain weight of shredded tobacco sample and place it in a sample box, then randomly select a preset number of shredded tobacco from the sample box, and then use a tobacco projector or magnifying glass to measure the width of the shredded tobacco. The quality of shredded tobacco is determined based on the discrete data of the shredded tobacco width.
[0004] The above method has two defects: first, the staff needs to randomly select a preset number of tobacco strands, and there may be a certain degree of subjectivity in the selection process, which makes it difficult to ensure complete randomness; second, the regularity of the shape of the tobacco after cutting is also an important factor in evaluating the quality of the cut tobacco. For example, tobacco strands (two or more tobacco strands stick together), cut flakes (small pieces of tobacco leaves that cannot be cut), and window-shaped tobacco are all irregular tobacco strands, which affect the quality of tobacco strands to a certain extent. Based on this, it can be seen that before determining the quality of tobacco strands, the regularity of the tobacco strands can be determined first.
[0005] At present, the degree of regularity of tobacco is mainly determined by manual judgment, which has the problems of low efficiency and low accuracy. Correspondingly, it is also impossible to accurately determine the technical problem of tobacco quality. Summary of the invention
[0006] The embodiments of the present invention provide a method, device, equipment, medium and product for determining the regularity of cut tobacco, so as to accurately and efficiently determine the regularity of cut tobacco, thereby improving the accuracy of quality assessment of cut tobacco.
[0007] In a first aspect, an embodiment of the present invention provides a method for determining the regularity of tobacco shreds, the method comprising:
[0008] Collecting images to be processed corresponding to at least two tobacco samples;
[0009] Obtaining an image to be used by binarizing the image to be processed;
[0010] Determining the tobacco area and tobacco length information corresponding to the tobacco sample in the image to be used;
[0011] According to the tobacco areas of the at least two tobacco samples and the tobacco length information, a regularity parameter of the tobacco batch to which the tobacco samples belong is determined.
[0012] Furthermore, the step of binarizing the image to be processed to obtain the image to be used includes:
[0013] Processing the pixel values of the pixel points in the image to be processed based on a binarization function to obtain a binarized image corresponding to the tobacco sample;
[0014] The image to be used is obtained by filtering the binary image.
[0015] Further, determining the tobacco area corresponding to the tobacco sample in the image to be used includes:
[0016] The number of pixels whose pixel values in the image to be used are preset pixel values is counted based on the objective function, and the tobacco area of the tobacco sample in the image to be used is determined according to the number of pixels.
[0017] Furthermore, determining the tobacco length information corresponding to the tobacco sample in the image to be used includes:
[0018] Extracting the image skeleton of the tobacco sample in the image to be used based on a skeleton extraction algorithm;
[0019] Pruning the image skeleton based on a pruning algorithm to obtain a target branch;
[0020] The tobacco length information of the image to be used is determined according to the pixel information corresponding to the target branch.
[0021] Furthermore, determining the regularity parameter of the batch of tobacco to which the tobacco samples belong based on the tobacco areas and the tobacco length information of the at least two tobacco samples includes:
[0022] For each image to be processed, determining a regularity degree characterization parameter corresponding to the image to be processed according to information about the tobacco area and tobacco length of the image to be processed;
[0023] The regularity parameter of the batch of shredded tobacco to which the shredded tobacco sample belongs is determined according to the regularity characterization parameters corresponding to all the images to be processed.
[0024] Furthermore, the step of determining the regularity parameter of the batch of tobacco to which the tobacco sample belongs based on the regularity characterization parameters corresponding to all the images to be processed includes:
[0025] The statistical regularity degree represents a first quantity of the parameter within a preset range;
[0026] The regularity parameter of the batch to which the shredded tobacco samples belong is determined according to the first number and the number of images to be processed corresponding to the shredded tobacco samples.
[0027] In a second aspect, an embodiment of the present invention further provides a device for determining the regularity of tobacco shreds, the device comprising:
[0028] An image acquisition module, used for acquiring images to be processed corresponding to at least two tobacco samples;
[0029] An image processing module, used for obtaining an image to be used by binarizing the image to be processed;
[0030] An information determination module, used to determine the tobacco area and tobacco length information corresponding to the tobacco sample in the image to be used;
[0031] The parameter determination module is used to determine the regularity parameter of the batch of tobacco to which the tobacco samples belong based on the tobacco areas of the at least two tobacco samples and the tobacco length information.
[0032] In a third aspect, an embodiment of the present invention provides a server, which includes:
[0033] one or more processors;
[0034] A memory for storing one or more programs;
[0035] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the regularity of tobacco shreds as provided in any embodiment of the present invention.
[0036] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for determining the regularity of tobacco shreds as provided in any embodiment of the present invention.
[0037] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, it implements the method for determining the regularity of tobacco as described in any one of the embodiments of the present invention.
[0038] The technical solution provided by the embodiment of the present invention can binarize the image to be processed after collecting the image to be processed corresponding to at least two tobacco samples, so as to obtain the image to be used including two types of pixel values. Next, the tobacco area and tobacco length information corresponding to the tobacco sample can be determined based on the image to be used. Based on the tobacco area and tobacco length information, the tobacco regularity parameter can be determined. Furthermore, based on the regularity parameters corresponding to all tobacco samples, the regularity parameters of the batch of tobacco to which the tobacco sample belongs are determined, which solves the problem of low judgment efficiency and accuracy when judging the regularity of tobacco based on manual methods in the prior art, and realizes the objective evaluation of the regularity of cutting, thereby improving the technical effect of cutting quality evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A flow chart of a method for determining the regularity of tobacco provided by an embodiment of the present invention;
[0041] Figure 2 An image to be processed including a tobacco sample provided in an embodiment of the present invention;
[0042] Figure 3 The image to be used is obtained after the image to be processed is binarized according to the embodiment of the present invention;
[0043] Figure 4 A schematic diagram of a binary tree corresponding to tobacco samples in an image to be used provided by an embodiment of the present invention;
[0044] Figure 5 A schematic diagram corresponding to an embodiment of the present invention after subtracting branches;
[0045] Figure 6 A schematic diagram of the structure of a target branch provided by an embodiment of the present invention;
[0046] Figure 7 A schematic diagram of a tobacco sample provided by an embodiment of the present invention;
[0047] Figure 8 A schematic diagram of a tobacco sample provided by an embodiment of the present invention;
[0048] Fig. 9A schematic diagram of a tobacco sample provided by an embodiment of the present invention;
[0049] Fig.10 A schematic structural diagram of a method and device for determining the regularity of tobacco shreds provided by an embodiment of the present invention;
[0050] Fig.11 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0052] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It is also necessary to explain that, for ease of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0053] Before introducing the technical solution provided by the embodiment of the present invention, an application scenario may be exemplified first.
[0054] After the tobacco is cut, the regularity of the cut tobacco can be detected and evaluated, and the quality of the cut tobacco can be determined based on the regularity of the cut tobacco.
[0055] Figure 1 A flowchart of a method for determining the regularity of tobacco shreds provided in an embodiment of the present invention is provided. This embodiment can be applicable to scenarios in which the regularity of tobacco shreds after cutting is detected. The method for determining the regularity of tobacco shreds provided in this embodiment can be implemented by a device for determining the regularity of tobacco shreds integrated in an electronic device, which can be a mobile terminal or a PC, etc.
[0056] like Figure 1 As shown, the method specifically comprises the following steps:
[0057] S110, collecting images to be processed corresponding to at least two tobacco samples.
[0058] The number of the at least two tobacco samples may be one or more. In order to improve the accuracy of determining the quality of the tobacco samples, as many tobacco samples as possible may be obtained. For each tobacco sample, an image corresponding to each tobacco sample may be collected based on a camera device or a tobacco projector, and the image collected at this time may be used as an image to be processed.
[0059] It can be understood that after the tobacco is cut into pieces, some tobacco samples can be obtained. For each tobacco sample, the image corresponding to it can be collected and used as the image to be processed. That is, the image to be processed of each tobacco sample is collected.
[0060] S120 , obtaining an image to be used by binarizing the image to be processed.
[0061] The binarization process can be understood as processing the pixel values of the pixels corresponding to the tobacco samples in the image to be processed as the first pixel values, and processing the pixel values of the pixels corresponding to the non-tobacco samples in the image to be processed as the second pixel values. The image obtained after the binarization process is used as the image to be used. That is, the image to be used includes two types of pixels, the pixel values of one type of pixels are the first pixel values, and the pixel values of the other type of pixels are the second pixel values.
[0062] Specifically, the pixel value corresponding to each pixel point in the image to be processed may be read in turn, and the pixel value may be processed using the objective function to obtain the image to be used. Optionally, the objective function may be an im2bw() function.
[0063] Exemplarily, tobacco samples are usually collected under certain conditions, so the pixel values corresponding to the non-tobacco sample area in the image to be processed are different from the pixel values corresponding to the tobacco area. After the image to be processed is collected, the pixel values corresponding to each pixel point in the image to be processed can be read in sequence based on the objective function im2bw() function. If the pixel value is a preset pixel value, it is marked as a first pixel value; if the pixel value is not a preset pixel value, it is marked as a second pixel value. After the image to be processed is binarized based on the above method, the image to be used is obtained.
[0064] Based on the above exemplary examples, Figure 2 After the image to be processed including the tobacco sample is obtained, each pixel in the image to be processed can be processed in turn based on the objective function im2bw() function to obtain the following Figure 3 The image shown is to be used.
[0065] In this embodiment, the image to be used is obtained by binarizing the image to be processed, including: processing the pixel values of the pixel points in the image to be processed based on the binarization function to obtain a binary image corresponding to the tobacco sample; and obtaining the image to be used by filtering the binary image.
[0066] The binarization function can be understood as a function that processes the pixel values of some pixels in the image to be processed as the first pixel value and the pixel values of some pixels as the second pixel value. The image obtained after the binarization process is used as the binarized image. In order to improve the regularity parameter corresponding to the image to be processed, the binarized image can be further filtered and the image obtained at this time is used as the image to be used.
[0067] Specifically, the pixel values of the pixels in the image to be processed are converted into corresponding pixel values based on a binarization function, and then the obtained binary image is subjected to denoising, that is, filtering, to obtain the image to be used.
[0068] Exemplarily, the image to be processed is processed based on the binarization function to obtain a binarized image. Next, the binarized image is processed using the bwareaopen() function, ie, a filtering function, to obtain a filtered image to be used.
[0069] S130: Determine the tobacco area and tobacco length information corresponding to the tobacco sample in the image to be used.
[0070] The tobacco area refers to the area information occupied by the tobacco sample in the image to be used, and the tobacco area can be represented by the number of pixels corresponding to the tobacco sample in the image to be used. The tobacco length information is the total length corresponding to the tobacco sample, or the longest length corresponding to the tobacco sample. In this embodiment, the tobacco length can also be determined by the number of pixels.
[0071] Specifically, the pixel points corresponding to the cut tobacco sample in the image to be used may be processed to obtain the area information and length information of the cut tobacco sample in the image to be used, and the area information is used as the cut tobacco area of the cut tobacco sample.
[0072] Exemplarily, the sum() function can be used to process the pixels corresponding to the tobacco sample in the image to be used to obtain the number of pixels corresponding to the tobacco sample. Since the image to be used is a binary image, that is, the pixel value of the tobacco sample in the image to be used is 1, and the pixel value of the non-tobacco sample in the image to be used is 0, that is, the number of pixels with a pixel value of 1 can be counted, and this number is used as the tobacco area of the tobacco sample. The length corresponding to the tobacco sample is counted, and this length is used as the tobacco length information.
[0073] In this embodiment, determining the tobacco area corresponding to the tobacco sample in the image to be used includes: counting the number of pixels in the image to be used whose pixel values are preset pixel values based on the objective function, and determining the tobacco area of the tobacco sample in the image to be used based on the number of pixels.
[0074] The objective function may be an area accumulation function, which corresponds to a sum() function. Based on the area accumulation function, the number of pixels whose pixel values are the first preset pixel values may be automatically counted. The number of pixels is finally converted into the tobacco area corresponding to the tobacco sample.
[0075] Specifically, based on the objective function, the number of pixels between the pixel value in the image to be used and the preset pixel value is counted, and the number of pixels is used as the tobacco area corresponding to the tobacco sample in the image to be used.
[0076] In this embodiment, determining the tobacco length information corresponding to the tobacco sample in the image to be used includes: extracting the image skeleton of the tobacco sample in the image to be used based on a skeleton extraction algorithm; pruning the image skeleton based on a pruning algorithm to obtain a target branch; and determining the tobacco length information of the image to be used based on pixel information corresponding to the target branch.
[0077] The skeleton extraction algorithm is an existing algorithm that can provide skeleton information of the tobacco sample to be used. Optionally, the skeleton extraction algorithm can be a bwmorph() function, based on which the image skeleton can be extracted to obtain Figure 3 The structural diagram shown in FIG. 1 is a schematic diagram of a structure of a pruning algorithm. The pruning algorithm is mainly based on extracting branches from the image skeleton by a computer to obtain multiple branches. The extracted branches are used as target branches. The pixel information corresponding to each target branch can be counted, and the pixel information is used as the tobacco length information of the image to be used.
[0078] Specifically, the image skeleton of the tobacco sample to be used is extracted based on a skeleton extraction algorithm, the image skeleton is pruned based on a pruning algorithm to obtain at least one target branch, and the tobacco length information of the image to be used is determined based on the pixel information corresponding to each target branch.
[0079] For example, see Figure 3 , if it is necessary to distinguish the regularity of tobacco, the longest path in tobacco can be defined. A path is mainly the shortest route from one end point to another without repetition. The length information corresponding to the shortest route is counted as the length information of the path. If the image to be used only includes two end points, the length of the path between the two end points is the length of tobacco. For irregular tobacco, the following methods can be used to determine the length information of tobacco:
[0080] Continue to see Figure 3 , the tobacco sample in the image to be used is irregular tobacco, with four endpoints A, B, C, and D, that is, there are six paths, namely AB, AC, AD, BC, BD, and CD. Figure 3 The schematic diagram shown is equivalent to a four-layer binary tree, see Figure 4By extending or reducing the number of layers and each node of the binary tree, a single tobacco structure of any complexity can be equivalent; taking the calculation of the length of path AB as an example, first Figure 3 If we subtract one layer of branches from the bifurcation that does not contain endpoints A and B on the tobacco image skeleton, we can get the following: Figure 5 The new binary tree contains three endpoints A, B, and E. Repeat the above steps to get two endpoints A and B, as shown in Figure 6 The target branch shown does not contain any other branches. The number of pixels corresponding to each target branch is counted to obtain tobacco length information. The maximum tobacco length information is used as the tobacco length information corresponding to the tobacco sample in the image to be used.
[0081] Based on the above method, the tobacco length information of the image to be used corresponding to each tobacco sample can be obtained.
[0082] S140: Determine the regularity parameter of the batch of tobacco to which the tobacco samples belong based on the tobacco area and tobacco length information of at least two tobacco samples.
[0083] The regularity parameter is used to characterize the overall regularity of the batch of tobacco to which the tobacco sample belongs, and the quality of the cut tobacco can be determined based on the overall regularity.
[0084] Specifically, for the tobacco area and tobacco length information corresponding to each tobacco sample, the rule parameter corresponding to the tobacco sample can be calculated. Based on the rule parameters corresponding to all tobacco samples, the regularity parameter of the batch of tobacco to which the tobacco sample belongs is determined.
[0085] In this embodiment, the regularity parameters of the batch of tobacco to which the tobacco samples belong are determined based on the tobacco area and the tobacco length information of the at least two tobacco samples, including: for each image to be processed, determining the regularity characterization parameters corresponding to the image to be processed based on the tobacco area and the tobacco length information of the image to be processed; and determining the regularity parameters of the batch of tobacco to which the tobacco samples belong based on the regularity characterization parameters corresponding to all images to be processed.
[0086] Among them, the regularity characterization parameter is used to characterize whether the tobacco sample in the image to be processed is regular. Generally, the larger the regularity characterization parameter is, the more regular the corresponding tobacco sample is, and vice versa, the more irregular the corresponding sample is. The regularity parameter is a parameter to determine whether the tobacco batch to which the tobacco sample belongs is regular. Generally, the larger the regularity parameter is, the more regular the cut tobacco of the batch is, and vice versa.
[0087] Specifically, for each image to be processed, after obtaining the tobacco area and tobacco length information corresponding to the image to be processed, the ratio between the tobacco area and tobacco length information can be calculated, and the ratio is used as the regularity characterization parameter corresponding to the image to be processed. Based on the regularity characterization parameters corresponding to all tobacco samples, the regularity parameter of the batch of tobacco to which the tobacco sample belongs is determined.
[0088] In this embodiment, the regularity parameters of the batch of tobacco to which the tobacco sample belongs are determined based on the regularity characterization parameters corresponding to all images to be processed, including: counting a first number of regularity characterization parameters within a preset range; and determining the regularity parameters of the batch to which the tobacco sample belongs based on the first number and the number of images to be processed corresponding to the tobacco sample.
[0089] Among them, the preset range is a preset range of tobacco regularity parameter. If the tobacco regularity parameter is within the preset range, it means that the tobacco is regular, otherwise it means that the tobacco is irregular. Based on this, the first number of regularity characterization parameters within the preset range can be counted. By calculating the first number and the number of images to be processed corresponding to the tobacco sample, a ratio can be obtained. Based on the ratio, the regularity parameter of the batch to which the tobacco sample belongs can be determined, that is, the parameter of whether the tobacco is regular after cutting.
[0090] Exemplarily, the regularity characterization of cut tobacco can be: let M = S / L, where S is the area of tobacco and L is the length information of tobacco. Based on the above formula, the regularity characterization parameter corresponding to the image to be processed is determined. The preset range can be a range of 7<M<12. If the regularity parameter is within the above range, the regularity of the tobacco is the best; the farther M deviates from 7 to 12, that is, when M<7, the larger the value of |M-7|, the worse the regularity; when M>12, the larger the value of |M-12|, the worse the regularity; when M is between 7 and 12, the regularity is the same. The first number of regularity characterization parameters within the preset range is counted. The ratio between the first number and the image quality (the number of samples of tobacco samples) is calculated, that is, the regularity parameter. If the regularity parameter is greater than the preset parameter threshold, it means that the cut tobacco is regular, otherwise, it means that the cut tobacco is irregular.
[0091] For further example, if S=3481, L=199, M=S / L=17.49, the result diagram is shown in Figure 7 ; If S = 2309, L = 240, M = S / L = 9.62, the result diagram can be found in Figure 8 ; If S = 1209, L = 199, M = S / L = 6.07, the result diagram is shown in Fig. 9 . Figure 8 The corresponding tobacco sample has a better regularity than Fig. 9 The regularity of the corresponding tobacco sample, Fig. 9 The corresponding tobacco sample has a better regularity than Figure 7 The regularity of the corresponding tobacco sample.
[0092] The technical solution provided by the embodiment of the present invention can binarize the image to be processed after collecting the image to be processed corresponding to at least two tobacco samples, so as to obtain the image to be used including two types of pixel values. Next, the tobacco area and tobacco length information corresponding to the tobacco sample can be determined based on the image to be used. Based on the tobacco area and tobacco length information, the tobacco regularity parameter can be determined. Furthermore, based on the regularity parameters corresponding to all tobacco samples, the regularity parameters of the batch of tobacco to which the tobacco sample belongs are determined, which solves the problem of low judgment efficiency and accuracy when judging the regularity of tobacco based on manual methods in the prior art, and realizes the objective evaluation of the regularity of cutting, thereby improving the technical effect of cutting quality evaluation.
[0093] The following is an embodiment of a method device for determining the regularity of tobacco provided by an embodiment of the present invention. The device and the methods for determining the regularity of tobacco in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the method device for determining the regularity of tobacco, reference can be made to the above embodiment of the method for determining the regularity of tobacco.
[0094] Fig.10 The present invention provides a schematic diagram of the structure of a device for determining the regularity of tobacco shreds provided in an embodiment of the present invention. The device specifically comprises: an image acquisition module 210 , an image processing module 220 , an information determination module 230 and a parameter determination module 240 .
[0095] Among them, the image acquisition module 210 is used to acquire the to-be-processed images corresponding to at least two tobacco samples; the image processing module 220 is used to obtain the to-be-used images by binarizing the to-be-processed images; the information determination module 230 is used to determine the tobacco area and tobacco length information corresponding to the tobacco samples in the to-be-used images; the parameter determination module 240 is used to determine the regularity parameter of the batch of tobacco to which the tobacco samples belong based on the tobacco area and tobacco length information of the at least two tobacco samples.
[0096] On the basis of the above technical solution, the image processing module includes:
[0097] A first processing unit, configured to process pixel values of pixels in the image to be processed based on a binarization function to obtain a binarized image corresponding to the tobacco sample;
[0098] The second processing unit is used to obtain the image to be used by filtering the binary image.
[0099] Based on the above technical solutions, the information determination module is also used to count the number of pixels in the image to be used whose pixel values are preset pixel values based on the objective function, and determine the tobacco area of the tobacco sample in the image to be used according to the number of pixels.
[0100] On the basis of the above technical solutions, the information determination module includes:
[0101] A skeleton extraction unit, used for extracting the image skeleton of the tobacco sample in the image to be used based on a skeleton extraction algorithm;
[0102] A branch determination unit, configured to prune the image skeleton based on a pruning algorithm to obtain a target branch;
[0103] The information determination unit is used to determine the tobacco length information of the image to be used according to the pixel information corresponding to the target branch.
[0104] On the basis of the above technical solutions, the parameter determination module includes:
[0105] A first parameter determination unit, configured to determine, for each image to be processed, a regularity degree characterization parameter corresponding to the image to be processed according to information about the tobacco area and tobacco length of the image to be processed;
[0106] The second parameter determination unit is used to determine the regularity parameter of the batch of tobacco to which the tobacco sample belongs according to the regularity characterization parameters corresponding to all the images to be processed.
[0107] On the basis of the above technical solutions, the second parameter determination unit includes:
[0108] A quantity determination subunit, used for counting a first quantity of a regularity degree characterization parameter within a preset range;
[0109] The parameter determination subunit is used to determine the regularity parameter of the batch to which the tobacco samples belong according to the first number and the number of images to be processed corresponding to the tobacco samples.
[0110] The technical solution provided by the embodiment of the present invention can binarize the image to be processed after collecting the image to be processed corresponding to at least two tobacco samples, so as to obtain the image to be used including two types of pixel values. Next, the tobacco area and tobacco length information corresponding to the tobacco sample can be determined based on the image to be used. Based on the tobacco area and tobacco length information, the tobacco regularity parameter can be determined. Furthermore, based on the regularity parameters corresponding to all tobacco samples, the regularity parameters of the batch of tobacco to which the tobacco sample belongs are determined, which solves the problem of low judgment efficiency and accuracy when judging the regularity of tobacco based on manual methods in the prior art, and realizes the objective evaluation of the regularity of cutting, thereby improving the technical effect of cutting quality evaluation.
[0111] The method device for determining the regularity of tobacco provided in the embodiment of the present invention can execute the method for determining the regularity of tobacco provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method for determining the regularity of tobacco.
[0112] It is worth noting that in the embodiment of the method device for determining the regularity of tobacco shreds, the various units and modules included are divided only according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0113] Fig.11 A schematic diagram of the structure of a server provided in an embodiment of the present invention. Fig.11 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Fig.11 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0114] like Fig.11 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0115] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0116] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0117] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig.11 not shown, usually called a "hard drive"). Although Fig.11 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0118] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0119] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0120] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing the method steps for determining the regularity of tobacco provided in the first embodiment of the present invention, the method comprising:
[0121] Collecting images to be processed corresponding to at least two tobacco samples;
[0122] Obtaining an image to be used by binarizing the image to be processed;
[0123] Determining the tobacco area and tobacco length information corresponding to the tobacco sample in the image to be used;
[0124] According to the tobacco areas of the at least two tobacco samples and the tobacco length information, a regularity parameter of the tobacco batch to which the tobacco samples belong is determined.
[0125] Of course, those skilled in the art will appreciate that the processor may also implement the technical solution of the method for determining the regularity of tobacco shreds provided in any embodiment of the present invention.
[0126] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method steps for determining the regularity of tobacco shreds provided in the foregoing embodiment of the present invention are implemented. The method comprises:
[0127] Collecting images to be processed corresponding to at least two tobacco samples;
[0128] Obtaining an image to be used by binarizing the image to be processed;
[0129] Determining the tobacco area and tobacco length information corresponding to the tobacco sample in the image to be used;
[0130] According to the tobacco areas of the at least two tobacco samples and the tobacco length information, a regularity parameter of the tobacco batch to which the tobacco samples belong is determined.
[0131] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0132] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0133] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0134] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0135] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the invention is determined by the scope of the appended claims.
Claims
1. A method for determining the regularity of tobacco, characterized in that include: Collecting images to be processed corresponding to at least two tobacco samples; Obtaining an image to be used by binarizing the image to be processed; Determining the tobacco area and tobacco length information corresponding to the tobacco sample in the image to be used; According to the tobacco areas of the at least two tobacco samples and the tobacco length information, a regularity parameter of the tobacco batch to which the tobacco samples belong is determined.
2. The method according to claim 1, characterized in that The step of obtaining the image to be used by binarizing the image to be processed comprises: Processing the pixel values of the pixel points in the image to be processed based on a binarization function to obtain a binarized image corresponding to the tobacco sample; The image to be used is obtained by filtering the binary image.
3. The method according to claim 1, characterized in that Determining the tobacco area corresponding to the tobacco sample in the image to be used includes: The number of pixels whose pixel values in the image to be used are preset pixel values is counted based on the objective function, and the tobacco area of the tobacco sample in the image to be used is determined according to the number of pixels.
4. The method according to claim 1, characterized in that The tobacco length information corresponding to the tobacco sample in the image to be used is determined, including: Extracting the image skeleton of the tobacco sample in the image to be used based on a skeleton extraction algorithm; Pruning the image skeleton based on a pruning algorithm to obtain a target branch; The tobacco length information of the image to be used is determined according to the pixel information corresponding to the target branch.
5. The method according to claim 1, characterized in that The step of determining the regularity parameter of the batch of tobacco to which the tobacco samples belong based on the tobacco areas and the tobacco length information of the at least two tobacco samples comprises: For each image to be processed, determining a regularity degree characterization parameter corresponding to the image to be processed according to information about the tobacco area and tobacco length of the image to be processed; The regularity parameter of the batch of shredded tobacco to which the shredded tobacco sample belongs is determined according to the regularity characterization parameters corresponding to all the images to be processed.
6. The method according to claim 5, characterized in that The step of determining the regularity parameter of the batch of tobacco to which the tobacco sample belongs based on the regularity characterization parameters corresponding to all the images to be processed includes: The statistical regularity degree represents a first quantity of the parameter within a preset range; The regularity parameter of the batch to which the shredded tobacco samples belong is determined according to the first number and the number of images to be processed corresponding to the shredded tobacco samples.
7. A device for determining the regularity of tobacco shreds, characterized in that: include: An image acquisition module, used for acquiring images to be processed corresponding to at least two tobacco samples; An image processing module, used for obtaining an image to be used by binarizing the image to be processed; An information determination module, used to determine the tobacco area and tobacco length information corresponding to the tobacco sample in the image to be used; The parameter determination module is used to determine the regularity parameter of the batch of tobacco to which the tobacco samples belong based on the tobacco areas of the at least two tobacco samples and the tobacco length information.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the regularity of tobacco as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for determining the regularity of tobacco shreds as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the method for determining the regularity of tobacco as claimed in any one of claims 1 to 6.