Detection method and device and computer readable storage medium
By collecting multiple tobacco images during the tobacco production process, highly representative designated tobacco wire were screened, and quality detection was carried out based on the width of these designated tobacco wires, the problem of low accuracy in quality detection in the prior art was solved, and the accuracy of detection and yield of tobacco wires were improved.
Patent Information
- Application Number
- CN202411887727.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-18
AI Technical Summary
The accuracy of tobacco quality detection in the prior art is low, resulting in unstable width of tobacco, affecting the yield rate of finished tobacco and waste of tobacco leaves.
By collecting multiple tobacco images of a batch of tobacco threads during the tobacco thread production process, the first designated tobacco thread corresponding to each tobacco thread image is selected, and the second designated tobacco thread corresponding to a batch of tobacco threads is determined from the plurality of first designated tobacco threads, and quality detection is performed based on the width of the second designated tobacco thread.
It improves the accuracy of tobacco quality testing and can more comprehensively and accurately reflect the width changes of a batch of tobacco in the production process, thereby reducing tobacco leaf waste and improving yield.
Smart Images

Figure CN119845157A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of detection technology, and in particular to a detection method, device and computer-readable storage medium. Background Art
[0002] In the tobacco processing process, the stability of the width of the cut tobacco has a great influence on the quality of the produced tobacco. For example, if there is a large difference between the width of the cut tobacco and the width of the cut tobacco required by the cutting process standard, the yield rate of the subsequent finished tobacco will be low, resulting in a large waste of tobacco raw materials.
[0003] In the related art, quality inspectors mainly rely on sampling inspection of produced tobacco, and inspect the quality of tobacco based on the width of tobacco determined by sampling inspection. Summary of the invention
[0004] The inventors of the present disclosure have discovered that the above-mentioned related technologies have the following problems: the accuracy of tobacco quality detection is low.
[0005] In order to solve the above problems, the embodiments of the present disclosure provide the following solutions.
[0006] According to some embodiments of the present disclosure, a detection method is provided, comprising: collecting multiple tobacco images of a batch of tobacco in a tobacco production process, each of the multiple tobacco images comprising multiple tobacco to be tested; determining a first designated tobacco corresponding to each tobacco image from the multiple tobacco to be tested; determining a second designated tobacco corresponding to the batch of tobacco from the multiple first designated tobacco corresponding to the multiple tobacco images; and performing quality detection on the batch of tobacco according to the width of the second designated tobacco.
[0007] In some embodiments, determining the first designated tobacco corresponding to each tobacco image from the multiple tobacco to be tested includes: determining the width of each tobacco to be tested in the multiple tobacco to be tested; and determining the first designated tobacco corresponding to each tobacco image based on the difference between the width of each tobacco to be tested and the standard width.
[0008] In some embodiments, determining the width of each of the multiple tobacco shreds to be tested includes: detecting the outline of each tobacco shred to be tested in each tobacco shred image to determine the size of each tobacco shred to be tested; and determining the width of each tobacco shred to be tested according to the size of each tobacco shred to be tested.
[0009] In some embodiments, determining the width of each tobacco shred to be tested according to the size of each tobacco shred to be tested includes: determining the width of each tobacco shred to be tested according to the size of each tobacco shred to be tested and a reference parameter, wherein the reference parameter is determined based on an actual width of a reference object and a size of the reference object in a reference image.
[0010] In some embodiments, the reference parameter is determined based on a ratio between an actual width of a reference object and a size of the reference object in the reference image.
[0011] In some embodiments, the multiple tobacco images include a first tobacco image, and the first tobacco image includes a first tobacco to be tested and a second tobacco to be tested; determining the first designated tobacco corresponding to each tobacco image from the multiple tobacco to be tested includes: determining the width of the first tobacco to be tested and the width of the second tobacco to be tested; judging whether the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is greater than a preset threshold; and determining the first designated tobacco from the first tobacco to be tested and the second tobacco to be tested based on the result of the judgment, the width of the first tobacco to be tested and the width of the second tobacco to be tested.
[0012] In some embodiments, determining the first designated tobacco from the first tobacco to be tested and the second tobacco to be tested based on the result of the judgment, the width of the first tobacco to be tested and the width of the second tobacco to be tested includes: in response to the result of the judgment being that the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is greater than the preset threshold, correcting the width of the second tobacco to be tested based on the pixel ratio of the second tobacco to be tested in the first tobacco image; determining the first designated tobacco from the first tobacco to be tested and the second tobacco to be tested based on the width of the first tobacco to be tested and the corrected width of the second tobacco to be tested.
[0013] In some embodiments, correcting the width of the second tobacco to be tested according to the pixel ratio of the second tobacco to be tested in the first tobacco image includes: correcting the width of the second tobacco to be tested according to the pixel ratio of the second tobacco to be tested in the first tobacco image and a correction parameter, wherein the correction parameter is determined based on the measured width of the reference tobacco detected online during the tobacco production process and the actual width of the reference tobacco detected offline after the tobacco production is completed.
[0014] In some embodiments, the correction parameter is determined based on a ratio between a measured width of the reference tobacco thread and an actual width of the reference tobacco thread.
[0015] In some embodiments, determining the first designated tobacco from the first tobacco to be tested and the second tobacco to be tested based on the result of the judgment, the width of the first tobacco to be tested and the width of the second tobacco to be tested includes: in response to the result of the judgment being that the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is not greater than the preset threshold, determining the first designated tobacco from the first tobacco to be tested and the second tobacco to be tested based on the width of the first tobacco to be tested and the width of the second tobacco to be tested.
[0016] In some embodiments, determining the second designated tobacco shreds corresponding to the batch of tobacco shreds from the plurality of first designated tobacco shreds corresponding to the plurality of tobacco shred images comprises: determining the second designated tobacco shreds according to the median of the widths of the plurality of first designated tobacco shreds.
[0017] In some embodiments, the testing of the batch of tobacco shreds according to the width of the second designated tobacco shreds includes: testing the quality of the batch of tobacco shreds according to a difference between the width of the second designated tobacco shreds and a standard width.
[0018] According to some other embodiments of the present disclosure, there is provided a detection device, comprising: an acquisition module, configured to acquire multiple tobacco images of a batch of tobacco in a tobacco production process, each of the multiple tobacco images comprising multiple tobacco to be tested; a determination module, configured to determine a first designated tobacco corresponding to each tobacco image from the multiple tobacco to be tested, and to determine a second designated tobacco corresponding to the batch of tobacco from the multiple first designated tobacco corresponding to the multiple tobacco images; and a detection module, configured to detect the batch of tobacco according to the second designated tobacco.
[0019] According to some further embodiments of the present disclosure, a detection device is provided, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute the detection method in any one of the above embodiments based on instructions stored in the memory device.
[0020] According to some further embodiments of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the detection method in any of the above embodiments is implemented.
[0021] According to some further embodiments of the present disclosure, a computer program product is provided, comprising instructions, which, when executed by a processor, enable the processor to perform the detection method according to any one of the above embodiments.
[0022] In the above embodiment, multiple first designated tobacco shreds can comprehensively and accurately reflect the width changes of this batch of tobacco shreds during the production process, and then the width of the second designated tobacco shreds screened out from the multiple first designated tobacco shreds can accurately reflect the quality of this batch of tobacco shreds, thereby performing tobacco quality detection based on the width of the second designated tobacco shreds, which can improve the accuracy of tobacco quality detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0024] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0025] Figure 1 A flow chart showing some embodiments of the detection method of the present disclosure;
[0026] Figure 2 A flow chart showing some embodiments of step 120 of the present disclosure;
[0027] Figure 3 A block diagram showing some embodiments of the detection device of the present disclosure;
[0028] Figure 4 A block diagram showing some other embodiments of the detection device disclosed herein;
[0029] Figure 5 The following is a block diagram showing some further embodiments of the detection device of the present disclosure. DETAILED DESCRIPTION
[0030] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0031] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0032] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0033] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0034] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0035] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0036] As mentioned above, under the manual sampling method in the relevant technology, on the one hand, the error in tobacco width detection is large under different inspection personnel and / or different inspection techniques; on the other hand, in the tobacco production process, due to the influence of moisture and temperature in the production environment, there will generally be certain differences in the widths of different tobaccos in a batch of tobacco produced, and the inspection results of manual offline sampling have a large lag, making it difficult to ensure that the sampled tobacco can fully and timely reflect the width changes of this batch of tobacco in the production process, resulting in low accuracy in tobacco quality inspection based on the sampled tobacco.
[0037] In view of this, the present disclosure proposes a detection method, which can screen out designated tobacco that can accurately reflect the quality of a batch of tobacco based on multiple tobacco images of a batch of tobacco during the tobacco production process, thereby performing tobacco quality detection based on the designated tobacco, which can improve the accuracy of tobacco quality detection.
[0038] Figure 1 A flow chart showing some embodiments of the detection method of the present disclosure.
[0039] like Figure 1 As shown, in step 110, a plurality of tobacco images of a batch of tobacco in the tobacco production process are collected.
[0040] Here, each of the plurality of tobacco shred images includes a plurality of tobacco shreds to be tested.
[0041] In some embodiments, multiple tobacco images of a batch of tobacco shreds may be collected in real time during the production process of the batch of tobacco shreds. For example, a sensor (e.g., a binocular camera) may be deployed at the tobacco shred production site to collect multiple tobacco shreds images of a batch of tobacco shreds (e.g., a batch of tobacco shreds conveyed on a conveyor belt) during the tobacco shred production process in real time. In this way, the collected multiple tobacco shreds images can accurately reflect the width changes of the batch of tobacco shreds during the tobacco shred production process.
[0042] In some embodiments, the multiple tobacco images of a batch of tobacco shreds collected may be multiple continuous images. For example, 3600 tobacco images of a batch of tobacco shreds may be collected continuously within one hour of tobacco production at a collection frequency of one tobacco shred image per second.
[0043] In some embodiments, each of the plurality of tobacco cut images may include a plurality of tobacco cuts to be tested that are produced successively from a batch of tobacco cuts.
[0044] In step 120, a first designated tobacco cut corresponding to each tobacco cut image is determined from a plurality of tobacco cuts to be tested.
[0045] In some embodiments, the first designated tobacco shred corresponding to the tobacco shred image to which the multiple tobacco shreds to be tested belong may be determined according to the width of each tobacco shred to be tested among the multiple tobacco shreds to be tested.
[0046] It should be understood that the width of the first designated tobacco shreds corresponding to each tobacco shred image selected from the multiple tobacco shreds to be tested in each tobacco shred image can accurately reflect the quality of the multiple tobacco shreds to be tested in the tobacco shred image.
[0047] In step 130, second designated cut tobacco corresponding to a batch of cut tobacco is determined from a plurality of first designated cut tobacco corresponding to a plurality of cut tobacco images.
[0048] In some embodiments, second designated tobacco shreds corresponding to a batch of tobacco shreds may be determined based on the widths of a plurality of first designated tobacco shreds corresponding to a plurality of tobacco shred images.
[0049] It should be understood that the width of the second designated tobacco shreds corresponding to a batch of tobacco shreds selected from a plurality of first designated tobacco shreds corresponding to a plurality of tobacco shreds images of a batch of tobacco shreds and corresponding to the batch of tobacco shreds can accurately reflect the quality of the batch of tobacco shreds.
[0050] In step 140, a batch of tobacco shreds is quality inspected according to the width of the second designated tobacco shreds.
[0051] In some embodiments, the quality of a batch of tobacco shreds can be detected according to the width of the second designated tobacco shreds. For example, the quality of the batch of tobacco shreds can be detected according to the difference between the width of the second designated tobacco shreds and the standard width.
[0052] For example, the standard width may be the width required by the silk-making process standard. The silk-making process standard requires that the width of the tobacco shreds may be one of three specifications: 0.8 mm, 0.9 mm, and 1.0 mm. For example, in the case of allowing a certain processing error, it may be determined whether the quality of the corresponding batch of tobacco shreds is qualified based on whether the width of the second designated tobacco shreds is less than 0.8 mm or greater than 1.0 mm. If the width of the second designated tobacco shreds is less than 0.8 mm or greater than 1.0 mm, it may be determined that the width of the corresponding batch of tobacco shreds is abnormal, and further, it may be determined that the quality of this batch of tobacco shreds is unqualified.
[0053] In the above embodiment, during the production of tobacco shreds, by collecting multiple tobacco shreds images of a batch of tobacco shreds, the first designated tobacco shreds corresponding to each tobacco shreds image can be screened out from the multiple tobacco shreds to be tested in each tobacco shreds image, and then the second designated tobacco shreds corresponding to the batch of tobacco shreds can be screened out from the multiple first designated tobacco shreds corresponding to the multiple tobacco shreds images. Afterwards, the quality of the batch of tobacco shreds is inspected according to the width of the second designated tobacco shreds.
[0054] In this way, multiple first designated tobacco shreds can comprehensively and accurately reflect the width changes of this batch of tobacco shreds during the production process, and then the width of the second designated tobacco shreds selected from multiple first designated tobacco shreds can accurately reflect the quality of this batch of tobacco shreds, thereby performing tobacco quality detection based on the width of the second designated tobacco shreds, which can improve the accuracy of tobacco quality detection.
[0055] In addition, the detection method provided by the present disclosure can perform online detection of tobacco during the production process of tobacco, so that the relevant parameters of tobacco processing equipment can be adjusted in a timely manner according to the detection results, which is helpful to improve the quality of tobacco and thus improve the yield rate of tobacco. Moreover, the detection method provided by the present disclosure can be implemented without deploying complex detection models or sensors, which not only improves the efficiency of tobacco quality detection, but also reduces the detection cost.
[0056] The technical solution of step 120 is exemplarily described below through some embodiments.
[0057] In some embodiments, the width of each of the multiple tobacco shreds to be tested in each tobacco shred image may be determined, and then the first designated tobacco shred corresponding to each tobacco shred image may be determined according to the difference between the width of each tobacco shred to be tested and the standard width.
[0058] For example, the tobacco to be tested whose width has the smallest difference with the standard width among the multiple tobacco to be tested can be determined as the first designated tobacco. For example, taking the standard width of 0.9 mm as an example, assuming that the widths of the multiple tobacco to be tested in a tobacco image are 0.78 mm, 0.88 mm, and 0.91 mm, respectively, and the difference between 0.91 mm and the standard width of 0.9 mm is the smallest, then the tobacco with a width of 0.91 mm can be determined as the first designated tobacco corresponding to the tobacco image.
[0059] In some embodiments, the width of each of the plurality of tobacco shreds to be tested may be determined as follows.
[0060] Firstly, in each tobacco cut image, the outline of each tobacco cut to be tested is detected to determine the size of each tobacco cut to be tested.
[0061] Then, the width of each tobacco shred to be tested is determined according to the size of each tobacco shred to be tested.
[0062] For example, edge detection can be performed on each tobacco image to determine the outline of each tobacco to be tested in each tobacco image, and then the size of each tobacco to be tested can be determined based on the outline of each tobacco to be tested. For example, the size of each tobacco to be tested can be determined based on the size of the pixels occupied by each tobacco to be tested in the corresponding tobacco image.
[0063] In this way, by detecting the outline of each tobacco to be tested in each tobacco image, the width of each tobacco to be tested can be determined, which requires low computing power. On the basis of ensuring the accuracy of tobacco quality detection, the detection cost is further reduced.
[0064] In some embodiments, the width of each tobacco shred to be measured can be determined based on the size of each tobacco shred to be measured and the reference parameter. The reference parameter can be determined based on the actual width of the reference object and the size of the reference object in the reference image. It should be understood that the reference object can be any object.
[0065] Taking a cigarette box as an example, a reference image of the cigarette box can be acquired and edge detection can be performed on the reference image to determine the outline of the cigarette box in the reference image. The size of the cigarette box is determined based on the outline of the cigarette box in the reference image, and then the reference parameters are determined based on the size of the cigarette box and the actual width of the cigarette box.
[0066] In some embodiments, the reference parameter may be determined based on a ratio between an actual width of the reference object and a size of the reference object in the reference image.
[0067] Still taking the reference object as a cigarette box as an example, the actual width of the cigarette box is R, and the size of the cigarette box is the size S of the pixels occupied by the cigarette box in the reference image. The reference parameter P can be determined based on the ratio R / S between R and S.
[0068] Assuming that the size of each tobacco shred to be tested is the size s of the pixels occupied by the tobacco shred to be tested in the corresponding tobacco shred image, the width r of the tobacco shred to be tested can be determined based on the product of s and the reference parameter P. For example, the reference parameter P=R / S, the width r of each tobacco shred to be tested=the size s of each tobacco shred to be tested×the reference parameter P, that is, r=s×R / S.
[0069] In this way, the width of each tobacco shred to be tested can be calculated by using reference parameters and the size of each tobacco shred to be tested in the corresponding tobacco shred image. The method is simple and easy to implement, thereby further improving the detection efficiency and reducing the detection cost on the basis of ensuring the accuracy of tobacco quality detection.
[0070] In some embodiments, the plurality of tobacco images of a batch of tobacco may include a first tobacco image. For example, the first tobacco image may be any one of the plurality of tobacco images.
[0071] The first tobacco cut image may include multiple tobacco cuts to be tested with different pixel proportions. In this case, the first designated tobacco cut may be determined from the multiple tobacco cuts to be tested by further combining the difference between the pixel proportions of the multiple tobacco cuts to be tested in the first tobacco cut image.
[0072] In the following, the first tobacco image includes the first tobacco to be tested and the second tobacco to be tested as an example. Figure 2 The technical solution of step 120 is further explained.
[0073] Figure 2 A flow chart illustrating some embodiments of step 120 of the present disclosure.
[0074] like Figure 2 As shown, in step 210, the width of the first tobacco shred to be measured and the width of the second tobacco shred to be measured are determined.
[0075] In some embodiments, the width of the first and second tobacco shreds to be tested may be determined in a similar manner to the above-described determination of the width of each of the plurality of tobacco shreds to be tested. Specific descriptions may refer to the above-described descriptions of the relevant embodiments, which will not be repeated here.
[0076] In step 220, it is determined whether the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is greater than a preset threshold.
[0077] In some embodiments, the pixel ratio of the first tobacco to be tested in the first tobacco image and / or the pixel ratio of the second tobacco to be tested in the first tobacco image can be determined based on the ratio between the size of the pixels occupied by the corresponding tobacco to be tested in the first tobacco image and the total pixels of the first tobacco image.
[0078] For example, the total pixel of the first tobacco image is M, the size of the pixel occupied by the first tobacco to be tested in the first tobacco image is N1, and the size of the pixel occupied by the second tobacco to be tested in the first tobacco image is N2. The pixel ratio of the first tobacco to be tested in the first tobacco image can be n1=N1 / M, and the pixel ratio of the second tobacco to be tested in the first tobacco image can be n2=N2 / M. The difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image can be determined based on the difference between n1 and n2.
[0079] For example, if the difference between n1 and n2 is greater than a preset threshold, it can be determined that the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is large; if the difference between n1 and n2 is not greater than (i.e., less than or equal to) the preset threshold, it can be determined that the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is small.
[0080] In step 230, a first designated shredded tobacco is determined from the first shredded tobacco to be tested and the second shredded tobacco to be tested according to the result of the determination, the width of the first shredded tobacco to be tested and the width of the second shredded tobacco to be tested.
[0081] In some embodiments, it can be determined whether to correct the width of the first or second tobacco shreds to be tested based on the judgment result, and then determine the first designated tobacco shreds from the first or second tobacco shreds to be tested.
[0082] In the above embodiment, the first tobacco shred image may include multiple tobacco shreds to be tested with different pixel proportions. In this case, the first designated tobacco shred is determined from the multiple tobacco shreds to be tested according to the difference between the pixel proportions of the multiple tobacco shreds to be tested in the first tobacco shred image and the width of each tobacco shred to be tested. In this way, it is helpful to reduce the adverse effects of the quality problems of the collected tobacco shred image on the screening of the first designated tobacco shred, thereby further improving the accuracy of subsequent tobacco shred quality detection.
[0083] In some embodiments, in response to the judgment result that the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is not greater than a preset threshold, the first designated tobacco is determined from the first tobacco to be tested and the second tobacco to be tested based on the width of the first tobacco to be tested and the width of the second tobacco to be tested.
[0084] In this way, in response to the small difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image, the first designated tobacco can be determined from the first tobacco to be tested and the second tobacco to be tested based on the width of the first tobacco to be tested and the width of the second tobacco to be tested without performing other processing, thereby helping to improve the efficiency of tobacco quality detection.
[0085] In some embodiments, in response to the judgment result that the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is greater than a preset threshold, the width of the second tobacco to be tested is corrected according to the pixel ratio of the second tobacco to be tested in the first tobacco image. Thereafter, the first designated tobacco is determined from the first tobacco to be tested and the second tobacco to be tested according to the width of the first tobacco to be tested and the corrected width of the second tobacco to be tested.
[0086] For example, the first designated shredded tobacco corresponding to the first shredded tobacco image may be determined according to the difference between the width of the first shredded tobacco to be tested and the standard width, and the difference between the corrected width of the second shredded tobacco to be tested and the standard width.
[0087] In this way, in response to the large difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image, the width of the second tobacco to be tested can be corrected to reduce the error in width detection caused by uneven pixel ratios. This improves the accuracy of the first designated tobacco to be screened, and further improves the accuracy of subsequent tobacco quality detection.
[0088] In some embodiments, the width of the second tobacco to be tested can be corrected according to the pixel ratio of the second tobacco to be tested in the first tobacco image and the correction parameter. Here, the correction parameter can be determined based on the measured width of the reference tobacco detected online during the tobacco production process and the actual width of the reference tobacco detected offline after the tobacco production is completed.
[0089] For example, the measured width of the reference tobacco can be determined in a similar manner to the above-described determination of the width of each of the multiple tobaccos to be measured. For example, a tobacco image of the reference tobacco can be acquired, and the outline of the reference tobacco can be detected in the tobacco image of the reference tobacco to determine the size of the reference tobacco. The measured width of the reference tobacco is then determined based on the size of the reference tobacco.
[0090] In this way, the correction parameter can reflect the difference between the measured width of the tobacco shreds detected online and the actual width of the tobacco shreds. Based on this difference, the width of the second tobacco shreds to be tested is corrected, which can effectively reduce the error in width detection caused by uneven pixel proportions, thereby effectively improving the accuracy of the width of the second tobacco shreds to be tested after correction, and further improving the accuracy of the first designated tobacco shreds screened.
[0091] In some embodiments, the correction parameter is determined based on the ratio between the measured width of the reference tobacco and the actual width of the reference tobacco. For example, the measured width of the reference tobacco is L1, and the actual width of the reference tobacco is L2, and the correction parameter Q can be determined based on the ratio L1 / L2 between L1 and L2. In this way, the correction parameter can more accurately reflect the difference between the measured width of the tobacco detected online and the actual width of the tobacco, thereby achieving a more accurate correction of the width of the second tobacco to be measured.
[0092] In some embodiments, the width of the second tobacco to be tested may be corrected according to the product of the pixel ratio of the second tobacco to be tested in the first tobacco image and the correction parameter to obtain the corrected width of the second tobacco to be tested.
[0093] For example, the width of the second tobacco to be tested before correction determined in step 210 is r1, the pixel ratio of the second tobacco to be tested in the first tobacco image is n2, and the correction parameter Q is L1 / L2. The width r2 of the second tobacco to be tested after correction may be r1+n2×Q.
[0094] In this way, the amount of calculation required for the correction operation is less, thereby further reducing the detection cost on the basis of ensuring the accuracy of tobacco width correction.
[0095] It should be understood that in the present disclosure, the tobacco to be tested with a higher pixel ratio in the first tobacco image is schematically referred to as the first tobacco to be tested, and the tobacco to be tested with a lower pixel ratio in the first tobacco image is schematically referred to as the second tobacco to be tested. The number of the first tobacco to be tested or the second tobacco to be tested can be one or more.
[0096] In some embodiments, the first tobacco cut image may include a plurality of first tobacco cuts to be tested and a plurality of second tobacco cuts to be tested.
[0097] For example, a first tobacco shred to be tested with the highest pixel ratio can be determined from a plurality of first tobacco shreds to be tested, and a second tobacco shred to be tested with the lowest pixel ratio can be determined from a plurality of second tobacco shreds to be tested. It is determined whether the difference between the pixel ratio of the first tobacco shred to be tested in the first tobacco shred image and the pixel ratio of the second tobacco shred to be tested in the first tobacco shred image is greater than a preset threshold. Thereafter, based on the result of the determination, the widths of the plurality of first tobacco shreds to be tested, and the widths of the plurality of second tobacco shreds to be tested, a first designated tobacco shred is determined from the plurality of first tobacco shreds to be tested and the plurality of second tobacco shreds to be tested.
[0098] For example, in response to the judgment result that the difference is greater than a preset threshold, the width of each of the multiple second tobacco shreds to be tested can be corrected, and then based on the widths of the multiple first tobacco shreds to be tested and the corrected widths of the multiple second tobacco shreds to be tested, the first designated tobacco shreds can be determined from the multiple first tobacco shreds to be tested and the multiple second tobacco shreds to be tested.
[0099] Here, the judgment and the steps to be taken according to the judgment results can be as described above. Figure 2 The methods in the related steps shown are implemented similarly, and the specific instructions can be found in the previous text Figure 2 The related embodiments shown.
[0100] The technical solution of step 130 is exemplarily described below through some embodiments.
[0101] In some embodiments, the second designated tobacco cut piece may be determined according to the median of the widths of the plurality of first designated tobacco cut pieces.
[0102] For example, the number of the plurality of first designated tobacco shreds is K, where K is a positive integer.
[0103] In response to K being an odd number, the (K+1) / 2th first designated tobacco shreds arranged according to the width may be determined as the second designated tobacco shreds. Then, the quality of a corresponding batch of tobacco shreds is inspected according to the width of the second designated tobacco shreds, wherein the width of the second designated tobacco shreds is the width of the (K+1) / 2th first designated tobacco shreds.
[0104] In response to K being an even number, the K / 2th first designated tobacco shreds and the (K+1) / 2th first designated tobacco shreds arranged in width may be determined as the second designated tobacco shreds. Then, a corresponding batch of tobacco shreds is quality inspected according to the width of the second designated tobacco shreds, wherein the width of the second designated tobacco shreds is the average of the widths of the K / 2th first designated tobacco shreds and the (K+1) / 2th first designated tobacco shreds.
[0105] In this way, determining the second designated tobacco according to the median of the widths of multiple first designated tobacco shreds can ensure that the width of the second designated tobacco shreds can more accurately reflect the quality of a corresponding batch of tobacco shreds, thereby further improving the accuracy of tobacco quality detection.
[0106] Figure 3 A block diagram showing some embodiments of the detection device of the present disclosure.
[0107] like Figure 3 As shown, the detection device 300 includes a collection module 301 , a determination module 302 and a detection module 303 .
[0108] The acquisition module 301 may be configured to acquire multiple tobacco images of a batch of tobacco in the tobacco production process. Here, each of the multiple tobacco images includes multiple tobacco to be tested.
[0109] The determination module 302 may be configured to determine a first designated tobacco cut corresponding to each tobacco cut image from a plurality of tobacco cuts to be tested, and to determine a second designated tobacco cut corresponding to a batch of tobacco cuts from a plurality of first designated tobacco cuts corresponding to a plurality of tobacco cut images.
[0110] The detection module 303 may be configured to detect a batch of tobacco shreds according to the second designated tobacco shreds.
[0111] In some embodiments, the detection device 300 may further include executing the above Figure 1 to Figure 2 Other modules for other operations in the illustrated embodiments.
[0112] Figure 4 Block diagrams showing other embodiments of the detection device of the present disclosure.
[0113] like Figure 4As shown, the detection device 400 of this embodiment includes: a memory 401 and a processor 402 coupled to the memory 401 , and the processor 402 is configured to execute the detection method in any one embodiment of the present disclosure based on the instructions stored in the memory 401 .
[0114] The memory 401 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, a database, and other programs.
[0115] Figure 5 The following is a block diagram showing some further embodiments of the detection device of the present disclosure.
[0116] like Figure 5 As shown, the detection device 500 of this embodiment includes: a memory 501 and a processor 502 coupled to the memory 501 , and the processor 502 is configured to execute the detection method in any one of the aforementioned embodiments based on instructions stored in the memory 501 .
[0117] The memory 501 may include, for example, a system memory, a fixed non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs.
[0118] The electronic device 500 may also include an input / output interface 503, a network interface 504, a storage interface 505, etc. These interfaces 503, 504, 505, the memory 501, and the processor 502 may be connected, for example, via a bus 506. The input / output interface 503 provides a connection interface for input / output devices such as a display, a mouse, a keyboard, a touch screen, a microphone, and a speaker. The network interface 504 provides a connection interface for various networked devices. The storage interface 505 provides a connection interface for external storage devices such as an SD card and a USB flash drive.
[0119] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transient storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] So far, the technical solution of the detection method according to the present disclosure has been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed here.
[0121] The method and system of the present disclosure may be implemented in many ways. For example, the method and system of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0122] Although some specific embodiments of the present disclosure have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure.
Claims
1. A detection method comprising: Collecting a plurality of tobacco images of a batch of tobacco in a tobacco production process, each of the plurality of tobacco images including a plurality of tobacco to be tested; Determine a first designated tobacco cut corresponding to each tobacco cut image from the plurality of tobacco cuts to be tested; Determining second designated cut tobacco corresponding to the batch of cut tobacco from a plurality of first designated cut tobacco corresponding to the plurality of cut tobacco images; According to the width of the second designated tobacco shreds, quality inspection is performed on the batch of tobacco shreds.
2. The detection method according to claim 1, wherein: The step of determining the first designated tobacco corresponding to each tobacco image from the plurality of tobacco to be tested comprises: Determining the width of each of the plurality of tobacco shreds to be tested; According to the difference between the width of each of the tobacco shreds to be tested and the standard width, a first designated tobacco shred corresponding to each of the tobacco shred images is determined.
3. The detection method according to claim 2, wherein: Determining the width of each of the plurality of tobacco shreds to be tested comprises: In each of the tobacco shreds images, detecting the contour of each of the tobacco shreds to be tested to determine the size of each of the tobacco shreds to be tested; The width of each shredded tobacco to be tested is determined according to the size of each shredded tobacco to be tested.
4. The detection method according to claim 3, wherein: Determining the width of each of the shredded tobacco to be tested according to the size of each of the shredded tobacco to be tested comprises: The width of each tobacco shred to be tested is determined according to the size of each tobacco shred to be tested and a reference parameter, wherein the reference parameter is determined based on an actual width of a reference object and a size of the reference object in a reference image.
5. The detection method according to claim 4, wherein: The reference parameter is determined based on a ratio between an actual width of a reference object and a size of the reference object in the reference image.
6. The detection method according to claim 1, wherein: The multiple tobacco shred images include a first tobacco shred image, and the first tobacco shred image includes a first tobacco shred to be tested and a second tobacco shred to be tested; The step of determining the first designated tobacco corresponding to each tobacco image from the plurality of tobacco to be tested comprises: Determining the width of the first tobacco shred to be tested and the width of the second tobacco shred to be tested; Determine whether a difference between a pixel ratio of the first tobacco to be tested in the first tobacco image and a pixel ratio of the second tobacco to be tested in the first tobacco image is greater than a preset threshold; The first designated shredded tobacco is determined from the first shredded tobacco to be tested and the second shredded tobacco to be tested according to the result of the judgment, the width of the first shredded tobacco to be tested and the width of the second shredded tobacco to be tested.
7. The detection method according to claim 6, wherein: Determining the first designated tobacco shred from the first tobacco shred and the second tobacco shred according to the result of the judgment, the width of the first tobacco shred and the width of the second tobacco shred comprises: In response to the result of the judgment that the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is greater than the preset threshold, correcting the width of the second tobacco to be tested according to the pixel ratio of the second tobacco to be tested in the first tobacco image; The first designated shredded tobacco is determined from the first shredded tobacco to be tested and the second shredded tobacco to be tested according to the width of the first shredded tobacco to be tested and the corrected width of the second shredded tobacco to be tested.
8. The detection method according to claim 7, wherein: The step of correcting the width of the second shredded tobacco to be tested according to the pixel ratio of the second shredded tobacco to be tested in the first shredded tobacco image includes: The width of the second tobacco to be tested is corrected according to the pixel ratio of the second tobacco to be tested in the first tobacco image and the correction parameters, wherein the correction parameters are determined based on the measured width of the reference tobacco detected online during the tobacco production process and the actual width of the reference tobacco detected offline after the tobacco production is completed.
9. The detection method according to claim 8, wherein: The correction parameter is determined based on a ratio between a measured width of the reference tobacco shred and an actual width of the reference tobacco shred.
10. The detection method according to claim 6, wherein: Determining the first designated tobacco shred from the first tobacco shred and the second tobacco shred according to the result of the judgment, the width of the first tobacco shred and the width of the second tobacco shred comprises: In response to the judgment result that the difference between the pixel ratio of the first tobacco to be tested in the first tobacco image and the pixel ratio of the second tobacco to be tested in the first tobacco image is not greater than the preset threshold, the first designated tobacco is determined from the first tobacco to be tested and the second tobacco to be tested according to the width of the first tobacco to be tested and the width of the second tobacco to be tested.
11. The detection method according to any one of claims 1 to 10, wherein: The step of determining the second designated tobacco shreds corresponding to the batch of tobacco shreds from the plurality of first designated tobacco shreds corresponding to the plurality of tobacco shred images comprises: The second designated tobacco cut pieces are determined according to the median of the widths of the plurality of first designated tobacco cut pieces.
12. The detection method according to any one of claims 1 to 10, wherein: The detecting of the batch of tobacco shreds according to the width of the second designated tobacco shreds comprises: The quality of the batch of tobacco shreds is detected according to the difference between the width of the second designated tobacco shreds and the standard width.
13. A detection device, comprising: A collection module is configured to collect multiple tobacco images of a batch of tobacco in a tobacco production process, each of the multiple tobacco images including multiple tobacco to be tested; a determination module configured to determine a first designated tobacco shred corresponding to each tobacco shred image from the plurality of tobacco shreds to be tested, and to determine a second designated tobacco shred corresponding to the batch of tobacco shreds from the plurality of first designated tobacco shreds corresponding to the plurality of tobacco shred images; The detection module is configured to detect the batch of tobacco shreds according to the second designated tobacco shreds.
14. A detection device comprising: Memory; and A processor coupled to the memory, wherein the processor is configured to execute the detection method according to any one of claims 1 to 12 based on instructions stored in the memory.
15. A computer-readable storage medium having computer instructions stored thereon, wherein the instructions, when executed by a processor, implement the detection method according to any one of claims 1 to 12.
16. A computer program product comprising instructions, which, when executed by a processor, cause the processor to perform the detection method according to any one of claims 1 to 12.