Machine vision-based cut tobacco simulation method, system, device and medium
The smoke image is segmented and cut through machine vision technology to generate a piece of smoke-like image after simulated cutting, which solves the problem that the conversion process of the smoke-to-tobac wire is difficult to explain, and realizes the precise connection and evaluation of the tobacco and the smoke index.
Patent Information
- Application Number
- CN202111573725.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The prior art is difficult to explain the conversion process of piece of cigarettes to tobacco, resulting in the inability to build a bridge between the tobacco and the piece of cigarette indicators.
Using machine vision-based smoke-forming simulation method, we collect the images of the cigarette before baking, segment and cut, generate the smoke-forming images after simulated smoke-forming images, obtain the particle size distribution and distribution characteristic size of the tobacco length, and construct a silk size index system.
Accurately describe the quality of the piece of smoke into a thread, build a bridge between the tobacco and the tobacco index, and realize the simulation and evaluation of the tobacco conversion process to the tobacco tobacco.
Smart Images

Figure CN114255222B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of tobacco leaf image processing, and relates to a simulation method and system, in particular to a cut tobacco filament simulation method, system, device and medium based on machine vision. Background Art
[0002] The size of cut tobacco directly affects the wire-making effect. The larger the size of cut tobacco, the longer the cut tobacco filaments will be after wire-making, and vice versa. At present, the research on the relationship between cut tobacco and tobacco filaments in the tobacco industry mainly describes the relationship between the two by establishing a regression equation between the tobacco filament structure and the cut tobacco structure. However, the measurement of tobacco filament structure and cut tobacco structure belongs to two measurement systems, and the two indicators can only be qualitatively correlated. Moreover, the conversion of cut tobacco into tobacco filaments is complex, and one-dimensional regression is difficult to explain the conversion process from cut tobacco to tobacco filaments.
[0003] Therefore, how to provide a cut tobacco filament simulation method, system, device and medium based on machine vision to solve the problem that the existing technology is difficult to explain the conversion process from cut tobacco to tobacco filaments, resulting in the inability to build a connection bridge between the tobacco filament and cut tobacco indicators has actually become an urgent technical problem for those skilled in the art. Summary of the Invention
[0004] In view of the above-mentioned disadvantages of the prior art, the purpose of the present invention is to provide a cut tobacco filament simulation method, system, device and medium based on machine vision, which is used to solve the problem that the existing technology is difficult to explain the conversion process from cut tobacco to tobacco filaments, resulting in the inability to build a connection bridge between the tobacco filament and cut tobacco indicators.
[0005] To achieve the above purpose and other related purposes, on the one hand, the present invention provides a cut tobacco filament simulation method based on machine vision, including: collecting a plurality of cut tobacco images before baking; segmenting the collected cut tobacco images before baking to segment out the cut tobacco images; cutting along a plurality of directions of the cut tobacco images before baking to form a cutting template, and generating a cut tobacco filament image after simulated wire-making based on the cutting module and the cut tobacco images.
[0006] In an embodiment of the present invention, the step of segmenting the collected cut tobacco images before baking includes: extracting the B channel of the RGB color space of the collected cut tobacco images before baking to obtain a B channel image.
[0007] In an embodiment of the present invention, after obtaining the B channel image, the cut tobacco filament simulation method based on machine vision further includes: after obtaining the B channel image, performing background cutting on the B channel image, and binarizing the background segmented image to form a binarized image; wherein, the binarized image includes a cut tobacco image and a background image.
[0008] In one embodiment of the present invention, the step of cutting along several directions of the pre-roasted cut tobacco image to form a cutting template includes: cutting along any direction of the collected cut tobacco image to form a cutting template having the same size as the cut tobacco image.
[0009] In one embodiment of the present invention, the step of generating a cut tobacco filament image after simulated cutting based on the cutting module and the cut tobacco image includes: multiplying each cutting template by the corresponding binary image to generate a cut tobacco filament image after simulated cutting.
[0010] In one embodiment of the present invention, after generating the cut tobacco filament image after simulated cutting, the cut tobacco filament simulation method based on machine vision further includes: obtaining the length particle size distribution and the characteristic size of the cut tobacco filament distribution in different cutting directions; the step of obtaining the length particle size distribution and the characteristic size of the cut tobacco filament distribution in different cutting directions includes: in the cut tobacco filament image, finding two end points of each cut tobacco filament; calculating the length of the cut tobacco filament between the two end points to form a set of cut tobacco filament lengths; for the set of cut tobacco filament lengths, calculating the cumulative proportion of the cut tobacco filament lengths in the set of cut tobacco filament lengths to characterize the length particle size distribution of the cut tobacco filaments in different cutting directions; calculating the characteristic size of the cut tobacco filament distribution through the relationship between the cumulative proportion of the cut tobacco filament lengths in the set of cut tobacco filament lengths and a preset cut tobacco filament length interval value.
[0011] In one embodiment of the present invention, the calculation method for calculating the cumulative proportion of the cut tobacco filament lengths in the set of cut tobacco filament lengths is: the cumulative proportion is equal to the ratio of the sum of the cut tobacco filament lengths greater than the preset cut tobacco filament length interval value to the cut tobacco filament lengths in all sets of cut tobacco filament lengths.
[0012] On the other hand, the present invention provides a cut tobacco filament simulation system based on machine vision, including: an acquisition module for acquiring a plurality of pre-roasted cut tobacco images; a segmentation module for segmenting the acquired pre-roasted cut tobacco images to segment the cut tobacco images;
[0013] A filament simulation module for cutting along several directions of the pre-roasted cut tobacco image to form a cutting template, and generating a cut tobacco filament image after simulated cutting based on the cutting module and the cut tobacco image.
[0014] On yet another hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the cut tobacco filament simulation method based on machine vision is implemented.
[0015] Finally, the present invention provides a cut tobacco filament simulation device based on machine vision, including: a processor and a memory;
[0016] The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the machine vision-based cut tobacco filament simulation device executes the machine vision-based cut tobacco filament simulation method.
[0017] As described above, the machine vision-based cut tobacco filament simulation method, system, device and medium of the present invention have the following beneficial effects:
[0018] The machine vision-based cut tobacco filament simulation method, system, device and medium of the present invention simulate and cut through cut tobacco images to obtain cut tobacco filament formation results, construct a filament size index system, can accurately describe the quality of cut tobacco filaments, and build a connection bridge between the indexes of cut tobacco and cut tobacco filaments. Description of the Drawings
[0019] Figure 1 It shows a schematic flowchart of the machine vision-based cut tobacco filament simulation method of the present invention in an embodiment.
[0020] Figure 2 It shows an example diagram of the cut tobacco image before baking of the present invention.
[0021] Figure 3 It shows an example diagram of the B-channel image obtained by extracting the B-channel in the RGB color space of the cut tobacco image before baking of the present invention.
[0022] Figure 4A It shows a schematic diagram of the cutting template matching the 0-degree cutting direction of the present invention.
[0023] Figure 4B It shows a schematic diagram of the cutting template matching the 45-degree cutting direction of the present invention.
[0024] Figure 4C It shows a schematic diagram of the cutting template matching the 90-degree cutting direction of the present invention.
[0025] Figure 5A It shows a schematic diagram of the cut tobacco filament image matching the 0-degree cutting direction of the present invention.
[0026] Figure 5B It shows a schematic diagram of the cut tobacco filament image matching the 45-degree cutting direction of the present invention.
[0027] Figure 5C It shows a schematic diagram of the cut tobacco filament image matching the 90-degree cutting direction of the present invention.
[0028] Figure 6 It shows a schematic diagram of the tobacco filament length particle size distribution curve of the present invention in different cutting directions.
[0029] Figure 7 It shows an example diagram of paper sheets of different sizes.
[0030] Figure 8 Shown is a schematic diagram of the shredded image of the present invention.
[0031] Figure 9 Shown is a schematic diagram of the similarity between the simulated filament size distribution curve of paper pieces of different sizes of the present invention and the actual filament formation result.
[0032] Figure 10 Shown is an example diagram of simulating filament formation from a large piece of tobacco leaf image
[0033] Figure 11 Shown is an example diagram of simulating filament formation from a medium-sized piece of tobacco leaf image
[0034] Figure 12 Shown is a schematic diagram of the filament size distribution curve after simulating the cutting of four size types of tobacco leaf pieces.
[0035] Figure 13 Shown is a schematic diagram of the principle structure of the tobacco leaf filament formation simulation system based on machine vision of the present invention in an embodiment.
[0036] Description of Component Labels
[0037] 1 Tobacco leaf filament formation based on machine vision
[0038] Simulation system
[0039] 11 Acquisition module
[0040] 12 Segmentation module
[0041] 13 Filament formation simulation module
[0042] 14 Evaluation module
[0043] Steps S11 - S14 Specific Embodiments
[0044] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0045] It should be noted that the diagrams provided in the following embodiments only schematically illustrate the basic concept of the present invention. Therefore, only the components related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0046] Example 1
[0047] This embodiment provides a method for simulating cut tobacco formation based on machine vision, including:
[0048] Collect a number of pre-baked cut tobacco images;
[0049] Segment the collected pre-baked cut tobacco images to segment the cut tobacco images;
[0050] Cut along several directions of the pre-baked cut tobacco image to form a cutting template, and generate an image of cut tobacco formation after simulated cutting based on the cutting module and the cut tobacco image.
[0051] The method for simulating cut tobacco formation based on machine vision provided in this embodiment will be described in detail below with reference to the drawings. Please refer to Figure 1 , which shows a schematic flow chart of the method for simulating cut tobacco formation based on machine vision in an embodiment. As Figure 1 shown, the method for simulating cut tobacco formation based on machine vision specifically includes the following steps:
[0052] S11, collect a number of pre-baked cut tobacco images I.
[0053] In this embodiment, pre-baked cut tobacco images of 3 kg of cut tobacco are collected from the production line. An example diagram of the pre-baked cut tobacco image is as Figure 2 shown.
[0054] S12, segment the collected pre-baked cut tobacco images to segment the cut tobacco images.
[0055] Specifically, S12 includes the following steps:
[0056] S121, extract the B channel of the RGB color space of the collected pre-baked cut tobacco image to obtain a B channel image.
[0057] S122, after obtaining the B channel image, perform background cutting on the B channel image, binarize the background segmentation image to form a binarized image; wherein, the binarized image includes a cut tobacco image and a background image.
[0058] In this embodiment, the B channel of the RGB color space of the collected pre-baked cut tobacco image is extracted by the threshold method. The obtained B channel image is as Figure 3 shown, and the binarized image is marked as I0. The cut tobacco image part in I0 is marked as 1, and the background part is marked as 0.
[0059] S13, cut along several directions of the pre-baked cut tobacco image to form a cutting template, and generate an image of cut tobacco formation after simulated cutting based on the cutting module and the cut tobacco image.
[0060] In this embodiment, S13 includes the following steps:
[0061] S131, Cut along any direction of the collected cut tobacco image to form a cutting template with the same size as the cut tobacco image.
[0062] For example, between 0 degrees and 90 degrees, randomly select several cutting directions, and cut the cut tobacco image before baking along the selected cutting directions to generate cutting templates matching the cutting directions.
[0063] For example, use the Bresenham line drawing algorithm to cut along three directions of 0 degrees, 45 degrees, and 90 degrees of the cut tobacco image I before baking to generate three cutting templates including pixels 0 and 1, as Figures 4A - 4C shown, where Figure 4A is the cutting template matching the 0-degree cutting direction, Figure 4B is the cutting template matching the 45-degree cutting direction, Figure 4C is the cutting template matching the 90-degree cutting direction. The sizes of the cutting templates are all the same as the size of the cut tobacco image I before baking.
[0064] S132, Multiply each cutting template by the corresponding binary image to generate a cut tobacco shredded image after simulated shredding. Please refer to Figures 5A - 5C , which are respectively displayed as cut tobacco shredded images matching the 0-degree cutting direction, cut tobacco shredded images matching the 45-degree cutting direction, and cut tobacco shredded images matching the 90-degree cutting direction.
[0065] S14, Obtain the length particle size distribution of cut tobacco filaments and the characteristic size of cut tobacco filament distribution in different cutting directions.
[0066] In this embodiment, S14 specifically includes the following steps:
[0067] S141, In the cut tobacco shredded image, find the two endpoints (x1, y1), (x2, y2) of each cut tobacco filament.
[0068] S142, Calculate the length d of the cut tobacco filament between the two endpoints to form a set ds of cut tobacco filament lengths. The calculation formula for the length d of the cut tobacco filament between the two endpoints is as follows:
[0069]
[0070] S143, For the set ds of cut tobacco filament lengths, calculate the cumulative proportion F(X i ) of the cut tobacco filament lengths in the set of cut tobacco filament lengths to characterize the length particle size distribution of cut tobacco filaments in different cutting directions. Please refer to Figure 6 , which is shown as a schematic diagram of the length particle size distribution curve of cut tobacco filaments in different cutting directions, asFigure 6 As shown, for the same set of cut tobacco image samples, the particle size distribution curves of the cut tobacco lengths in the three cutting directions are similar. Continuing to refer to Table 1, it shows that the characteristic sizes and uniformity coefficients derived from the curves are similar, and the similarity among the three is as high as 0.9999, proving that cutting can be performed in any direction when simulating the cutting of cut tobacco images into filaments.
[0071] Table 1: Characteristic values of particle size distribution and similarity in three cutting directions
[0072]
[0073] S144. Through the relationship between the cumulative proportion F(X i ) of the cut tobacco lengths in the cut tobacco length set and the preset cut tobacco length interval value, the characteristic size of the cut tobacco distribution is calculated.
[0074] In this embodiment, the calculation method for calculating the cumulative proportion of the cut tobacco lengths in the cut tobacco length set is as follows:
[0075] The cumulative proportion is equal to the ratio of the sum of the cut tobacco lengths greater than the preset cut tobacco length interval value to the sum of all cut tobacco lengths in the cut tobacco length set, that is, the following calculation formula:
[0076]
[0077] Among them, F(X i ) represents the cumulative proportion of the cut tobacco length d in the cut tobacco length set ds, is the sum of all cut tobacco lengths in the cut tobacco length set ds, the sum of the cut tobacco lengths greater than the preset cut tobacco length interval value Xi, and the preset cut tobacco length interval value is equal to 1, 2, 3,..., n.
[0078] In this embodiment, the following conditions are satisfied between Xi and F(X i ):
[0079] Among them, i = 1, 2, 3,..., n. When F(X) is equal to 0.5, then the corresponding Xi value is the characteristic size of the cut tobacco distribution, b is the distribution uniformity coefficient of the cut tobacco, and a is a constant.
[0080] The above cut tobacco filament simulation method based on machine vision will be practically applied as follows:
[0081] Take 250 pieces of red A4 paper, about 1.25 kg, and cut the A4 paper according to its 1 / 4, 1 / 8, 1 / 16, 1 / 32, 1 / 64 sizes, as Figure 7As shown, 0.25 kg of paper sheets of each size were prepared. The cut images were photographed by the cut tobacco image acquisition device. The photographed paper sheet images were simulated and cut into filaments using the above-mentioned cut tobacco filament-making method based on machine vision with a 0-degree cutting template, and the filament length particle size distribution curve was calculated. The paper sheet samples after photographing were cut into filaments using a filament cutter, and the cut tobacco filament lengths were manually measured as shown in Figure 8 As shown, the paper filament length distribution curve was calculated using the particle size distribution method and compared with the image-simulated filament-making curve. The results are as shown in Figure 9 and Table 2. The similarity between the simulated filament-making particle size distribution curves of paper sheets of different sizes and the actual filament-making results reached over 0.99, and the detection deviation of the characteristic sizes of the simulated filament-making of paper sheets of each size was within 5%, indicating that the simulated filament-making detection results of this method are similar to the actual filament-making results. Through the paper sheet filament-making experiment, it was proved that the method described in the present invention can accurately simulate the filament-making process.
[0082] Table 2: Comparison of characteristic values of simulated filament-making and actual filament-making length particle size distribution curves of paper sheets of different sizes
[0083]
[0084] Based on the cut tobacco filament length data obtained from the simulated cutting, evaluation indexes for cut tobacco filament-making were constructed. Specifically, it was divided into 6 cut tobacco filament length segments according to filaments longer than or equal to 40 mm (extra-long filaments), 25.4 mm to 40 mm (medium-long filaments), 12.7 mm to 25.4 mm (medium filaments), 6.35 mm to 12.7 mm (medium-short filaments), 3.175 mm to 6.35 mm (short filaments), and shorter than 3.175 mm (broken filaments), and the rest were set according to the current standard size of the cut tobacco structure. The proportion of the cut tobacco filament length in each cut tobacco filament length segment was calculated, and the characteristic size and uniformity coefficient of the test sample were calculated using the particle size distribution method, totaling 8 cut tobacco simulated filament-making indexes.
[0085] Specifically, the calculation method for the actual length ratio of the 6 cut tobacco filament lengths is as follows:
[0086] Application example:
[0087] 3 kg of cut tobacco samples of large pieces, medium pieces, small pieces, and fragments were prepared respectively. After image acquisition, the image-simulated filament cutting results using the method of the present invention are as shown in Figure 10 and Figure 11 As shown, the filament-making particle size distribution curves of the four size types of cut tobacco after simulated cutting are as shown in Figure 12As shown, the particle size distribution curve shows a certain gradient change as the size of cut tobacco slices decreases. Table 3 proves that after simulating different-sized cut tobacco slices into cut tobacco filaments, the proportion of each cut tobacco filament length segment shows a regular change, that is, the proportion of large cut tobacco long filaments and extra-long filaments is the highest at 52.67%, the proportion of medium cut tobacco medium filaments is the highest at 45.80%, the proportion of small cut tobacco short and medium filaments is the highest at 54.13%, and the proportion of shredded tobacco short filaments is the highest at 49%; in terms of characteristic size, there is a decreasing relationship of about 2 times between medium cut tobacco, small cut tobacco, and shredded tobacco, which is consistent with the change law of the sieve mesh size of the cut tobacco vibrating screen. In terms of the uniformity coefficient, the smaller the size of the cut tobacco slices, the more regular the cut tobacco slices, which conforms to the common sense law. Therefore, the method of the present invention deeply reveals the corresponding relationship between the size of cut tobacco slices and cut tobacco filaments.
[0088] Table 3: Indexes of Simulating Cut Tobacco Slices of Four Types into Cut Tobacco Filaments
[0089]
[0090] The method for simulating cut tobacco filament formation based on machine vision described in this embodiment obtains the result of cut tobacco filament formation by simulating the cutting of cut tobacco images, constructs an index system for filament formation size, can accurately describe the quality of cut tobacco filament formation, and builds a connection bridge between the indexes of cut tobacco filaments and cut tobacco slices.
[0091] This embodiment also provides a medium (also known as a computer-readable storage medium) with a computer program stored thereon, and when the program is executed by a processor, it implements the Figure 1 method for simulating cut tobacco filament formation based on machine vision as described above.
[0092] At any possible combination level of technical details, the present application can be a system, a method, and / or a computer program product. The computer program product can include a computer-readable storage medium with computer-readable program instructions for causing a processor to implement various aspects of the present application loaded thereon.
[0093] A computer-readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer-readable storage medium can be, for example, (but is not limited to) an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include: 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), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disc (DVD), a memory stick, a floppy disk, a mechanically encoded device, such as a punched card or raised structures in grooves having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium as used herein is not construed as being a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagated through a waveguide or other transmission medium (e.g., an optical pulse through an optical fiber cable), or an electrical signal transmitted through a wire.
[0094] The computer-readable programs described herein can be downloaded to various computing / processing devices from a computer-readable storage medium or downloaded to an external computer or external storage device via a network such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device. The computer program instructions for performing the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state-setting data, integrated circuit configuration data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone 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 through 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., by using an Internet service provider to connect through the Internet). In some embodiments, by using the status information of the computer-readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of this application.
[0095] This embodiment further provides a machine vision-based cut tobacco filament simulation system, including:
[0096] An acquisition module for acquiring a plurality of cut tobacco images before baking;
[0097] A segmentation module for segmenting the acquired cut tobacco images before baking to segment out the cut tobacco images;
[0098] A filament simulation module for cutting along a plurality of directions of the cut tobacco images before baking to form a cutting template, and generating a cut tobacco filament image after simulated filament cutting based on the cutting module and the cut tobacco images.
[0099] The machine vision-based cut tobacco filament simulation system provided in this embodiment will be described in detail below with reference to the drawings. Please refer to Figure 13, shown as the schematic diagram of the principle structure of the cut tobacco shredding simulation system based on machine vision in an embodiment. As Figure 13 shown, the cut tobacco shredding simulation system 1 based on machine vision includes an acquisition module 11, a segmentation module 12, a shredding simulation module 13, and an evaluation module 14.
[0100] The acquisition module 11 is used to acquire a plurality of cut tobacco images I before baking.
[0101] The segmentation module 12 is used to segment the cut tobacco image before baking acquired by the acquisition module 11 to segment out the cut tobacco image.
[0102] Specifically, the segmentation module 12 extracts the B channel of the RGB color space of the acquired cut tobacco image before baking to obtain the B channel image. After obtaining the B channel image, the background of the B channel image is cut, and the background segmentation image is binarized to form a binarized image; wherein, the binarized image includes a cut tobacco image and a background image.
[0103] In this embodiment, the segmentation module 12 extracts the B channel of the RGB color space of the acquired cut tobacco image before baking by the threshold method, and the obtained B channel image is as Figure 3 shown, the binarized image is marked as I0, the cut tobacco image part in I0 is marked as 1, and the background part is marked as 0.
[0104] The shredding simulation module 13 is used to cut along several directions of the cut tobacco image before baking to form a cutting template, and generate a cut tobacco shredded image after simulation shredding based on the cutting module and the cut tobacco image.
[0105] In this embodiment, the shredding simulation module 13 cuts along any direction of the acquired cut tobacco image to form a cutting template with the same size as the cut tobacco image. Multiply each cutting template with the corresponding binarized image to generate a cut tobacco shredded image after simulation shredding.
[0106] For example, the shredding simulation module 13 randomly selects several cutting directions between 0 degrees and 90 degrees, and cuts the cut tobacco image before baking along the selected cutting directions to generate a cutting template matching the cutting direction. Please refer to Figures 5A - 5C , which are respectively shown as the cut tobacco shredded images matching the 0-degree cutting direction, the cut tobacco shredded images matching the 45-degree cutting direction, and the cut tobacco shredded images matching the 90-degree cutting direction.
[0107] For example, the shredding simulation module 13 uses the Bresenham line drawing algorithm to cut along the 0-degree, 45-degree, and 90-degree directions of the cut tobacco image I before baking respectively to generate three cutting templates including pixels 0 and 1, as Figures 4A - 4C shown, wherein,Figure 4A is a cutting template matching the 0-degree cutting direction, Figure 4B is a cutting template matching the 45-degree cutting direction, Figure 4C is a cutting template matching the 90-degree cutting direction. The sizes of the cutting templates are all the same as the size of the pre-roasted cut tobacco image I.
[0108] The evaluation module 14 is used to obtain the length particle size distribution of cut tobacco and the characteristic size of cut tobacco distribution in different cutting directions.
[0109] In this embodiment, the evaluation module 14 finds the two endpoints of each cut tobacco in the cut tobacco filament image; calculates the length d of the cut tobacco between the two endpoints to form a set ds of cut tobacco lengths; for the set ds of cut tobacco lengths, calculates the cumulative proportion F(X i ) of the cut tobacco lengths in the set to characterize the length particle size distribution of cut tobacco in different cutting directions. By the relationship between the cumulative proportion F(X i ) of the cut tobacco lengths in the set of cut tobacco lengths and the preset cut tobacco length interval value, the characteristic size of cut tobacco distribution is calculated.
[0110] It should be noted that it should be understood that the division of each module of the above system is only a division of logical functions. In actual implementation, it can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by processing elements, or all be implemented in the form of hardware, or some modules be implemented in the form of software called by processing elements and some modules be implemented in the form of hardware. For example, the x module can be a separately established processing element, or can be implemented by integrating it into a certain chip of the above system. In addition, the x module can also be stored in the memory of the above system in the form of program code, and be called and executed by a certain processing element of the above system to perform the functions of the above x module. The implementation of other modules is similar. These modules can be integrated together in whole or in part, or can be independently implemented. The processing element mentioned here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by the integrated logic circuit in hardware in the processor element or the instructions in software form. The above modules can be one or more integrated circuits configured to implement the above method, for example: one or more application specific integrated circuits (ASIC), one or more digital signal processors (DSP), one or more field programmable gate arrays (FPGA), etc. When a certain module above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. These modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0111] Embodiment 2
[0112] Another machine vision-based cut tobacco shredding device provided by an embodiment of the present application includes: a processor, a memory, a transceiver, a communication interface, or / and a system bus; the memory and the communication interface are connected to the processor and the transceiver through the system bus and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate with other devices, and the processor and the transceiver are used to run the computer programs to enable the machine vision-based cut tobacco shredding device to execute each step of the machine vision-based cut tobacco shredding simulation method as described above.
[0113] The aforementioned system bus can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to implement the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include Random Access Memory (RAM), and may also include non-volatile memory, such as at least one disk memory.
[0114] The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0115] The protection scope of the method for simulating cut tobacco filament based on machine vision according to the present invention is not limited to the execution order of the steps listed in this embodiment. Any solution achieved by adding or reducing steps of the prior art and replacing steps according to the principle of the present invention is included in the protection scope of the present invention.
[0116] The present invention also provides a system for simulating cut tobacco filament based on machine vision. The system for simulating cut tobacco filament based on machine vision can implement the method for simulating cut tobacco filament based on machine vision according to the present invention. However, the implementation devices of the method for simulating cut tobacco filament based on machine vision according to the present invention include, but are not limited to, the structure of the system for simulating cut tobacco filament based on machine vision listed in this embodiment. Any structural deformation and replacement of the prior art made according to the principle of the present invention are included in the protection scope of the present invention.
[0117] In summary, the method, system, device and medium for simulating cut strip tobacco into cut tobacco filaments based on machine vision of the present invention simulate the cutting of strip tobacco images to obtain the result of cut strip tobacco into cut tobacco filaments, construct an index system for the size of cut tobacco filaments, and can accurately describe the quality of cut strip tobacco into cut tobacco filaments, building a connection bridge between the indexes of cut tobacco and strip tobacco. Therefore, the present invention effectively overcomes various drawbacks in the prior art and has high industrial utilization value.
[0118] The above embodiments are only illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.
Claims
1. A method for simulating cut tobacco from tobacco leaves based on machine vision, characterized in that, Including: Collecting a plurality of pre - baked cut - tobacco images; Extracting the B channel of the RGB color space from the collected pre - baked cut - tobacco images to obtain a B - channel image; Segmenting the collected pre - baked cut - tobacco images to segment out the cut - tobacco images; Performing background cutting on the B - channel image, binarizing the background - segmented image to form a binarized image; wherein, the binarized image includes a cut - tobacco image and a background image; Cutting along several directions of the pre - baked cut - tobacco image to form a cutting template, and generating a cut - tobacco shredded image after simulated cutting based on the cutting module and the cut - tobacco image, wherein the size of the cutting template is the same as that of the cut - tobacco image; Searching for two endpoints of each tobacco strand in the cut - tobacco shredded image, calculating the length of the tobacco strand between the two endpoints, and forming a set of tobacco - strand lengths based on the tobacco - strand lengths; Calculating the cumulative proportion of the tobacco - strand lengths in the set of tobacco - strand lengths to obtain the tobacco - strand length particle - size distribution in different cutting directions; Obtaining the characteristic size of the tobacco - strand distribution based on the cumulative proportion of the tobacco - strand lengths in the set of tobacco - strand lengths and a preset tobacco - strand length interval value; Wherein, the cumulative proportion of the tobacco - strand lengths in the set of tobacco - strand lengths is equal to the ratio of the sum of the tobacco - strand lengths greater than the preset tobacco - strand length interval value to the tobacco - strand lengths in all sets of tobacco - strand lengths, expressed as: Among them, F(X i ) represents the cumulative proportion of the cut tobacco length d in the cut tobacco length set ds, is the sum of all cut tobacco lengths in the cut tobacco length set ds, the sum of the cut tobacco lengths with the cut tobacco length greater than the preset cut tobacco length interval value Xi, and the preset cut tobacco length interval value is equal to 1, 2, 3,..., n.
2. The method for simulating cut tobacco from tobacco slices based on machine vision according to claim 1, wherein The step of generating a cut - tobacco shredded image after simulated cutting based on the cutting module and the cut - tobacco image includes: Multiplying each cutting template by the corresponding binarized image to generate a cut - tobacco shredded image after simulated cutting.
3. The method for simulating cut tobacco from tobacco leaves based on machine vision according to claim 2, wherein, After generating the cut - tobacco shredded image after simulated cutting, the method for simulating cut - tobacco shredding based on machine vision further includes: obtaining the tobacco - strand length particle - size distribution and the characteristic size of the tobacco - strand distribution in different cutting directions; the steps of obtaining the tobacco - strand length particle - size distribution and the characteristic size of the tobacco - strand distribution in different cutting directions include: Searching for two endpoints of each tobacco strand in the cut - tobacco shredded image; Calculating the length of the tobacco strand between the two endpoints to form a set of tobacco - strand lengths; Calculating the cumulative proportion of the tobacco - strand lengths in the set of tobacco - strand lengths for the set of tobacco - strand lengths to characterize the tobacco - strand length particle - size distribution in different cutting directions; Calculating the characteristic size of the tobacco - strand distribution through the relationship between the cumulative proportion of the tobacco - strand lengths in the set of tobacco - strand lengths and the preset tobacco - strand length interval value.
4. The method for simulating cut tobacco from tobacco slices based on machine vision according to claim 3, characterized in that The calculation method for calculating the cumulative proportion of the tobacco - strand lengths in the set of tobacco - strand lengths is: The cumulative proportion is equal to the ratio of the sum of the tobacco - strand lengths greater than the preset tobacco - strand length interval value to the tobacco - strand lengths in all sets of tobacco - strand lengths.
5. A cut tobacco shredding simulation system based on machine vision, characterized in that, Including: A collection module for collecting a plurality of pre - baked cut - tobacco images; A segmentation module for segmenting the collected pre - baked cut - tobacco images to segment out the cut - tobacco images; A filament forming simulation module is configured to cut along several directions of the pre-baked cut tobacco image to form a cutting template, generate a cut tobacco filament forming image after simulated filament cutting based on the cutting module and the cut tobacco image; find two endpoints of each tobacco filament in the cut tobacco filament forming image, calculate the length of the tobacco filament between the two endpoints, and form a tobacco filament length set based on the tobacco filament length; calculate the cumulative proportion of the tobacco filament lengths in the tobacco filament length set to obtain the tobacco filament length particle size distribution in different cutting directions; and obtain the tobacco filament distribution characteristic size based on the cumulative proportion of the tobacco filament lengths in the tobacco filament length set and a preset tobacco filament length interval value, where the cumulative proportion of the tobacco filament lengths in the tobacco filament length set is equal to the ratio of the sum of the tobacco filament lengths greater than the preset tobacco filament length interval value to the tobacco filament lengths in all tobacco filament length sets, expressed as: Among them, F(X i ) represents the cumulative proportion of the cut tobacco length d in the cut tobacco length set ds, which is the sum of all cut tobacco lengths in the cut tobacco length set ds and the sum of the cut tobacco lengths greater than the preset cut tobacco length interval value Xi. The preset cut tobacco length interval value is equal to 1, 2, 3, …, n.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the machine vision-based cut tobacco filament forming simulation method according to any one of claims 1 to 4.
7. A cut tobacco shredding simulation device based on machine vision, characterized in that, Comprising: A processor and a memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the machine vision-based cut tobacco filament forming simulation device executes the machine vision-based cut tobacco filament forming simulation method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Tobacco strip attribute characterization method, system and equipment and computer readable storage medium
CN113139951A