CN112465753B - Pollen particle detection method and device and electronic equipment - Google Patents
Pollen particle detection method and device and electronic equipment Download PDFInfo
- Publication number
- CN112465753B CN112465753B CN202011280263.4A CN202011280263A CN112465753B CN 112465753 B CN112465753 B CN 112465753B CN 202011280263 A CN202011280263 A CN 202011280263A CN 112465753 B CN112465753 B CN 112465753B
- Authority
- CN
- China
- Prior art keywords
- image
- pollen
- channel
- pixel points
- particles
- 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.)
- Active
Links
- 239000002245 particle Substances 0.000 title claims abstract description 137
- 238000001514 detection method Methods 0.000 title claims abstract description 99
- 238000000034 method Methods 0.000 claims abstract description 25
- 238000012549 training Methods 0.000 claims abstract description 10
- 238000012545 processing Methods 0.000 claims description 20
- 238000004422 calculation algorithm Methods 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 7
- 238000003064 k means clustering Methods 0.000 claims description 7
- 230000000694 effects Effects 0.000 abstract description 8
- 238000004891 communication Methods 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 239000003086 colorant Substances 0.000 description 2
- 238000004043 dyeing Methods 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000006740 morphological transformation Effects 0.000 description 2
- 238000012952 Resampling Methods 0.000 description 1
- 241000519995 Stachys sylvatica Species 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01N—INVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
- G01N15/00—Investigating characteristics of particles; Investigating permeability, pore-volume or surface-area of porous materials
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10056—Microscopic image
- G06T2207/10061—Microscopic image from scanning electron microscope
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30181—Earth observation
- G06T2207/30188—Vegetation; Agriculture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/07—Target detection
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Chemical & Material Sciences (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Computational Biology (AREA)
- Dispersion Chemistry (AREA)
- Quality & Reliability (AREA)
- Probability & Statistics with Applications (AREA)
- Health & Medical Sciences (AREA)
- Analytical Chemistry (AREA)
- Biochemistry (AREA)
- General Health & Medical Sciences (AREA)
- Immunology (AREA)
- Pathology (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a pollen particle detection method, a pollen particle detection device and electronic equipment, wherein the method acquires an image comprising pollen particles; taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles to obtain an image to be identified; inputting an image to be identified into a target detection model, and outputting a pollen particle detection result; the target detection model is obtained after supervision training is carried out on the basis of a sample image of the pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one. Through classifying the pixel points of the image containing the pollen particles, the image background is well distinguished from the pollen particles, and the problem that the transparent bubbles with similar textures, sizes and shapes with the pollen particles are mistakenly detected as pollen by the target detection model is avoided, so that the detection effect of the target detection model is improved.
Description
Technical Field
The present invention relates to the field of image detection technologies, and in particular, to a pollen particle detection method and apparatus, and an electronic device.
Background
The SSD (Single Shot MultiBox Detector, single stage object detection) model is a single stage detection model, which discretizes the output space of a binding box into a series of default boxes of different aspect ratios, and can adjust the boxes to better match the shape of an object. The SSD combines prediction results on the feature maps with different resolutions, and solves the problem of different sizes of objects. SSD is simpler than the method requiring object proposal because it eliminates the process of generating proposal and subsequent pixel or feature resampling altogether, it encapsulates all the computation in a single network, which makes the model easy to train.
The SSD model has good accuracy in COCO data sets and VOC data as a generic target detection model. However, under the optical microscope pollen dataset, there are many transparent bubbles in the image that are similar to pollen size, shape, texture, edges. Even if the dyed pollen and the air bubbles have obvious difference in color, the SSD model still can easily misdetect the transparent air bubbles as pollen, the pollen detection precision is reduced, the detected pollen quantity is directly caused to be larger, and the calculation of the pollen density is greatly influenced finally.
Disclosure of Invention
Aiming at the technical problems in the prior art, the invention provides a pollen particle detection method, a pollen particle detection device and electronic equipment.
In a first aspect, the present invention provides a pollen grain detection method, comprising:
Acquiring an image including pollen grains;
Taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles to obtain an image to be identified;
inputting the image to be identified into a target detection model, and outputting a pollen particle detection result;
The target detection model is obtained after supervision training is carried out on the basis of a sample image of a pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one.
Optionally, the classifying the pixel points in the image including pollen grains by using the median of RGB values of all the pixel points in the image including pollen grains as the image feature, to obtain an image to be identified includes:
taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles, and obtaining a classified image;
Converting the classified image into an HSV image, and performing binarization processing on the HSV image to obtain a binary image;
And acquiring an image to be identified based on the image containing pollen particles and the binary image.
Optionally, the classifying the pixel points in the image including pollen grains with the median of RGB values of all the pixel points in the image including pollen grains as the image feature, to obtain a classified image includes:
Taking the median of RGB values of all pixel points in the image containing pollen grains as an image characteristic, classifying the pixel points in the image containing pollen grains based on a K-Means clustering algorithm, and obtaining a classified image.
Optionally, the binarizing processing is performed on the HSV image to obtain a binary image, including:
and calculating the pixel value of each pixel point in the binary image based on the color intervals of the H channel, the S channel and the V channel.
Optionally, calculating the pixel value of each pixel point in the binary image based on the color intervals of the H channel, the S channel and the V channel specifically includes:
dst=Hmin≤src(H)Hmax∩Smin≤src(S)Smax∩Vmin≤src(V)Vmax;
Wherein dst is a pixel value of each pixel point in the binary image, and H min、Smin and V min are minimum values of an H channel, an S channel and a V channel respectively; h max、Smax and V max are the maximum values of H channel, S channel and V channel, respectively.
Optionally, the converting the classified image into an HSV image, and performing binarization processing on the HSV image, to obtain a binary image, further includes:
denoising the binary image;
the method further comprises the steps of after acquiring the image to be identified based on the image including pollen particles and the binary image:
The black background of the image to be identified is filled with the RGB average of the sample image of the pollen grain sample.
Optionally, the object detection model is an SSD (Single Shot MultiBox Detector, single-stage object detection) model.
In a second aspect, the present invention provides a pollen grain detection device comprising:
the acquisition module is used for acquiring an image comprising pollen particles;
The processing module is used for classifying the pixel points in the image containing the pollen particles by taking the median of RGB values of all the pixel points in the image containing the pollen particles as an image characteristic to obtain an image to be identified;
The input module is used for inputting the image to be identified into a target detection model;
The output module is used for outputting pollen particle detection results;
The target detection model is obtained after supervision training is carried out on the basis of a sample image of a pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one.
In a third aspect, the invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method as provided in the first aspect when the program is executed.
In a fourth aspect, the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method as provided in the first aspect.
According to the pollen particle detection method, the pollen particle detection device and the electronic equipment, before the image containing the pollen particles is input into the target detection model for detection, the image containing the pollen particles is subjected to pixel point classification pretreatment, the image background is well distinguished from the pollen particles, the problem that transparent bubbles with similar textures, sizes and shapes with the pollen particles are mistakenly detected as pollen by the target detection model is avoided, and therefore the detection effect of the target detection model is improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a pollen grain detection method provided by the invention;
FIG. 2 is a classified image provided by the present invention;
FIG. 3 is an HSV image provided by the present invention;
FIG. 4 is a binary image provided by the present invention;
FIG. 5 is a mask image provided by the present invention;
FIG. 6 is a calculated image provided by the present invention;
FIG. 7 is a schematic structural view of the pollen grain detecting device provided by the invention;
Fig. 8 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Under the pollen dataset of the light microscope, there are many transparent bubbles in the image that are similar to pollen size, shape, texture, edges. Even though the dyed pollen and air bubbles have a significant difference in color, the SSD model still easily misdetects transparent air bubbles as pollen. Meanwhile, due to excessive dyeing of some pictures, the background of the pictures is light pink, so that the SSD model can filter the background color during detection, the background is mistakenly detected as pollen, and the accuracy rate of pollen detection is reduced.
In this regard, the invention provides a pollen particle detection method. Fig. 1 is a schematic flow chart of a pollen particle detection method according to the present invention, as shown in fig. 1, the method includes:
S101: an image including pollen grains is acquired.
Specifically, for the image including pollen particles, the background of the picture is light pink, the pollen is more deeply dyed and dark pink is shown due to excessive dyeing of some pictures; the background of the undyed picture is light gray, the color of the background is different from the color of pollen in the gray image, and a plurality of transparent bubbles similar to the size, shape, texture and edge of the pollen are also present in the image.
S102: and taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, and classifying the pixel points in the image containing pollen particles to obtain an image to be identified.
Specifically, since the background color is the color with the largest occurrence number in the image including pollen particles, the median of RGB values of all pixels in the image including pollen particles can represent the characteristic of the background color, the median of RGB values of all pixels in the image including pollen particles is taken as the image characteristic, the pixels in the image including pollen particles are classified, each pixel in the image including pollen particles is classified into two types, one of which is the background, the other is pollen particles, and the classified image is taken as the image to be identified.
S103: inputting the image to be identified into a target detection model, and outputting a pollen particle detection result;
The target detection model is obtained after supervision training is carried out on the basis of a sample image of a pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one.
Specifically, since the image to be identified uses the median of RGB values of all pixel points in the image including pollen particles as an image feature, the pixel points in the image including pollen particles are classified to obtain an image, so that the background, air bubbles and pollen particles are distinguished, and the image to be identified is input into a target detection model for pollen particle detection. The target detection model is obtained after supervision training is carried out on the basis of a sample image of the pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one.
According to the method provided by the invention, before the image comprising the pollen particles is input into the target detection model for detection, the image comprising the pollen particles is subjected to the pretreatment of pixel point classification, so that the image background is well distinguished from the pollen particles, the problem that the target detection model misdetects transparent bubbles with similar textures, sizes and shapes as the pollen particles is avoided, and the detection effect of the target detection model is improved.
Based on the above embodiment, the classifying the pixel points in the image including pollen grains to obtain the image to be identified using the median of RGB values of all the pixel points in the image including pollen grains as the image feature includes:
taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles, and obtaining a classified image;
and converting the classified image into an HSV image, and performing binarization processing on the HSV image to obtain a binary image.
Specifically, as the classified images are RGB images, the RGB channels can not well reflect specific color information of objects, and compared with the RGB space, the HSV space can intuitively express brightness, hue and vividness of colors and is convenient for comparison among colors, so that the classified images are converted into HSV images; further, in order to facilitate extraction of pollen grain information in the image, thereby increasing recognition efficiency, the HSV image is subjected to binarization processing to obtain a binary image.
And acquiring an image to be identified based on the image containing pollen particles and the binary image.
Specifically, the image including pollen particles and the binary image are subjected to bit AND calculation to obtain an image to be identified.
According to the method provided by the invention, the classified image is converted into the HSV image, the specific color information in the image is better reflected, and the HSV image is subjected to binarization processing, so that pollen particle information in the image is conveniently extracted, and the identification efficiency is improved.
Based on any one of the above embodiments, the classifying the pixel points in the image including pollen grains with the median of RGB values of all the pixel points in the image including pollen grains as the image feature, to obtain a classified image includes:
Taking the median of RGB values of all pixel points in the image containing pollen grains as an image characteristic, classifying the pixel points in the image containing pollen grains based on a K-Means clustering algorithm, and obtaining a classified image.
Specifically, as some pictures are excessively dyed, the picture backgrounds are light pink, and most of the picture backgrounds are gray, which has more strict requirements on a preset pollen color filtering interval, a K-Means clustering algorithm is adopted, the median of RGB values of all pixel points in the image including pollen particles is used as an image characteristic, and K-Means clustering is carried out on the pixel points in the image including pollen particles to achieve a classification effect, so that the background color is prevented from being filtered, and color filtering is better completed.
Alternatively, any clustering algorithm in the prior art may be used, which is not specifically limited in the embodiments of the present invention.
According to the method provided by the invention, the median of RGB values of all pixel points in the image containing pollen particles is used as an image characteristic, the pixel points in the image containing pollen particles are classified by a K-Means clustering algorithm, the image background is distinguished from the pollen particles, and the problem that transparent bubbles with similar textures, sizes and shapes with the pollen particles are mistakenly detected as pollen by a target detection model is avoided, so that the detection effect of the target detection model is improved.
Based on any one of the above embodiments, the binarizing the HSV image to obtain a binary image includes:
and calculating the pixel value of each pixel point in the binary image based on the color intervals of the H channel, the S channel and the V channel.
Specifically, by setting an HSV color section, pixel values of each pixel point in the binary image are calculated.
According to the method provided by the invention, the binarization processing is carried out on the HSV image, so that pollen particle information in the image can be conveniently extracted, and the identification efficiency is improved.
Based on any one of the above embodiments, the calculating the pixel value of each pixel point in the binary image based on the color intervals of the H-channel, the S-channel and the V-channel specifically includes:
dst=Hmin≤src(H)Hmax∩Smin≤src(S)Smax∩Vmin≤src(V)Vmax;
Wherein dst is a pixel value of each pixel point in the binary image, and H min、Smin and V min are minimum values of an H channel, an S channel and a V channel respectively; h max、Smax and V max are the maximum values of H channel, S channel and V channel, respectively.
Specifically, the minimum value and the maximum value of the H channel, the S channel and the V channel are respectively set, the pixel value of each pixel point in the binary image is calculated, and finally the binary image is obtained.
Based on any one of the above embodiments, the converting the classified image into an HSV image, and performing binarization processing on the HSV image, to obtain a binary image, further includes:
and denoising the binary image.
Specifically, noise data is difficult to avoid in an image comprising pollen particles, so that some noise small white spots exist in an acquired binary image, and the binary image is subjected to denoising processing; the method used in the denoising process may be any denoising process in the prior art, for example, morphological transformation (including open operation and closed operation) is used to remove noise, which is not particularly limited in the present invention.
The method further comprises the steps of after acquiring the image to be identified based on the image including pollen particles and the binary image:
The black background of the image to be identified is filled with the RGB average of the sample image of the pollen grain sample.
Specifically, the black background of the image to be recognized is filled with the RGB average value of the sample image of the pollen particle sample, thereby completely covering the bubbles present in the image background.
The method provided by the invention carries out denoising treatment on the binary image, and reduces the influence of noise on detection; and filling the black background of the image to be identified with the RGB average value of the sample image of the pollen particle sample, so as to further radically eliminate the influence of bubbles and improve the detection effect of the target detection model.
Based on any of the above embodiments, the object detection model is an SSD (Single Shot MultiBox Detector, single-stage object detection) model.
Specifically, the SSD model is adopted to realize the detection of pollen particles.
Alternatively, any detection model in the prior art may be used as the target detection model, which is not particularly limited in the present invention.
The method for detecting pollen grains according to the present invention will be further described with reference to a specific example.
Firstly, acquiring an image containing pollen particles, classifying the pixel points in the image containing pollen particles by taking the median of RGB values of all the pixel points in the image containing pollen particles as an image characteristic, and obtaining a classified image, wherein the classified image is shown in figure 2;
Second, converting the classified image into an HSV image, wherein the HSV image is shown in fig. 3;
Thirdly, converting the HSV image into a binary image according to a set HSV color interval, wherein the binary image is shown in figure 4;
Fourth, removing noise from the binary image by using morphological transformation (including opening operation and closing operation) to obtain a mask image, wherein the mask image is shown in fig. 5;
fifthly, performing bit AND calculation on the image containing pollen particles and the mask image to obtain a calculated image, wherein the calculated image is shown in fig. 6;
Sixthly, filling a black background of a non-pollen color in the calculated image with an RGB average value of a sample image of a pollen particle sample to obtain an image to be identified;
Seventhly, inputting the image to be identified into an SSD model for pollen particle detection, and obtaining a pollen particle detection result.
The pollen particle detecting device provided by the invention is described below, and the pollen particle detecting device described below and the pollen particle detecting method described above can be referred to correspondingly.
Based on any of the above embodiments, fig. 7 is a schematic structural diagram of a pollen particle detection device according to the present invention, and as shown in fig. 7, the pollen particle detection device includes an acquisition module 701, a processing module 702, an input module 703 and an output module 704.
Wherein, the acquiring module 701 is configured to acquire an image including pollen grains; the processing module 702 is configured to classify the pixel points in the image including pollen particles by using the median of RGB values of all the pixel points in the image including pollen particles as an image feature, so as to obtain an image to be identified; the input module 703 is used for inputting the image to be identified into a target detection model; the output module 704 is used for outputting a pollen particle detection result; the target detection model is obtained after supervision training is carried out on the basis of a sample image of a pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one.
According to the device provided by the invention, before the image comprising the pollen particles is input into the target detection model for detection, the image comprising the pollen particles is subjected to the pretreatment of pixel point classification, so that the image background is well distinguished from the pollen particles, the problem that the target detection model misdetects transparent bubbles with similar textures, sizes and shapes as the pollen particles is avoided, and the detection effect of the target detection model is improved.
Based on any of the foregoing embodiments, the processing module is configured to classify the pixel points in the image including pollen grains with a median of RGB values of all the pixel points in the image including pollen grains as an image feature, to obtain an image to be identified, specifically:
taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles, and obtaining a classified image;
Converting the classified image into an HSV image, and performing binarization processing on the HSV image to obtain a binary image;
And acquiring an image to be identified based on the image containing pollen particles and the binary image.
Based on any one of the above embodiments, the classifying the pixel points in the image including pollen grains with the median of RGB values of all the pixel points in the image including pollen grains as the image feature, to obtain a classified image includes:
Taking the median of RGB values of all pixel points in the image containing pollen grains as an image characteristic, classifying the pixel points in the image containing pollen grains based on a K-Means clustering algorithm, and obtaining a classified image.
Based on any one of the above embodiments, the binarizing the HSV image to obtain a binary image includes:
and calculating the pixel value of each pixel point in the binary image based on the color intervals of the H channel, the S channel and the V channel.
Based on any one of the above embodiments, the calculating the pixel value of each pixel point in the binary image based on the color intervals of the H-channel, the S-channel and the V-channel specifically includes:
dst=Hmin≤src(H)Hmax∩Smin≤src(S)Smax∩Vmin≤src(V)Vmax;
Wherein dst is a pixel value of each pixel point in the binary image, and H min、Smin and V min are minimum values of an H channel, an S channel and a V channel respectively; h max、Smax and V max are the maximum values of H channel, S channel and V channel, respectively.
Based on any one of the above embodiments, the converting the classified image into an HSV image, and performing binarization processing on the HSV image, to obtain a binary image, further includes:
denoising the binary image;
the method further comprises the steps of after acquiring the image to be identified based on the image including pollen particles and the binary image:
The black background of the image to be identified is filled with the RGB average of the sample image of the pollen grain sample.
Based on any of the above embodiments, the object detection model is an SSD (Single Shot MultiBox Detector, single-stage object detection) model.
The pollen particle detection device provided by the invention can be used for executing the technical scheme of the pollen particle detection method embodiments, and the implementation principle and the technical effect are similar, and are not repeated here.
Fig. 8 illustrates a physical structure diagram of an electronic device, as shown in fig. 8, which may include: processor 810, communication interface (CommunicationsInterface) 820, memory 830, and communication bus 840, wherein processor 810, communication interface 820, memory 830 accomplish communication with each other through communication bus 840. Processor 810 may invoke logic instructions in memory 830 to perform a pollen grain detection method comprising: acquiring an image including pollen grains;
Taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles to obtain an image to be identified;
inputting the image to be identified into a target detection model, and outputting a pollen particle detection result;
The target detection model is obtained after supervision training is carried out on the basis of a sample image of a pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one.
Further, the logic instructions in the memory 830 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-only memory (ROM), a random access memory (RAM, randomAccessMemory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which when executed by a processor is implemented to perform the pollen grain detection methods provided above, the method comprising: acquiring an image including pollen grains;
Taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles to obtain an image to be identified;
inputting the image to be identified into a target detection model, and outputting a pollen particle detection result;
The target detection model is obtained after supervision training is carried out on the basis of a sample image of a pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (7)
1. The pollen particle detection method is characterized by comprising the following steps of:
Acquiring an image including pollen grains;
Taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles to obtain an image to be identified;
inputting the image to be identified into a target detection model, and outputting a pollen particle detection result;
the target detection model is obtained after supervision training is carried out on the basis of a sample image of a pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one;
The classifying the pixel points in the image including pollen particles by taking the median of RGB values of all the pixel points in the image including pollen particles as an image feature to obtain an image to be identified, including:
taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles, and obtaining a classified image;
Converting the classified image into an HSV image, and performing binarization processing on the HSV image to obtain a binary image;
Acquiring an image to be identified based on the image containing pollen particles and the binary image;
The binarizing processing is performed on the HSV image to obtain a binary image, which comprises the following steps:
calculating pixel values of all pixel points in the binary image based on color intervals of the H channel, the S channel and the V channel;
The calculating the pixel value of each pixel point in the binary image based on the color intervals of the H channel, the S channel and the V channel specifically comprises the following steps:
dst=Hmin≤src(H)Hmax∩Smin≤src(S)Smax∩Vmin≤src(V)Vmax;
Wherein dst is a pixel value of each pixel point in the binary image, and H min、Smin and V min are minimum values of an H channel, an S channel and a V channel respectively; h max、Smax and V max are the maximum values of H channel, S channel and V channel, respectively.
2. The method according to claim 1, wherein classifying the pixels in the image including pollen grains with the median of RGB values of all pixels in the image including pollen grains as an image feature, comprises:
Taking the median of RGB values of all pixel points in the image containing pollen grains as an image characteristic, classifying the pixel points in the image containing pollen grains based on a K-Means clustering algorithm, and obtaining a classified image.
3. The method for detecting pollen grains according to claim 1, wherein the steps of converting the classified image into an HSV image, and binarizing the HSV image to obtain a binary image, further comprise:
denoising the binary image;
the method further comprises the steps of after acquiring the image to be identified based on the image including pollen particles and the binary image:
The black background of the image to be identified is filled with the RGB average of the sample image of the pollen grain sample.
4. The pollen grain detection method of claim 1, wherein the target detection model is an SSD (Single Shot MultiBox Detector, single stage target detection) model.
5. Pollen particle detection device, characterized in that includes:
the acquisition module is used for acquiring an image comprising pollen particles;
The processing module is used for classifying the pixel points in the image containing the pollen particles by taking the median of RGB values of all the pixel points in the image containing the pollen particles as an image characteristic to obtain an image to be identified;
The input module is used for inputting the image to be identified into a target detection model;
The output module is used for outputting pollen particle detection results;
the target detection model is obtained after supervision training is carried out on the basis of a sample image of a pollen particle sample and a corresponding identification label, and the identification label is predetermined according to the pollen particle sample and corresponds to the sample image one by one;
wherein the device is used for:
taking the median of RGB values of all pixel points in the image containing pollen particles as an image characteristic, classifying the pixel points in the image containing pollen particles, and obtaining a classified image;
Converting the classified image into an HSV image, and performing binarization processing on the HSV image to obtain a binary image;
Acquiring an image to be identified based on the image containing pollen particles and the binary image;
The binarizing processing is performed on the HSV image to obtain a binary image, which comprises the following steps:
calculating pixel values of all pixel points in the binary image based on color intervals of the H channel, the S channel and the V channel;
The calculating the pixel value of each pixel point in the binary image based on the color intervals of the H channel, the S channel and the V channel specifically comprises the following steps:
dst=Hmin≤src(H)Hmax∩Smin≤src(S)Smax∩Vmin≤src(V)Vmax;
Wherein dst is a pixel value of each pixel point in the binary image, and H min、Smin and V min are minimum values of an H channel, an S channel and a V channel respectively; h max、Smax and V max are the maximum values of H channel, S channel and V channel, respectively.
6. 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 processor implements the steps of the pollen grain detection method as claimed in any one of claims 1 to 4 when the computer program is executed.
7. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the pollen grain detection method as claimed in any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011280263.4A CN112465753B (en) | 2020-11-16 | 2020-11-16 | Pollen particle detection method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011280263.4A CN112465753B (en) | 2020-11-16 | 2020-11-16 | Pollen particle detection method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112465753A CN112465753A (en) | 2021-03-09 |
CN112465753B true CN112465753B (en) | 2024-05-28 |
Family
ID=74836362
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011280263.4A Active CN112465753B (en) | 2020-11-16 | 2020-11-16 | Pollen particle detection method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112465753B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115049694B (en) * | 2022-05-06 | 2024-06-11 | 北京工业大学 | Pollen particle image extraction method based on image features |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017092431A1 (en) * | 2015-12-01 | 2017-06-08 | 乐视控股(北京)有限公司 | Human hand detection method and device based on skin colour |
CN110084135A (en) * | 2019-04-03 | 2019-08-02 | 平安科技(深圳)有限公司 | Face identification method, device, computer equipment and storage medium |
CN110348522A (en) * | 2019-07-12 | 2019-10-18 | 创新奇智(青岛)科技有限公司 | A kind of image detection recognition methods and system, electronic equipment, image classification network optimized approach and system |
-
2020
- 2020-11-16 CN CN202011280263.4A patent/CN112465753B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017092431A1 (en) * | 2015-12-01 | 2017-06-08 | 乐视控股(北京)有限公司 | Human hand detection method and device based on skin colour |
CN110084135A (en) * | 2019-04-03 | 2019-08-02 | 平安科技(深圳)有限公司 | Face identification method, device, computer equipment and storage medium |
CN110348522A (en) * | 2019-07-12 | 2019-10-18 | 创新奇智(青岛)科技有限公司 | A kind of image detection recognition methods and system, electronic equipment, image classification network optimized approach and system |
Also Published As
Publication number | Publication date |
---|---|
CN112465753A (en) | 2021-03-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109154978B (en) | System and method for detecting plant diseases | |
CN108229526B (en) | Network training method, network training device, image processing method, image processing device, storage medium and electronic equipment | |
CN111401372B (en) | Method for extracting and identifying image-text information of scanned document | |
CN110309806B (en) | Gesture recognition system and method based on video image processing | |
CN109002851B (en) | Fruit classification method based on image multi-feature fusion and application | |
US11151402B2 (en) | Method of character recognition in written document | |
JP2015065654A (en) | Color document image segmentation using automatic recovery and binarization | |
CN109544583B (en) | Method, device and equipment for extracting interested area of leather image | |
CN111079845A (en) | Classification and identification method for coal gangue and coal in coal | |
CN111160194B (en) | Static gesture image recognition method based on multi-feature fusion | |
Zhang et al. | A combined algorithm for video text extraction | |
CN111161281A (en) | Face region identification method and device and storage medium | |
CN107622280A (en) | Modularization prescription formula image significance detection method based on scene classification | |
CN115272838A (en) | Information fusion technology-based marine plankton automatic identification method and system | |
CN113688838A (en) | Red handwriting extraction method and system, readable storage medium and computer equipment | |
CN112465753B (en) | Pollen particle detection method and device and electronic equipment | |
CN111709305A (en) | Face age identification method based on local image block | |
CN108877030B (en) | Image processing method, device, terminal and computer readable storage medium | |
RU2476932C1 (en) | Automated system of biomedical microimage analysis for detection and characterisation of fixed class informative objects against inhomogeneous background | |
CN112434731B (en) | Image recognition method, device and readable storage medium | |
CN107704864B (en) | Salient object detection method based on image object semantic detection | |
CN111383054A (en) | Advertisement checking method and device | |
CN115829848A (en) | Method, apparatus and computer-readable storage medium for processing graphic symbols | |
CN110348530B (en) | Method for identifying lipstick number | |
RU118774U1 (en) | AUTOMATED SYSTEM OF ANALYSIS OF BIOMEDICAL MICRO-IMAGES FOR DETECTION AND CHARACTERIZATION OF INFORMATIVE OBJECTS OF A SPECIFIED TYPE ON AN INHOMOGENEOUS BACKGROUND |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |