CN112801991A - Rice bacterial leaf blight detection method based on image segmentation - Google Patents

Rice bacterial leaf blight detection method based on image segmentation Download PDF

Info

Publication number
CN112801991A
CN112801991A CN202110149577.9A CN202110149577A CN112801991A CN 112801991 A CN112801991 A CN 112801991A CN 202110149577 A CN202110149577 A CN 202110149577A CN 112801991 A CN112801991 A CN 112801991A
Authority
CN
China
Prior art keywords
image
leaf
super
pixel
rice
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.)
Granted
Application number
CN202110149577.9A
Other languages
Chinese (zh)
Other versions
CN112801991B (en
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.)
Guangzhou Institute of Geography of GDAS
Original Assignee
Guangzhou Institute of Geography of GDAS
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 Guangzhou Institute of Geography of GDAS filed Critical Guangzhou Institute of Geography of GDAS
Priority to CN202110149577.9A priority Critical patent/CN112801991B/en
Publication of CN112801991A publication Critical patent/CN112801991A/en
Application granted granted Critical
Publication of CN112801991B publication Critical patent/CN112801991B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06T5/92
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • 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/20036Morphological image processing

Abstract

The invention relates to a rice bacterial leaf blight detection method based on image segmentation, which comprises the following steps: acquiring a super-pixel image corresponding to the rice leaf image according to the rice leaf image and a preset image segmentation algorithm by acquiring the rice leaf image, wherein the super-pixel image comprises a plurality of super-pixels, and each super-pixel is generated based on pixel points in the plurality of rice leaf images; and then, extracting suspected disease spots in the super-pixel image according to the super-pixel image and a preset disease spot extraction algorithm, inputting the characteristics of the suspected disease spots in the super-pixel image into a trained rice bacterial leaf blight detection model, and obtaining a bacterial leaf blight detection result of the rice leaves. Compared with the prior art, the method and the device improve the accuracy of bacterial leaf blight detection, and further improve the detection efficiency of the bacterial leaf blight due to the fact that the rice leaf images are subjected to image segmentation and converted into the super-pixel images, and can meet the detection requirements of the high-precision and high-efficiency rice bacterial leaf blight.

Description

Rice bacterial leaf blight detection method based on image segmentation
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a rice bacterial leaf blight detection method based on image segmentation.
Background
Crop diseases are always important disasters in agricultural production, and the development of agriculture with high efficiency, high quality, ecology and safety is restricted. The bacterial leaf blight of rice occurs in various rice regions in Asia, and is one of the main diseases of rice. Generally, when a rice bacterial leaf blight disaster occurs, the yield of rice is reduced, and in a serious case, the yield is reduced by more than 50%. Therefore, the key is how to accurately detect the bacterial leaf blight of rice so as to treat the bacterial leaf blight disaster in advance.
The traditional detection mode of the bacterial leaf blight of rice mainly depends on visual estimation of related agronomic professionals, so that the efficiency is low, the detection error is high, and the detection requirement of the bacterial leaf blight of rice with high efficiency and high precision is difficult to meet.
Disclosure of Invention
The embodiment of the application provides a rice bacterial leaf blight detection method based on image segmentation, and the technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a method for detecting bacterial blight of rice based on image segmentation, including:
acquiring a rice leaf image;
acquiring a super-pixel image corresponding to the rice leaf image according to the rice leaf image and a preset image segmentation algorithm; the super-pixel image comprises a plurality of super-pixels, and each super-pixel is generated based on pixel points in a plurality of rice leaf images;
according to the super-pixel image and a preset lesion extraction algorithm, extracting suspected lesions in the super-pixel image;
inputting the characteristics of the suspected disease spots in the super-pixel image into a trained rice bacterial leaf blight detection model to obtain a bacterial leaf blight detection result of the rice leaves.
Optionally, the obtaining of the superpixel image corresponding to the rice leaf image according to the rice leaf image and a preset image segmentation algorithm includes:
acquiring a plurality of initial superpixels in the rice leaf image; each initial super pixel comprises a plurality of pixel points in the rice leaf image;
acquiring the pixel value of the initial super pixel according to the average value of the pixel values of all the pixel points in the initial super pixel;
merging the target initial superpixels of which the pixel values meet preset merging conditions to obtain the superpixels and the superpixel images comprising the superpixels; and the pixel value of each super pixel is the mean value of the pixel values of the corresponding target initial super pixels.
Optionally, the extracting the suspected lesion in the superpixel image according to the superpixel image and a preset lesion extracting algorithm includes the steps of:
extracting leaf superpixels in the superpixel image according to the brightness components of the superpixels in the superpixel image and a preset leaf superpixel extraction algorithm;
extracting disease spot superpixels in the leaf superpixels according to the red and green components of the leaf superpixels and a preset disease spot superpixel extraction algorithm;
according to the lesion superpixel in the superpixel image and a preset suspected lesion extraction algorithm, extracting suspected lesions in the superpixel image; and the suspected lesion spots are communicated areas formed by the superpixels of the lesion spots.
Optionally, the extracting leaf superpixels in the superpixel image according to the brightness components of the superpixels in the superpixel image and a preset leaf superpixel extraction algorithm includes:
acquiring a brightness component division threshold corresponding to the super-pixel image according to the brightness components of all the super-pixels in the super-pixel image and a preset maximum inter-class variance algorithm;
and extracting leaf superpixel points of which the brightness components are greater than the brightness component division threshold value in the superpixel image.
Optionally, the extracting the lesion super-pixel in the leaf super-pixel according to the red and green components of the leaf super-pixel and a preset lesion super-pixel extraction algorithm includes:
acquiring red and green component division thresholds corresponding to the super-pixel images according to the red and green components of all the leaf super-pixels in the super-pixel images and a preset maximum inter-class variance algorithm;
and extracting the scab superpixels of which the red-green components are larger than the brightness component division threshold value in the leaf superpixels.
Optionally, the extracting the suspected lesion in the super-pixel image according to the lesion super-pixel in the super-pixel image and a preset suspected lesion extracting algorithm includes the steps of:
acquiring a plurality of initial suspected disease spots in the super-pixel image according to the disease spot super-pixels in the super-pixel image and a preset image morphological algorithm;
if the total number of all pixel points in the initial suspected scab is smaller than a preset first threshold, setting the scab superpixel in the initial suspected scab as the leaf superpixel;
if the total number of all pixel points in the initial suspected scab is not smaller than a preset first threshold and the number of pixel points in the leaf superpixels surrounded by the initial suspected scab is smaller than a preset second threshold, setting the leaf superpixels surrounded by the initial suspected scab as the scab superpixels, and obtaining the suspected scab.
Optionally, the step of inputting the characteristics of the suspected disease spots in the super-pixel image into a trained rice bacterial leaf blight detection model to obtain a bacterial leaf blight detection result of the rice leaf comprises the steps of:
extracting the characteristics of the suspected disease spots according to the suspected disease spots in the super-pixel image and a preset characteristic extraction algorithm;
inputting the characteristics of the suspected disease spots into a trained rice bacterial leaf blight detection model to obtain a bacterial leaf blight detection result of the rice leaves.
Optionally, the characteristics of the suspected lesion include shape characteristics, gray-scale characteristics and texture characteristics,
the method for extracting the characteristics of the suspected lesion spots according to the suspected lesion spots in the super-pixel image and a preset characteristic extraction algorithm comprises the following steps:
according to the length, the perimeter, the area and the compactness of the suspected scab, acquiring the shape characteristics of each suspected scab;
acquiring gray features of the suspected scab according to the mean value of the brightness components, the mean value of the red and green components and the mean value of the blue and yellow components of the superpixels of the suspected scab;
and acquiring texture features of the suspected scab according to the brightness component, the red-green component and the blue-yellow component of each super-pixel of the scab in the suspected scab and a preset gray level co-occurrence matrix generation algorithm.
Optionally, the acquiring of the plurality of rice leaf images includes:
acquiring an initial rice leaf image;
and carrying out Lab color transformation on the initial rice leaf image to obtain the rice leaf image.
Optionally, after performing Lab color transformation on the initial rice leaf image to obtain a plurality of rice leaf images, the method includes the steps of:
acquiring leaf edge pixel points in the rice leaf image and pixel points communicated with the leaf edge pixel points according to the brightness components of the pixel points in the rice leaf image and a preset leaf edge identification strategy;
setting the brightness components of the blade edge pixel points and the pixel points communicated with the blade edge pixel points to be 0
In the embodiment of the application, a rice leaf image is obtained, and a superpixel image corresponding to the rice leaf image is obtained according to the rice leaf image and a preset image segmentation algorithm, wherein the superpixel image comprises a plurality of superpixels, and each superpixel is generated based on pixel points in the plurality of rice leaf images; and then, extracting suspected disease spots in the superpixel image according to the superpixel image and a preset disease spot extraction algorithm, inputting the characteristics of the suspected disease spots in the superpixel image into a trained rice bacterial leaf blight detection model, and obtaining a bacterial leaf blight detection result of the rice leaf. The method improves the accuracy of bacterial leaf blight detection, and further improves the detection efficiency of the bacterial leaf blight because the rice leaf images are subjected to image segmentation and converted into superpixel images, and can meet the detection requirements of the high-precision and high-efficiency rice bacterial leaf blight.
In the embodiments of the present application, for better understanding and implementation, the technical solutions of the present application are described in detail below with reference to the accompanying drawings.
Drawings
FIG. 1 is a schematic flow chart of a method for detecting bacterial blight of rice based on image segmentation according to an embodiment of the present application;
fig. 2 is a schematic flowchart of S101 in the method for detecting bacterial blight of rice based on image segmentation according to an embodiment of the present application;
fig. 3 is a schematic flowchart of S101 in a rice bacterial blight detection method based on image segmentation according to another embodiment of the present application;
fig. 4 is a schematic flowchart of S102 in the method for detecting bacterial blight of rice based on image segmentation according to an embodiment of the present application;
fig. 5 is a schematic flowchart of S103 in the method for detecting bacterial blight of rice based on image segmentation according to an embodiment of the present application;
fig. 6 is a schematic flowchart of S1033 in the method for detecting bacterial blight of rice based on image segmentation according to an embodiment of the present application;
fig. 7 is a schematic flowchart of S104 in the method for detecting bacterial blight of rice based on image segmentation according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if/if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Referring to fig. 1, a schematic flow chart of a method for detecting bacterial blight of rice based on image segmentation according to an embodiment of the present application is shown, where the method includes the following steps:
s101: and acquiring a rice leaf image.
In the embodiment of the present application, the main execution body of the rice bacterial leaf blight detection method based on image segmentation may be rice bacterial leaf blight detection equipment based on image segmentation (hereinafter referred to as detection equipment), or may be a component in the detection equipment, such as an internal processor or microprocessor.
The detection equipment acquires rice leaf images. Wherein the rice leaf image is obtained by controlling shooting equipment to shoot rice leaves.
In an alternative embodiment, the shooting device may be a shooting device built in the detection device, and in another alternative embodiment, the shooting device may also be a separate shooting device, and the separate shooting device establishes a data connection with the detection device.
Specifically, before shooting a rice leaf image, firstly, flatly laying the rice leaf on a shooting background plate, and placing a shooting device right above the rice leaf, and then, shooting the rice leaf by the shooting device in response to a shooting instruction sent by a detection device to obtain the rice leaf image.
The shooting background plate is preferably a material with a non-reflective surface, such as black cloth.
The shooting equipment preferably has a certain distance with the rice leaf to ensure the completeness of the leaf and avoid the geometrical deformation of the rice leaf corners, such as 50 cm.
In an alternative embodiment, in order to improve the accuracy of detecting bacterial blight of rice, referring to fig. 2, step S101 includes steps S1011 to S1012, which are as follows:
s1011: and acquiring an initial rice leaf image.
The detection device acquires an initial rice leaf image shot by the shooting device.
Wherein the initial rice leaf image is a rice leaf image without any treatment.
S1012: and carrying out Lab color transformation on the initial rice leaf image to obtain the rice leaf image.
And carrying out Lab color transformation on the initial rice leaf image by the detection equipment to obtain the rice leaf image.
Wherein, Lab color transformation refers to the transformation of image color into Lab color space. In Lab color space, one color is represented by L, A, B three parameters, L represents brightness component, and the value [0-100] corresponds to [ pure black-pure white ]; a represents the range from red and green components, namely green to red, and the value [ -128- +127] corresponds to [ green-magenta ]; b represents blue-yellow component, namely the range from blue to yellow, the value [ -128- - +127] corresponds to blue-yellow, which is warm, and the negative is cold.
Since the background, the leaves and the bacterial blight lesions on the rice leaf images are more obviously distinguished from each other in the Lab color space, the Lab color transformation of the rice leaf images is helpful for subsequent image analysis.
In another alternative embodiment, after step S1012 is completed, the rice leaf image may be further preprocessed, and specifically, referring to fig. 3, step S101 further includes steps S1013 to S1014:
s1013: and acquiring leaf edge pixel points in the rice leaf image and pixel points communicated with the leaf edge pixel points according to the brightness component of each pixel point in the rice leaf image and a preset leaf edge identification strategy.
And the detection equipment identifies the leaf edges in the rice leaf images according to the brightness components of all the pixel points in the rice leaf images and a preset leaf edge identification strategy.
The leaf edges comprise leaf edge pixel points in the rice leaf images and pixel points communicated with the leaf edge pixel points.
Specifically, the blade edge pixel points refer to pixel points of which the brightness components meet preset conditions and which are located at the edge of the blade, and the pixel points which are communicated with the blade edge pixel points refer to pixel points of which the brightness components meet the preset conditions and which are located in 8 communication regions of the blade edge pixel points.
In an alternative embodiment, the preset condition is that the luminance component is greater than 30. In other alternative embodiments, the preset condition may also be other reasonable judgment conditions.
S1014: and setting the brightness components of the blade edge pixel points and the pixel points communicated with the blade edge pixel points to be 0.
And the detection equipment sets the brightness components of the blade edge pixel points and pixel points communicated with the blade edge pixel points to be 0.
In the embodiment, the interference of the pixels at the edge of the blade on the subsequent detection result can be reduced by processing the edge of the blade, and the detection accuracy is improved.
S102: acquiring a super-pixel image corresponding to the rice leaf image according to the rice leaf image and a preset image segmentation algorithm; the super-pixel image comprises a plurality of super-pixels, and each super-pixel is generated based on pixel points in a plurality of rice leaf images.
The preset image segmentation algorithm is an irregular pixel block which is a super pixel and has certain visual significance and is formed by adjacent pixels with similar texture, color, brightness and other characteristics, so that a large number of pixels are replaced by a small number of super pixels to express the characteristics of the rice leaf image. Because a large amount of image data needs to be processed when the rice leaf blight is detected, the complexity of subsequent image processing can be effectively reduced and the detection speed can be increased by carrying out image segmentation on the rice leaf images.
In the embodiment of the application, the detection equipment acquires the superpixel image corresponding to the rice leaf image according to the rice leaf image and a preset image segmentation algorithm.
The preset image segmentation algorithm may be any one of existing image segmentation algorithms, and is not limited herein.
To further reduce the complexity of the subsequent image processing, referring to fig. 4, step S102 includes steps S1021 to S1023 as follows:
s1021: acquiring a plurality of initial superpixels in the rice leaf image; and each initial super pixel comprises a plurality of pixel points in the rice leaf image.
In an alternative embodiment, the detection device obtains a plurality of initial superpixels in the rice leaf image according to a linear iterative clustering algorithm (SLIC).
The linear iterative clustering algorithm comprises two parameters which are divided into the number of the super pixels and the compactness of the super pixels.
Wherein, the more the number of the super-pixels is, the smaller the super-pixels are obtained, and the higher the compactness is, the closer the super-pixels are to the square.
In the embodiment of the present application, the number of super pixels is 10000, and the compactness of the super pixels is 10. In other alternative embodiments, the number and compactness of the superpixels can be adjusted according to the requirements of the size of the rice leaf image and the like.
S1022: and obtaining the pixel value of the initial super pixel according to the average value of the pixel values of all the pixel points in the initial super pixel.
And the detection equipment acquires the pixel value of the initial super pixel according to the average value of the pixel values of all the pixel points in the initial super pixel.
S1023: merging the target initial superpixels of which the pixel values meet preset merging conditions to obtain the superpixels and the superpixel images comprising the superpixels; and the pixel value of each super pixel is the mean value of the pixel values of the corresponding target initial super pixels.
The detection equipment acquires the adjacency relation of initial superpixels in the rice leaf images based on the region adjacency graphs corresponding to the rice leaf images, gradually merges target initial superpixels meeting merging conditions in the rice leaf images based on the adjacency relation of the initial superpixels, and acquires the superpixels and the superpixel images comprising the superpixels.
The region adjacency graph is obtained by algorithm output when the detection equipment obtains a plurality of initial superpixels in the rice leaf image according to a linear iterative clustering algorithm, and is used for representing the adjacency relation between the initial superpixels.
In an alternative embodiment, the preset merge condition is diff (C)1,C2)<TcolorWherein, C1And C2Respectively representing the pixel values, diff (C) of two adjacent initial superpixels1,C2) Representing the degree of discrimination of the pixel values of two adjacent initial superpixels, TcolorRepresenting a discrimination threshold.
And the pixel value of each super pixel is the mean value of the pixel values of the corresponding target initial super pixels. That is to say that the first and second electrodes,
Figure BDA0002932190850000071
wherein, CnewPixel value, C, representing a superpixel1And C2Respectively representing the pixel values of two adjacent initial superpixels, n1And n2Respectively representing the number of pixel points in two adjacent initial super pixels.
In this embodiment, the initial superpixels and the initial superpixels in the rice leaf image are obtained, and then the target initial superpixels whose pixel values satisfy the preset merging conditions are merged to obtain the pixel values of the superpixels and the superpixels, so that the adjacent similar initial superpixels are merged together to the greatest extent, and the subsequent detecting speed of the bacterial leaf blight is increased.
S103: and extracting suspected scabs in the superpixel image according to the superpixel image and a preset scab extraction algorithm.
The scab extraction algorithm is preset in the detection equipment, and after the detection equipment acquires the super-pixel image, suspected scabs in the super-pixel image are extracted according to the super-pixel image and the preset scab extraction algorithm.
Specifically, in an optional embodiment, referring to fig. 5, in order to improve the accuracy of extracting the suspected lesion, step S103 includes S1031 to S1033:
s1031: and extracting the leaf superpixels in the superpixel image according to the brightness components of the superpixels in the superpixel image and a preset leaf superpixel extraction algorithm.
The leaf super-pixel extraction algorithm is preset in the detection equipment, and is an algorithm for extracting leaf super-pixels by dividing super-pixels according to the brightness components of the super-pixels. Because the brightness component of the leaf superpixel has larger difference with the brightness component of the background superpixel, the leaf superpixel is extracted based on the brightness component of the superpixel and a preset leaf superpixel extraction algorithm, and the accuracy of leaf superpixel extraction can be obviously improved.
Specifically, in an optional embodiment, the detection device may first obtain a luminance component division threshold corresponding to the super-pixel image according to luminance components of all the super-pixels in the super-pixel image and a preset maximum inter-class variance algorithm, and then extract leaf super-pixel points whose luminance components are greater than the luminance component division threshold in the super-pixel image.
The maximum between-class variance algorithm (OTSU) divides an image into a background super pixel and a leaf super pixel according to the gray characteristic of the image. Specifically, the inter-class variance between the background super-pixel and the leaf super-pixel is calculated, and when the inter-class variance is larger, the difference between two parts forming the image is larger, and the difference between the two parts is reduced because a part of the leaf super-pixels are wrongly divided into the background super-pixels or a part of the background super-pixels are wrongly divided into the leaf super-pixels. Thus, a segmentation that maximizes the inter-class variance means that the probability of a false score is minimized.
The optimal brightness component division threshold value can be found through the maximum inter-class variance method, the leaf superpixel can be prevented from being judged as the background superpixel as much as possible, and the extraction accuracy of the leaf superpixel is further improved.
S1032: and extracting the scab superpixels in the leaf superpixels according to the red and green components of the leaf superpixels and a preset scab superpixel extraction algorithm.
The preset scab superpixel extraction algorithm is an algorithm for dividing the leaf superpixels according to the red and green components of the leaf superpixels so as to extract the scab superpixels in the leaf superpixels. Because the brightness component of the leaf superpixel and the red-green component of the scab superpixel have larger difference, the leaf superpixel is extracted based on the red-green component of the leaf superpixel and a preset scab superpixel extraction algorithm, and the accuracy of leaf superpixel extraction can be obviously improved.
Specifically, in an optional embodiment, the detection device may first obtain a red-green component division threshold corresponding to the super-pixel image according to red-green components of all the leaf super-pixels in the super-pixel image and a preset maximum inter-class variance algorithm, and then extract the scab super-pixel in which the red-green component is greater than the luminance component division threshold in the leaf super-pixel point.
It should be noted that the leaf superpixels extracted in S1031 include the lesion superpixels before the lesion superpixels are not extracted, and the leaf superpixels are leaf superpixels other than the lesion superpixels after the lesion superpixels are extracted.
S1033: according to the lesion superpixel in the superpixel image and a preset suspected lesion extraction algorithm, extracting suspected lesions in the superpixel image; and the suspected lesion spots are communicated areas formed by the superpixels of the lesion spots.
The preset suspected lesion extraction algorithm is an algorithm for extracting the suspected lesion by solving a connected region of superpixels of the lesion.
The detection equipment can accurately extract the suspected scab in the super-pixel image based on the suspected scab extraction algorithm.
In an alternative embodiment, referring to fig. 6, step S1033 includes steps S10331 to S10333, which are as follows:
s10331: and acquiring a plurality of initial suspected lesions in the superpixel image according to the lesion superpixels in the superpixel image and a preset image morphological algorithm.
The preset image morphology algorithm is an algorithm for obtaining communicated lesion super-pixels according to the positions of the lesion super-pixels in the super-pixel image to obtain initial suspected lesions.
The initial suspected lesion is an initial connected region formed by connecting the superpixels of the lesion in the superpixel image. The initial communication area may have an internal cavity or too few pixels in the communication area, and therefore the acquired initial suspected lesion needs to be further processed.
S10332: and if the total number of all pixel points in the initial suspected scab is smaller than a preset first threshold, setting the scab superpixel in the initial suspected scab as the leaf superpixel.
The detection equipment judges whether the total number of all pixel points in the initial suspected scab is smaller than a preset first threshold value or not, if yes, the scab superpixel in the initial suspected scab is set as the leaf superpixel, and namely, the undersized initial suspected scab is removed.
In the embodiment of the present application, the preset first threshold is 10, and in other embodiments, the preset first threshold may be reasonably adjusted.
S10333: if the total number of all pixel points in the initial suspected scab is not smaller than a preset first threshold and the number of pixel points in the leaf superpixels surrounded by the initial suspected scab is smaller than a preset second threshold, setting the leaf superpixels surrounded by the initial suspected scab as the scab superpixels, and obtaining the suspected scab.
The detection equipment judges whether the total number of all pixel points in the initial suspected scab is smaller than a preset first threshold value or not, if not, the detection equipment continuously judges that the number of the pixel points in the leaf superpixel surrounded by the initial suspected scab is smaller than a preset second threshold value, and if so, the leaf superpixel surrounded by the initial suspected scab is set as the scab superpixel, namely, a cavity in the initial suspected scab is filled.
In the embodiment of the present application, the preset second threshold is 5, and in other embodiments, the preset second threshold may be reasonably adjusted.
In this embodiment, based on differences in display brightness and color of a background, rice leaves, and white leaf spots in a rice leaf image, leaf pixel points and lesion pixel points are extracted according to brightness components and red-green components of each pixel point in the rice leaf image, and then suspected lesions are obtained according to a preset suspected lesion extraction algorithm and the lesion pixel points, so that extraction efficiency and accuracy of the suspected lesions are improved.
S104: inputting the characteristics of the suspected disease spots in the super-pixel image into a trained rice bacterial leaf blight detection model to obtain a bacterial leaf blight detection result of the rice leaves.
In an alternative embodiment, the training process of the rice bacterial blight detection model is as follows: firstly, accurately marking the rice bacterial leaf blight disease spots and other disease spots, plaques and the like in a sample image, and extracting the characteristics of the bacterial leaf blight disease spots in the sample image. And then, training parameters of the rice bacterial leaf blight detection model by adopting characteristics of the sample image and an XGboost classifier according to the parameters of the rice bacterial leaf blight detection model to obtain an error between an output result of the rice bacterial leaf blight detection model and a real mark of the sample image, and then reversely training the parameters of the rice bacterial leaf blight detection model until a preset model convergence condition is met, thereby finally obtaining the trained rice bacterial leaf blight detection model.
The XGBoost classifier may be replaced by another type of classifier, which is not limited herein.
In an alternative embodiment, in order to further improve the accuracy of the detection result of the rice bacterial blight detection model, referring to fig. 7, step S104 includes steps S1041 to S1042, which are as follows:
s1041: and extracting the characteristics of the suspected disease spots according to the suspected disease spots in the super-pixel image and a preset characteristic extraction algorithm.
In this embodiment, the features of the suspected lesion include shape features, gray scale features, and texture features.
The definitions and specific acquisition processes of the above features are described below:
(1) the shape characteristics include length, perimeter, area and compactness of the suspected lesion.
And the detection equipment acquires the shape characteristics of each suspected lesion according to the length, the perimeter, the area and the compactness of the suspected lesion.
And the length of the suspected lesion represents the maximum value of the linear distance between two pixel points in the suspected lesion.
The perimeter of the suspected lesion is the length of the outermost side of the suspected lesion.
The area of the suspected lesion is the product of the number of the pixels in the suspected lesion and the area of the pixels.
The compactness of the suspected lesion is the ratio of the perimeter to the area.
Specifically, when the length of the suspected lesion is calculated, the detection device obtains the length of the suspected lesion according to a preset length calculation formula. Wherein, the preset length calculation formula is as follows:
Figure BDA0002932190850000101
xmaxthe maximum value y of the first-dimension coordinate of the pixel point in the suspected lesion in the super-pixel image is representedmaxThe maximum value, x, of the second-dimension coordinate of the pixel point in the suspected lesion in the superpixel image is representedminThe minimum value, y, of the first-dimension coordinate of the pixel point in the suspected lesion in the superpixel image is representedminAnd the minimum value of the second-dimension coordinates of the pixel points in the suspected lesion spots in the super-pixel image is represented, and the Length represents the Length of the suspected lesion spots.
(2) The gray scale features are the mean values of all pixel points in the suspected scab in brightness components, red and green components and blue and yellow components.
And the detection equipment acquires the gray features of the suspected scab according to the mean value of the brightness components, the mean value of the red and green components and the mean value of the blue and yellow components of the superpixels of the suspected scab.
(3) And acquiring texture features of the suspected scab according to the brightness component, the red-green component and the blue-yellow component of each super-pixel of the scab in the suspected scab and a preset gray level co-occurrence matrix generation algorithm.
The texture features are GLCM gray level co-occurrence matrixes which comprise contrast values, entropy values and autocorrelation values. The preset gray level co-occurrence matrix generation algorithm is not detailed here, and is an existing calculation method.
And the detection equipment acquires the texture characteristics of the suspected scab according to the brightness component, the red-green component and the blue-yellow component of each super pixel of the scab in the suspected scab and a preset gray level co-occurrence matrix generation algorithm.
S1042: inputting the characteristics of the suspected disease spots into a trained rice bacterial leaf blight detection model to obtain a bacterial leaf blight detection result of the rice leaves.
And inputting the shape characteristic, the gray characteristic and the texture characteristic of the suspected disease spot into a trained rice bacterial leaf blight detection model by using detection equipment to obtain a bacterial leaf blight detection result of the rice leaf.
In the embodiment of the application, a rice leaf image is obtained, and a superpixel image corresponding to the rice leaf image is obtained according to the rice leaf image and a preset image segmentation algorithm, wherein the superpixel image comprises a plurality of superpixels, and each superpixel is generated based on pixel points in the plurality of rice leaf images; and then, extracting suspected disease spots in the superpixel image according to the superpixel image and a preset disease spot extraction algorithm, inputting the characteristics of the suspected disease spots in the superpixel image into a trained rice bacterial leaf blight detection model, and obtaining a bacterial leaf blight detection result of the rice leaf. The method improves the accuracy of bacterial leaf blight detection, and further improves the detection efficiency of the bacterial leaf blight because the rice leaf images are subjected to image segmentation and converted into superpixel images, and can meet the detection requirements of the high-precision and high-efficiency rice bacterial leaf blight.
The present invention is not limited to the above-described embodiments, and various modifications and variations of the present invention are intended to be included within the scope of the claims and the equivalent technology of the present invention if they do not depart from the spirit and scope of the present invention.

Claims (10)

1. A rice bacterial leaf blight detection method based on image segmentation is characterized by comprising the following steps:
acquiring a rice leaf image;
acquiring a super-pixel image corresponding to the rice leaf image according to the rice leaf image and a preset image segmentation algorithm; the super-pixel image comprises a plurality of super-pixels, and each super-pixel is generated based on pixel points in a plurality of rice leaf images;
according to the super-pixel image and a preset lesion extraction algorithm, extracting suspected lesions in the super-pixel image;
inputting the characteristics of the suspected disease spots in the super-pixel image into a trained rice bacterial leaf blight detection model to obtain a bacterial leaf blight detection result of the rice leaves.
2. The rice bacterial leaf blight detection method based on image segmentation as claimed in claim 1, wherein the obtaining of the superpixel image corresponding to the rice leaf image according to the rice leaf image and a preset image segmentation algorithm comprises the steps of:
acquiring a plurality of initial superpixels in the rice leaf image; each initial super pixel comprises a plurality of pixel points in the rice leaf image;
acquiring the pixel value of the initial super pixel according to the average value of the pixel values of all the pixel points in the initial super pixel;
merging the target initial superpixels of which the pixel values meet preset merging conditions to obtain the superpixels and the superpixel images comprising the superpixels; and the pixel value of each super pixel is the mean value of the pixel values of the corresponding target initial super pixels.
3. The rice bacterial leaf blight detection method based on image segmentation as claimed in claim 1 or 2, wherein the step of extracting suspected scabs in the superpixel image according to the superpixel image and a preset scab extraction algorithm comprises the steps of:
extracting leaf superpixels in the superpixel image according to the brightness components of the superpixels in the superpixel image and a preset leaf superpixel extraction algorithm;
extracting disease spot superpixels in the leaf superpixels according to the red and green components of the leaf superpixels and a preset disease spot superpixel extraction algorithm;
according to the lesion superpixel in the superpixel image and a preset suspected lesion extraction algorithm, extracting suspected lesions in the superpixel image; and the suspected lesion spots are communicated areas formed by the superpixels of the lesion spots.
4. The rice bacterial leaf blight detection method based on image segmentation as claimed in claim 3, wherein said extracting leaf superpixels in said superpixel image according to brightness components of said superpixels in said superpixel image and a preset leaf superpixel extraction algorithm, comprises the steps of:
acquiring a brightness component division threshold corresponding to the super-pixel image according to the brightness components of all the super-pixels in the super-pixel image and a preset maximum inter-class variance algorithm;
and extracting leaf superpixel points of which the brightness components are greater than the brightness component division threshold value in the superpixel image.
5. The rice bacterial leaf blight detection method based on image segmentation as claimed in claim 3, wherein the extracting of the lesion super pixels in the leaf super pixels according to the red and green components of the leaf super pixels and a preset lesion super pixel extraction algorithm comprises the steps of:
acquiring red and green component division thresholds corresponding to the super-pixel images according to the red and green components of all the leaf super-pixels in the super-pixel images and a preset maximum inter-class variance algorithm;
and extracting the scab superpixels of which the red-green components are larger than the brightness component division threshold value in the leaf superpixels.
6. The rice bacterial leaf blight detection method based on image segmentation as claimed in claim 3, wherein the step of extracting the suspected scab in the superpixel image according to the scab superpixel in the superpixel image and a preset suspected scab extraction algorithm comprises the steps of:
acquiring a plurality of initial suspected disease spots in the super-pixel image according to the disease spot super-pixels in the super-pixel image and a preset image morphological algorithm;
if the total number of all pixel points in the initial suspected scab is smaller than a preset first threshold, setting the scab superpixel in the initial suspected scab as the leaf superpixel;
if the total number of all pixel points in the initial suspected scab is not smaller than a preset first threshold and the number of pixel points in the leaf superpixels surrounded by the initial suspected scab is smaller than a preset second threshold, setting the leaf superpixels surrounded by the initial suspected scab as the scab superpixels, and obtaining the suspected scab.
7. The rice bacterial leaf blight detection method based on image segmentation according to claim 1 or 2, wherein the features of the suspected disease spots in the super-pixel image are input into a trained rice bacterial leaf blight detection model to obtain a rice leaf bacterial leaf blight detection result, and the method comprises the following steps:
extracting the characteristics of the suspected disease spots according to the suspected disease spots in the super-pixel image and a preset characteristic extraction algorithm;
inputting the characteristics of the suspected disease spots into a trained rice bacterial leaf blight detection model to obtain a bacterial leaf blight detection result of the rice leaves.
8. The method for detecting bacterial blight of rice based on image segmentation as claimed in claim 7, wherein the characteristics of the suspected lesion comprise shape characteristics, gray scale characteristics and texture characteristics,
the method for extracting the characteristics of the suspected lesion spots according to the suspected lesion spots in the super-pixel image and a preset characteristic extraction algorithm comprises the following steps:
according to the length, the perimeter, the area and the compactness of the suspected scab, acquiring the shape characteristics of each suspected scab;
acquiring gray features of the suspected scab according to the mean value of the brightness components, the mean value of the red and green components and the mean value of the blue and yellow components of the superpixels of the suspected scab;
and acquiring texture features of the suspected scab according to the brightness component, the red-green component and the blue-yellow component of each super-pixel of the scab in the suspected scab and a preset gray level co-occurrence matrix generation algorithm.
9. The rice bacterial leaf blight detection method based on image segmentation as claimed in claim 1 or 2, wherein the obtaining of the plurality of rice leaf images comprises the steps of:
acquiring an initial rice leaf image;
and carrying out Lab color transformation on the initial rice leaf image to obtain the rice leaf image.
10. The method for detecting bacterial blight of rice as claimed in claim 9, wherein after Lab color transformation is performed on the initial rice leaf images to obtain a plurality of rice leaf images, the method comprises the following steps:
acquiring leaf edge pixel points in the rice leaf image and pixel points communicated with the leaf edge pixel points according to the brightness components of the pixel points in the rice leaf image and a preset leaf edge identification strategy;
and setting the brightness components of the blade edge pixel points and the pixel points communicated with the blade edge pixel points to be 0.
CN202110149577.9A 2021-02-03 2021-02-03 Image segmentation-based rice bacterial leaf blight detection method Active CN112801991B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110149577.9A CN112801991B (en) 2021-02-03 2021-02-03 Image segmentation-based rice bacterial leaf blight detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110149577.9A CN112801991B (en) 2021-02-03 2021-02-03 Image segmentation-based rice bacterial leaf blight detection method

Publications (2)

Publication Number Publication Date
CN112801991A true CN112801991A (en) 2021-05-14
CN112801991B CN112801991B (en) 2022-06-03

Family

ID=75814050

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110149577.9A Active CN112801991B (en) 2021-02-03 2021-02-03 Image segmentation-based rice bacterial leaf blight detection method

Country Status (1)

Country Link
CN (1) CN112801991B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106097335A (en) * 2016-06-08 2016-11-09 安翰光电技术(武汉)有限公司 Digestive tract focus image identification system and recognition methods
CN108364300A (en) * 2018-03-15 2018-08-03 山东财经大学 Vegetables leaf portion disease geo-radar image dividing method, system and computer readable storage medium
CN110321787A (en) * 2019-05-13 2019-10-11 仲恺农业工程学院 Disease recognition method, system and the storage medium indicated based on joint sparse
CN111105393A (en) * 2019-11-25 2020-05-05 长安大学 Grape disease and pest identification method and device based on deep learning

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106097335A (en) * 2016-06-08 2016-11-09 安翰光电技术(武汉)有限公司 Digestive tract focus image identification system and recognition methods
CN108364300A (en) * 2018-03-15 2018-08-03 山东财经大学 Vegetables leaf portion disease geo-radar image dividing method, system and computer readable storage medium
CN110321787A (en) * 2019-05-13 2019-10-11 仲恺农业工程学院 Disease recognition method, system and the storage medium indicated based on joint sparse
CN111105393A (en) * 2019-11-25 2020-05-05 长安大学 Grape disease and pest identification method and device based on deep learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘连忠等: "基于改进 SLIC 的光照干扰下茶树冠层图像分割", 《江苏农业学报》 *
张晴: "超像素和阈值分割相结合的显著目标检测算法", 《现代电子技术》 *

Also Published As

Publication number Publication date
CN112801991B (en) 2022-06-03

Similar Documents

Publication Publication Date Title
CN110084135B (en) Face recognition method, device, computer equipment and storage medium
CN105938564B (en) Rice disease identification method and system based on principal component analysis and neural network
EP2888718B1 (en) Methods and systems for automatic location of optic structures in an image of an eye, and for automatic retina cup-to-disc ratio computation
CN108563979B (en) Method for judging rice blast disease conditions based on aerial farmland images
CN109154978A (en) System and method for detecting plant disease
CN106023151B (en) Tongue object detection method under a kind of open environment
CN112257702A (en) Crop disease identification method based on incremental learning
WO2022198898A1 (en) Picture classification method and apparatus, and device
Wang et al. Skin color detection under complex background
CN110874572B (en) Information detection method and device and storage medium
CN109785321A (en) Meibomian gland method for extracting region based on deep learning and Gabor filter
CN111709305B (en) Face age identification method based on local image block
CN110648336B (en) Method and device for dividing tongue texture and tongue coating
CN107491714B (en) Intelligent robot and target object identification method and device thereof
WO2016117018A1 (en) Image processing device, image processing method, and image processing program
Sari et al. Flower classification using combined a* b* color and fractal-based texture feature
TWI586954B (en) An apparatus for detecting cells being infected by human papillomavirus (hpv) and an detection method therefor
CN110766678A (en) Ovarian cancer molecular typing prediction system
CN112801991B (en) Image segmentation-based rice bacterial leaf blight detection method
CN110647813A (en) Human face real-time detection and identification method based on unmanned aerial vehicle aerial photography
CN112101260B (en) Method, device, equipment and storage medium for identifying safety belt of operator
CN109753912B (en) Multispectral palm print matching method based on tensor
CN115631350B (en) Method and device for identifying colors of canned image
CN108734703B (en) Polished tile printing pattern detection method, system and device based on machine vision
CN112801990A (en) Method for detecting rice blast of rice leaves

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