CN115578371A - Detection method and device based on mildewed sundries before tobacco bale slicing - Google Patents

Detection method and device based on mildewed sundries before tobacco bale slicing Download PDF

Info

Publication number
CN115578371A
CN115578371A CN202211344292.1A CN202211344292A CN115578371A CN 115578371 A CN115578371 A CN 115578371A CN 202211344292 A CN202211344292 A CN 202211344292A CN 115578371 A CN115578371 A CN 115578371A
Authority
CN
China
Prior art keywords
tobacco leaf
image
training data
mildew
tobacco
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211344292.1A
Other languages
Chinese (zh)
Inventor
周萍芳
张思明
简著名
刘德强
张中武
张瑞琪
刘凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Tobacco Hubei Industrial LLC
Original Assignee
China Tobacco Hubei Industrial LLC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Tobacco Hubei Industrial LLC filed Critical China Tobacco Hubei Industrial LLC
Priority to CN202211344292.1A priority Critical patent/CN115578371A/en
Publication of CN115578371A publication Critical patent/CN115578371A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30128Food products

Abstract

The invention discloses a detection method and a device based on mildewed sundries before slicing of tobacco packets, wherein the method comprises the steps of obtaining a tobacco leaf sundry image, decomposing the processed tobacco leaf sundry image according to RGB color channels after carrying out mean value filtering on the tobacco leaf sundry image, and respectively carrying out single threshold segmentation on the tobacco leaf sundry image corresponding to each RGB color channel to obtain tobacco leaf sundry training data; obtaining a tobacco leaf mildew image, carrying out contrast enhancement processing on the tobacco leaf mildew image, and carrying out single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data; and constructing a detection model based on the tobacco sundry training data and the tobacco mildew training data, and processing a newly received tobacco image based on the detection model to generate a tobacco detection result. The method reduces the risk of missing reports of small-area mildewing or sundries, ensures the quality of the cigarette packet, and improves the detection efficiency and the accuracy.

Description

Detection method and device based on mildewed sundries before tobacco bale slicing
Technical Field
The application relates to the technical field of tobacco leaves, in particular to a detection method and device based on impurities mildewed before slicing of a tobacco bale.
Background
At present, the FT531 type unpacking system has 3 sets of CCD vision systems, which respectively detect the packing belt of a cigarette case, the paperboard on the upper surface of the cigarette case and the paperboard on the lower surface of the cigarette case, cannot monitor the mildew and the remnants on the surface (the paperboard, the plastic bag, the ribbon and the like falling to the side surface of the cigarette case), and has the quality hidden troubles of mildew and sundries.
Therefore, manual visual inspection of the cigarette packet is also needed, and the manual visual inspection mode has two problems: firstly, the six sides of the cigarette packet need to be mildewed and sundries need to be detected by a plurality of stations, and the manual consumption is high; secondly, the long-time work of manual work easily causes visual fatigue, increases to the risk of reporting of small area mildening and rot or debris.
Disclosure of Invention
In order to solve the above problems, the embodiment of the application provides a detection method and device based on mildewed impurities before slicing of a cigarette packet.
In a first aspect, an embodiment of the present application provides a method for detecting mildewed impurities before slicing cigarette packets, where the method includes:
acquiring a tobacco leaf impurity image, performing mean filtering processing on the tobacco leaf impurity image, decomposing the processed tobacco leaf impurity image according to RGB color channels, and performing single-threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel to obtain tobacco leaf impurity training data;
obtaining a tobacco leaf mildew image, performing contrast enhancement processing on the tobacco leaf mildew image, and performing single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data;
and constructing a detection model based on the tobacco sundry training data and the tobacco mildew training data, and processing a newly received tobacco image based on the detection model to generate a tobacco detection result.
Preferably, the decomposing the processed tobacco leaf impurity image according to RGB color channels, and performing single-threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel, respectively, to obtain tobacco leaf impurity training data includes:
decomposing the processed tobacco leaf impurity image based on RGB color channels to obtain an R channel image, a G channel image and a B channel image, wherein the RGB color channels comprise an R channel, a G channel and a B channel;
and respectively carrying out single-threshold segmentation on the R channel image, the G channel image and the B channel image, and extracting first characteristic data with an area value smaller than a first preset threshold, wherein the first characteristic data is the tobacco leaf impurity training data.
Preferably, the method further comprises:
converting the R channel image, the G channel image and the B channel image into an HSI channel image;
and performing single threshold segmentation on the HSI channel image, extracting second characteristic data with an area value smaller than a second preset threshold value, and adding the second characteristic data to the tobacco leaf sundry training data.
Preferably, the performing single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data includes:
and performing single-threshold segmentation on the processed tobacco leaf mildew image, and extracting third characteristic data with an area value smaller than a third preset threshold, wherein the third characteristic data is tobacco leaf mildew training data.
Preferably, the detection model comprises a first detection model and a second detection model;
the method for constructing the detection model based on the tobacco leaf sundry training data and the tobacco leaf mildew training data comprises the following steps:
acquiring a training image, slicing the training image, labeling and training the sliced training image based on the tobacco sundry training data and the tobacco mildew training data, and constructing the first detection model;
and performing semantic segmentation on the training image based on the tobacco leaf sundry training data and the tobacco leaf mildew training data, labeling the training image, and training to construct the second detection model.
Preferably, the processing the newly received tobacco leaf image based on the detection model to generate the tobacco leaf detection result includes:
slicing a newly received tobacco leaf image, and importing the sliced tobacco leaf image into the first detection model to obtain a first judgment result;
importing the tobacco leaf image into the second detection model to obtain a second judgment result;
and generating a tobacco leaf detection result based on the first judgment result and the second judgment result.
In a second aspect, an embodiment of the present application provides a detection device based on before tobacco bale slicing mildews sundries, the device includes:
the first acquisition module is used for acquiring a tobacco leaf impurity image, decomposing the processed tobacco leaf impurity image according to RGB color channels after mean filtering processing is carried out on the tobacco leaf impurity image, and respectively carrying out single-threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel to obtain tobacco leaf impurity training data;
the second acquisition module is used for acquiring a tobacco leaf mildew image, performing contrast enhancement processing on the tobacco leaf mildew image, and performing single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data;
and the detection module is used for constructing a detection model based on the tobacco sundry training data and the tobacco mildew training data, processing a newly received tobacco image based on the detection model and generating a tobacco detection result.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method as provided in the first aspect or any one of the possible implementation manners of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method as provided in the first aspect or any one of the possible implementations of the first aspect.
The invention has the beneficial effects that: the tobacco bale is detected by respectively processing the obtained tobacco leaf sundry training data and the tobacco leaf mildewing training data to construct a detection model, so that the risk of missing reports of small-area mildewing or sundries is reduced, the quality of the tobacco bale is ensured, and the detection efficiency and accuracy are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flow chart of a detection method based on mildewed impurities before slicing cigarette packets according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a detection device based on mildewed impurities before slicing of cigarette packets according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In the following description, the terms "first" and "second" are used for descriptive purposes only and are not intended to indicate or imply relative importance. The following description provides embodiments of the present application, where different embodiments may be substituted or combined, and thus the present application is intended to include all possible combinations of the same and/or different embodiments described. Thus, if one embodiment includes features a, B, C and another embodiment includes features B, D, this application should also be construed as including embodiments that include all other possible combinations of one or more of a, B, C, D, although such embodiments may not be explicitly recited in the following text.
The following description provides examples, and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made in the function and arrangement of elements described without departing from the scope of the disclosure. Various examples may omit, substitute, or add various procedures or components as appropriate. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
Referring to fig. 1, fig. 1 is a schematic flow chart of a detection method based on mildewed impurities before slicing cigarette packets according to an embodiment of the present application. In an embodiment of the present application, the method includes:
s101, obtaining a tobacco leaf impurity image, performing mean filtering processing on the tobacco leaf impurity image, decomposing the processed tobacco leaf impurity image according to RGB color channels, and performing single-threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel to obtain tobacco leaf impurity training data.
The execution main body of the application can be a cloud server.
In this application embodiment, in order to detect debris and mildew in the tobacco leaves, the cloud server needs to construct a detection model for detecting the debris and the mildew in the tobacco leaf images. For this purpose, first, the tobacco leaf sundry image and the tobacco leaf mildew image used for training the model need to be processed separately, wherein the tobacco leaf sundry image and the tobacco leaf mildew image may be selected from historical data for determination.
For the tobacco leaf impurity image, firstly, preprocessing of mean filtering is needed. The mean filtering is to linearly smooth gray values of all input images (images). The filter matrix consists of 1 (compute equal) and a size Mask Height Mask Width. The result of the convolution is divided by the mask height x mask width. For boundary processing, the gray values are reflected to the image edges. The pixel value of any point in the average filtering is the average value of the surrounding N/times M pixels.
In order to better identify and respectively identify impurities, the preprocessed tobacco impurity images are decomposed according to RGB color channels to obtain images of each color channel, and then the images of each color channel are respectively segmented according to a single threshold value to determine tobacco impurity training data for training.
In an implementation manner, the decomposing the processed tobacco leaf impurity image according to RGB color channels, and performing single-threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel, respectively, to obtain tobacco leaf impurity training data includes:
decomposing the processed tobacco leaf impurity image based on RGB color channels to obtain an R channel image, a G channel image and a B channel image, wherein the RGB color channels comprise an R channel, a G channel and a B channel;
and respectively carrying out single-threshold segmentation on the R channel image, the G channel image and the B channel image, and extracting first characteristic data with an area value smaller than a first preset threshold, wherein the first characteristic data is the tobacco leaf impurity training data.
In the embodiment of the application, the preprocessed tobacco leaf impurity images are decomposed according to RGB color channels, an R channel image, a G channel image and a B channel image are obtained, then feature segmentation is carried out on the images in each channel according to a first preset threshold value according to the area size, and first feature data corresponding to impurities are extracted.
In one embodiment, the method further comprises:
converting the R channel image, the G channel image and the B channel image into an HSI channel image;
and performing single threshold segmentation on the HSI channel image, extracting second characteristic data with an area value smaller than a second preset threshold value, and adding the second characteristic data to the tobacco leaf sundry training data.
In the embodiment of the present application, the image of three RGB color channels is also converted into an HSI channel image, so that a second feature data extraction process of single-threshold segmentation is also performed on the HSI channel image. Finally, segmenting the R channel image through a threshold value, and extracting reddish impurities; segmenting the G channel image by using a threshold value, and extracting greenish impurities; segmenting the B channel image by using a threshold value, and extracting blue impurities; and (4) threshold segmentation is carried out on the S channel image of the HIS, and sundries with high saturation are extracted. In addition, the image can be filtered through an SG filter, and the problem that the red reflective tobacco leaves are prone to false alarm is solved by adopting an SG differential image.
S102, obtaining a tobacco leaf mildew image, performing contrast enhancement processing on the tobacco leaf mildew image, and performing single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data.
In the embodiment of the application, the mildew in the tobacco leaves is not easily distinguished as impurities, so the tobacco leaf mildew image is firstly preprocessed in a contrast-enhanced mode to enhance high-frequency areas (edges and corners) of the image, and the process can be filtered by using low pass (mean _ image). The contrast-enhancing gray value (res) calculated from the filtered gray value (mean) and the original gray value (orig) is as follows:
res:=round((orig - mean)*Favctor + orig
after the preprocessing of enhancing the contrast is completed, single threshold segmentation is carried out on the processed image, so that tobacco leaf mildew training data for mildew identification training are obtained.
In an implementation manner, the performing single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data includes:
and performing single-threshold segmentation on the processed tobacco leaf mildew image, and extracting third characteristic data with an area value smaller than a third preset threshold, wherein the third characteristic data is tobacco leaf mildew training data.
In the embodiment of the application, for the preprocessed tobacco leaf mildew images, the mildew parts and the normal parts can be well distinguished, so that the images can be subjected to single threshold segmentation, and the third characteristic data which is smaller in area and corresponds to the mildew parts is extracted according to the area to serve as tobacco leaf mildew training data.
The first preset threshold, the second preset threshold and the third preset threshold may be set to the same value or different values.
S103, constructing a detection model based on the tobacco leaf sundry training data and the tobacco leaf mildew training data, and processing a newly received tobacco leaf image based on the detection model to generate a tobacco leaf detection result.
In the embodiment of the application, the detection model can be trained and constructed through the tobacco sundry training data and the tobacco mildew training data. When a tobacco leaf image needing sundries and mildew identification is newly received, the tobacco leaf image is processed through the detection model, and a tobacco leaf detection result can be generated. The detection model can be a neural convolution network model and comprises an input layer, a hidden layer, a full connection layer and an output layer, wherein the input layer is used for inputting the tobacco leaf image.
In one possible embodiment, the detection model includes a first detection model and a second detection model;
the method for constructing the detection model based on the tobacco leaf sundry training data and the tobacco leaf mildew training data comprises the following steps:
acquiring a training image, slicing the training image, labeling and training the sliced training image based on the tobacco sundry training data and the tobacco mildew training data, and constructing the first detection model;
and performing semantic segmentation on the training image based on the tobacco leaf sundry training data and the tobacco leaf mildewing training data, labeling the training image, and training to construct the second detection model.
In the embodiment of the application, in consideration of the fact that the situation that sundry features are obvious and the situation that mildewing features are not obvious possibly exist in the tobacco leaf image in the actual situation, in order to conduct identification more efficiently, a first detection model and a second detection model are trained, and cascade detection is achieved through the first detection model and the second detection model. Specifically, the training process of the first detection model includes first slicing 64 × 64 training images (which may be adjusted by a classification network), marking and classifying the sliced images according to the features in the two types of training data (normal, mildew, and defect), inputting the training data, and outputting the model. The second detection model directly labels and trains the image through a traditional semantic segmentation algorithm, and the model is output.
In an implementation manner, the processing the newly received tobacco leaf image based on the detection model to generate the tobacco leaf detection result includes:
slicing a newly received tobacco leaf image, and importing the sliced tobacco leaf image into the first detection model to obtain a first judgment result;
importing the tobacco leaf image into the second detection model to obtain a second judgment result;
and generating a tobacco leaf detection result based on the first judgment result and the second judgment result.
In the embodiment of the application, for a newly received tobacco leaf image, the first detection model and the second detection model are used for detection respectively, so as to obtain a first judgment result and a second judgment result. And integrating the first judgment result and the second judgment result to comprehensively generate a tobacco leaf detection result so as to represent whether impurities and mildew exist in the tobacco leaf image.
The following describes in detail a detection device based on mold impurities before slicing cigarette packets according to an embodiment of the present application, with reference to fig. 2. It should be noted that, the detection device based on the mold sundries before slicing cigarette packets shown in fig. 2 is used for executing the method of the embodiment shown in fig. 1 of the present application, for convenience of description, only the parts related to the embodiment of the present application are shown, and details of the specific technology are not disclosed, please refer to the embodiment shown in fig. 1 of the present application.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a detection device based on mildewed impurities before slicing cigarette packets according to an embodiment of the present application. As shown in fig. 2, the apparatus includes:
the first obtaining module 201 is configured to obtain a tobacco leaf impurity image, perform mean filtering on the tobacco leaf impurity image, decompose the processed tobacco leaf impurity image according to RGB color channels, and perform single-threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel, to obtain tobacco leaf impurity training data;
the second obtaining module 202 is configured to obtain a tobacco leaf mildew image, perform contrast enhancement on the tobacco leaf mildew image, and perform single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data;
and the detection module 203 is used for constructing a detection model based on the tobacco leaf sundry training data and the tobacco leaf mildewing training data, processing a newly received tobacco leaf image based on the detection model and generating a tobacco leaf detection result.
In one implementation, the first obtaining module 201 includes:
the decomposition unit is used for decomposing the processed tobacco leaf impurity images based on RGB color channels to obtain R channel images, G channel images and B channel images, wherein the RGB color channels comprise R channels, G channels and B channels;
and the first extraction unit is used for performing single-threshold segmentation on the R channel image, the G channel image and the B channel image respectively, and extracting first characteristic data with an area value smaller than a first preset threshold, wherein the first characteristic data is the tobacco leaf sundry training data.
In one embodiment, the apparatus further comprises:
the conversion module is used for converting the R channel image, the G channel image and the B channel image into an HSI channel image;
and the extraction module is used for performing single threshold segmentation on the HSI channel image, extracting second characteristic data with an area value smaller than a second preset threshold value, and adding the second characteristic data to the tobacco leaf sundry training data.
In one implementation, the second obtaining module 202 includes:
and the second extraction unit is used for performing single-threshold segmentation on the processed tobacco leaf mildew image, and extracting third characteristic data with an area value smaller than a third preset threshold, wherein the third characteristic data is tobacco leaf mildew training data.
In one possible implementation, the detection module 203 includes:
the first construction unit is used for obtaining a training image, slicing the training image, labeling and training the sliced training image based on the tobacco sundry training data and the tobacco mildew training data, and constructing the first detection model;
and the second construction unit is used for performing semantic segmentation on the training image based on the tobacco leaf sundry training data and the tobacco leaf mildewing training data, labeling the training image, and training and constructing the second detection model.
In one possible embodiment, the detection module 203 further comprises:
the first judgment unit is used for slicing the newly received tobacco leaf image, and guiding the sliced tobacco leaf image into the first detection model to obtain a first judgment result;
the second judgment unit is used for importing the tobacco leaf image into the second detection model to obtain a second judgment result;
and the generating unit is used for generating a tobacco leaf detection result based on the first judgment result and the second judgment result.
It is clear to a person skilled in the art that the solution according to the embodiments of the present application can be implemented by means of software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, where the hardware may be, for example, a Field-Programmable Gate Array (FPGA), an Integrated Circuit (IC), or the like.
Each processing unit and/or module in the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.
Referring to fig. 3, a schematic structural diagram of an electronic device according to an embodiment of the present application is shown, where the electronic device may be used to implement the method in the embodiment shown in fig. 1. As shown in fig. 3, the electronic device 300 may include: at least one central processor 301, at least one network interface 304, a user interface 303, a memory 305, at least one communication bus 302.
Wherein a communication bus 302 is used to enable the connection communication between these components.
The user interface 303 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 303 may further include a standard wired interface and a wireless interface.
The network interface 304 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
The central processor 301 may include one or more processing cores. The central processor 301 connects various parts within the entire electronic device 300 using various interfaces and lines, and performs various functions of the terminal 300 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 305, and calling data stored in the memory 305. Alternatively, the central Processing unit 301 may be implemented in at least one hardware form of Digital Signal Processing (DSP), field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The CPU 301 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the cpu 301, but may be implemented by a single chip.
The Memory 305 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable medium. The memory 305 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 305 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 305 may alternatively be at least one storage device located remotely from the central processor 301. As shown in fig. 3, memory 305, which is a type of computer storage medium, may include an operating system, a network communication module, a user interface module, and program instructions.
In the electronic device 300 shown in fig. 3, the user interface 303 is mainly used for providing an input interface for a user to obtain data input by the user; the central processing unit 301 may be configured to call the detection application program stored in the memory 305 and based on the moldy sundries before slicing the cigarette packets, and specifically perform the following operations:
acquiring a tobacco leaf impurity image, performing mean filtering processing on the tobacco leaf impurity image, decomposing the processed tobacco leaf impurity image according to RGB color channels, and performing single threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel respectively to obtain tobacco leaf impurity training data;
obtaining a tobacco leaf mildew image, performing contrast enhancement processing on the tobacco leaf mildew image, and performing single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data;
and constructing a detection model based on the tobacco leaf sundry training data and the tobacco leaf mildew training data, and processing a newly received tobacco leaf image based on the detection model to generate a tobacco leaf detection result.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, carries out the steps of the above-mentioned method. The computer-readable storage medium may include, but is not limited to, any type of disk including floppy disks, optical disks, DVDs, CD-ROMs, microdrive, and magneto-optical disks, ROMs, RAMs, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs), or any type of media or device suitable for storing instructions and/or data.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some service interfaces, devices or units, and may be an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program, which is stored in a computer-readable memory, and the memory may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The above description is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure should not be limited thereby. That is, all equivalent changes and modifications made in accordance with the teachings of the present disclosure are intended to be included within the scope of the present disclosure. Embodiments of the present disclosure will be readily apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (9)

1. A detection method for mildewed sundries before slicing based on cigarette packets is characterized by comprising the following steps:
acquiring a tobacco leaf impurity image, performing mean filtering processing on the tobacco leaf impurity image, decomposing the processed tobacco leaf impurity image according to RGB color channels, and performing single-threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel to obtain tobacco leaf impurity training data;
acquiring a tobacco leaf mildew image, performing contrast enhancement processing on the tobacco leaf mildew image, and performing single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data;
and constructing a detection model based on the tobacco sundry training data and the tobacco mildew training data, and processing a newly received tobacco image based on the detection model to generate a tobacco detection result.
2. The method according to claim 1, wherein the decomposing the processed tobacco leaf impurity images according to RGB color channels and performing single threshold segmentation on the tobacco leaf impurity images corresponding to the RGB color channels respectively to obtain tobacco leaf impurity training data comprises:
decomposing the processed tobacco leaf sundry image based on RGB color channels to obtain an R channel image, a G channel image and a B channel image, wherein the RGB color channels comprise an R channel, a G channel and a B channel;
and respectively carrying out single threshold segmentation on the R channel image, the G channel image and the B channel image, and extracting first characteristic data with an area value smaller than a first preset threshold, wherein the first characteristic data is the tobacco leaf sundry training data.
3. The method of claim 2, further comprising:
converting the R channel image, the G channel image and the B channel image into an HSI channel image;
and performing single threshold segmentation on the HSI channel image, extracting second characteristic data with an area value smaller than a second preset threshold value, and adding the second characteristic data to the tobacco leaf sundry training data.
4. The method according to claim 1, wherein the performing of the single threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data comprises:
and performing single threshold segmentation on the processed tobacco leaf mildew image, and extracting third characteristic data with an area value smaller than a third preset threshold, wherein the third characteristic data is tobacco leaf mildew training data.
5. The method of claim 1, wherein the detection model comprises a first detection model and a second detection model;
the method for constructing the detection model based on the tobacco leaf sundry training data and the tobacco leaf mildew training data comprises the following steps:
acquiring a training image, slicing the training image, labeling and training the sliced training image based on the tobacco leaf sundry training data and the tobacco leaf mildew training data, and constructing the first detection model;
and performing semantic segmentation on the training image based on the tobacco leaf sundry training data and the tobacco leaf mildew training data, labeling the training image, and training to construct the second detection model.
6. The method of claim 5, wherein processing the newly received tobacco image based on the detection model to generate a tobacco detection result comprises:
slicing a newly received tobacco leaf image, and importing the sliced tobacco leaf image into the first detection model to obtain a first judgment result;
importing the tobacco leaf image into the second detection model to obtain a second judgment result;
and generating a tobacco leaf detection result based on the first judgment result and the second judgment result.
7. The utility model provides a detection device based on tobacco bale before section mildenes and rot debris which characterized in that, the device includes:
the first acquisition module is used for acquiring a tobacco leaf impurity image, decomposing the processed tobacco leaf impurity image according to RGB color channels after mean filtering processing is carried out on the tobacco leaf impurity image, and respectively carrying out single-threshold segmentation on the tobacco leaf impurity image corresponding to each RGB color channel to obtain tobacco leaf impurity training data;
the second acquisition module is used for acquiring a tobacco leaf mildew image, performing contrast enhancement processing on the tobacco leaf mildew image, and performing single-threshold segmentation on the processed tobacco leaf mildew image to obtain tobacco leaf mildew training data;
and the detection module is used for constructing a detection model based on the tobacco leaf sundry training data and the tobacco leaf mildewing training data, processing a newly received tobacco leaf image based on the detection model and generating a tobacco leaf detection result.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1-6 are implemented when the computer program is executed by the processor.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202211344292.1A 2022-10-31 2022-10-31 Detection method and device based on mildewed sundries before tobacco bale slicing Pending CN115578371A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211344292.1A CN115578371A (en) 2022-10-31 2022-10-31 Detection method and device based on mildewed sundries before tobacco bale slicing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211344292.1A CN115578371A (en) 2022-10-31 2022-10-31 Detection method and device based on mildewed sundries before tobacco bale slicing

Publications (1)

Publication Number Publication Date
CN115578371A true CN115578371A (en) 2023-01-06

Family

ID=84589030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211344292.1A Pending CN115578371A (en) 2022-10-31 2022-10-31 Detection method and device based on mildewed sundries before tobacco bale slicing

Country Status (1)

Country Link
CN (1) CN115578371A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117274986A (en) * 2023-09-22 2023-12-22 陕西省食品药品检验研究院 Medicine and food homologous Chinese medicinal material mildew identification method, device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117274986A (en) * 2023-09-22 2023-12-22 陕西省食品药品检验研究院 Medicine and food homologous Chinese medicinal material mildew identification method, device and storage medium
CN117274986B (en) * 2023-09-22 2024-04-05 陕西省食品药品检验研究院 Medicine and food homologous Chinese medicinal material mildew identification method, device and storage medium

Similar Documents

Publication Publication Date Title
US8515164B2 (en) Non-product image identification
WO2020177470A1 (en) Verification code recognition method and apparatus, terminal, and storage medium
CN110399842B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN107943811B (en) Content publishing method and device
CN115578371A (en) Detection method and device based on mildewed sundries before tobacco bale slicing
CN113554008B (en) Method and device for detecting static object in area, electronic equipment and storage medium
JP2013105245A (en) Image processing method, device and program
CN110909674B (en) Traffic sign recognition method, device, equipment and storage medium
CN112035821A (en) Method and device for identifying graphic verification code, computer equipment and storage medium
CN113963162A (en) Helmet wearing identification method and device, computer equipment and storage medium
CN114120307A (en) Display content identification method, device, equipment and storage medium
CN116434346B (en) Method and device for detecting customer behaviors in unattended store and storage medium
CN110598575B (en) Form layout analysis and extraction method and related device
CN109151574B (en) Video processing method, video processing device, electronic equipment and storage medium
CN111383054A (en) Advertisement checking method and device
CN113221742B (en) Video split screen line determining method, device, electronic equipment, medium and program product
CN112634382B (en) Method and device for identifying and replacing images of unnatural objects
CN110889470A (en) Method and apparatus for processing image
CN111797922B (en) Text image classification method and device
CN114926429A (en) Method, device and equipment for detecting trace length and readable storage medium
CN114677319A (en) Stem cell distribution determination method and device, electronic equipment and storage medium
CN114241354A (en) Warehouse personnel behavior identification method and device, computer equipment and storage medium
CN110879733B (en) Detection method, device, terminal and computer readable storage medium for electronic red envelope
CN114330400A (en) Two-dimensional code image processing method, system, device, electronic equipment and storage medium
CN111882536A (en) Method for monitoring quantity of bulk cargo based on picture comparison

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination