CN110111263B - Flue-cured tobacco planting guidance system based on image processing - Google Patents

Flue-cured tobacco planting guidance system based on image processing Download PDF

Info

Publication number
CN110111263B
CN110111263B CN201910250565.8A CN201910250565A CN110111263B CN 110111263 B CN110111263 B CN 110111263B CN 201910250565 A CN201910250565 A CN 201910250565A CN 110111263 B CN110111263 B CN 110111263B
Authority
CN
China
Prior art keywords
tobacco
flue
image
module
cured
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.)
Expired - Fee Related
Application number
CN201910250565.8A
Other languages
Chinese (zh)
Other versions
CN110111263A (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.)
China University of Geosciences
Original Assignee
China University of Geosciences
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China University of Geosciences filed Critical China University of Geosciences
Priority to CN201910250565.8A priority Critical patent/CN110111263B/en
Publication of CN110111263A publication Critical patent/CN110111263A/en
Application granted granted Critical
Publication of CN110111263B publication Critical patent/CN110111263B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/02Agriculture; Fishing; Mining
    • G06T5/70
    • G06T5/73
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • 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/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • 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/20024Filtering details
    • G06T2207/20032Median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30181Earth observation
    • G06T2207/30188Vegetation; Agriculture

Abstract

The invention provides a flue-cured tobacco planting guidance system based on image processing, which comprises a server end, a browser end and a mobile end APP. The server end comprises a tobacco leaf and tobacco plant image preprocessing module, a tobacco leaf and tobacco plant image feature extraction module, a tobacco leaf and tobacco plant image classification module, a communication module and a database module. The browser end comprises a user homepage module, a flue-cured tobacco evaluation module and a flue-cured tobacco evaluation recording module, and after a user uploads images of tobacco leaves and tobacco plants locally, the user sends a request to the server end through the Internet to analyze and process the images, so that on-line evaluation and planting guidance of water, fertilizer and growth of the flue-cured tobacco are achieved. The mobile terminal APP comprises an image acquisition module, a user homepage module, a flue-cured tobacco evaluation module and a flue-cured tobacco evaluation recording module, and after a user calls a mobile phone camera to shoot or upload images of tobacco leaves and tobacco plants locally, the user sends a request to the server terminal through a mobile network, so that flue-cured tobacco on-line evaluation and planting guidance are completed, and functions of inquiring and deleting evaluation records are achieved.

Description

Flue-cured tobacco planting guidance system based on image processing
Technical Field
The invention relates to an image processing and mode recognition technology in a flue-cured tobacco planting process, belongs to the field of agricultural informatization, and particularly relates to a flue-cured tobacco planting guidance system based on image processing.
Background
The tobacco has the characteristics of less investment, short period and high profit, and China is a big country for planting and consuming the tobacco, so the tobacco is an important economic crop in China and plays an important role in agricultural products. There are four important periods during the growth of tobacco: the final benefits of tobacco production, including yield and quality, are affected by water, fertilizer and growth conditions during the top dressing period, the film uncovering and loading period, the topping period and the harvest and baking period. The change of the water fertilizer and the growth vigor of the flue-cured tobacco is accompanied with the whole growth process of the flue-cured tobacco, how to accurately master the growth condition of each stage is related to the final benefit. In the actual production and planting process, tobacco growers often judge the growth condition of flue-cured tobacco according to eye sight and hand touch modes, and then take measures according to experience, such as adding water or fertilizer. However, the method is influenced by tobacco growers in different regions, different ages and different culture degrees, and the judgment result can deviate or even have opposite effects.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a flue-cured tobacco planting guidance system based on image processing to solve the technical defects, aiming at the technical problem that the existing flue-cured tobacco growth condition is judged to have deviation or even misjudgment.
A flue-cured tobacco planting guidance system based on image processing comprises a server side, a browser side and a mobile side APP; the server end comprises a tobacco leaf and tobacco plant image preprocessing module, a tobacco leaf and tobacco plant image feature extraction module, a tobacco leaf and tobacco plant image classification module, a communication module and a database module; the processing process of the flue-cured tobacco image is encapsulated into a function in a dynamic link library mode and stored in a server side, and when a browser side or a mobile side requests to evaluate the growth condition of the flue-cured tobacco, the function of the server side is called;
the browser end comprises a user homepage module, a flue-cured tobacco evaluation module and a flue-cured tobacco evaluation recording module, after a user uploads images of tobacco leaves and tobacco plants locally, a request is sent to the server end through the Internet, and the server end analyzes and processes the images, so that on-line evaluation and planting guidance of water and fertilizer and growth of the flue-cured tobacco are achieved; the mobile terminal APP comprises an image acquisition module, a user homepage module, a flue-cured tobacco evaluation module and a flue-cured tobacco evaluation recording module, and after a user calls a mobile phone camera to shoot or upload images of tobacco leaves and tobacco plants locally, the user sends a request to the server terminal through a mobile network, so that flue-cured tobacco on-line evaluation and planting guidance are completed, and functions of inquiring and deleting evaluation records are achieved.
Furthermore, the image acquisition module is a camera of a mobile phone, and when a user wants to know the growth condition of the flue-cured tobacco, images of the tobacco leaves and the tobacco plants are shot by the mobile phone camera according to a certain shooting standard.
Further, the communication module is used for communication between the client and the server, and after the flue-cured tobacco image is collected, the photo and related information are sent to the server through the communication module; and after the flue-cured tobacco image is processed by the program of the server, writing the result into the database through the communication module and displaying the result back to the browser end or the mobile end APP.
Further, the database module is used for storing information recorded by each flue-cured tobacco photo, including producing area, variety, growth period, year, water and fertilizer grade of tobacco leaves, growth grade of tobacco plants and corresponding planting guidance opinions.
Further, the preprocessing process of the tobacco leaf and tobacco plant image preprocessing module specifically comprises the following steps:
firstly, smoothing the collected tobacco leaf or tobacco plant images by adopting a median filtering method, sequencing data sequences in a template by taking pixels as units, replacing the current pixel value with the value in the middle of each point in the neighborhood, wherein the expression of two-dimensional median filtering is as follows:
g(x,y)=med{f(x-k,y-l),(k,l∈w)},
wherein f (x-k, y-l), g (x, y) are the original image and the smoothed image respectively, and w is a two-dimensional template;
then sharpening the tobacco leaf or tobacco plant image by adopting a Laplacian operator second-order sharpening algorithm, setting f to be a second-order differentiable real function, and defining the Laplacian operator of f (x, y) as:
Figure GDA0003134010710000021
wherein f (x, y) is a picture pixel point;
and finally, carrying out image segmentation by adopting an improved GrabCut algorithm, wherein the improved algorithm is as follows:
using an OpenCV (open circuit graphics for content analysis) self-contained rectangle drawing function to frame the tobacco leaf or tobacco plant image, wherein the size of a rectangle is that the side length of an original image is reduced by 5-10 pixel points, broadcasting points representing the background to four corners of a target rectangular area, broadcasting points representing the foreground to the middle of the rectangle, and randomly broadcasting a small number of foreground points and background points to other places of the target rectangular area;
finally, the tobacco leaf or tobacco plant image after smoothing, sharpening and cutting processing is obtained.
Further, the process of extracting the characteristics reflecting the water and fertilizer of the tobacco leaves and the growth vigor of the tobacco plants by the tobacco leaf and tobacco plant image characteristic extraction module specifically comprises the following steps:
after image preprocessing is completed, an RGB model and an HSI model are used for extracting R, G, B, H, S and I six characteristics of tobacco leaves, and the tobacco leaf characteristic extraction steps are as follows:
s1, carrying out pixel cycle scanning on the segmented tobacco leaf image, judging whether a pixel point is black or not, and if so, scanning the next pixel point; if not, go to S2;
s2, calculating the value of each component of the non-black pixel R, G, B;
s3, calculating the mean value of H, S, I of the tobacco leaves according to a model formula;
s4, judging whether the pixel is scanned completely, if not, returning to S1; if yes, calculating the average value of R, G, B, H, S and I of all non-black pixels, namely the characteristic value of the tobacco leaf;
after the characteristics are extracted, the characteristic values are normalized to facilitate subsequent data processing, and the calculation formula is as follows:
Figure GDA0003134010710000031
where m is the number of samples, n is the number of features, i and k represent the ith sample and the kth feature, respectively, xikIs a characteristic value before normalization, x'ikIs a normalized characteristic value, wkIs the weight of the kth feature;
finally, the characteristic value after normalization processing is obtained.
Further, the process of classifying the water, fertilizer and growth vigor of the flue-cured tobacco image by the tobacco leaf and tobacco plant image classification module specifically comprises the following steps:
after the characteristic extraction is completed, grading the flue-cured tobacco image, and grading the flue-cured tobacco image by adopting a near selection principle in fuzzy pattern recognition:
let the color characteristics of the identified tobacco leaves be x respectively1=R,x2=G,x3=B,x4=H,x5=S,x6I, the geometric characteristics of the tobacco plant are y1,y2,y3,y1Is the pixel height, y2Is a pixel strainWidth, y3The leaf element ratio is obtained, so that the tobacco leaf characteristic vector X ═ X (X) is formed1,x2 x3,x4,x5,x6) And the tobacco plant characteristic vector Y ═ (Y)1,y2,y3) And respectively setting the standard model libraries of the images of the tobacco leaves and the tobacco plants as U ═ A1,A2,A3,A4) And V ═ B1,B2,B3,B4) Wherein A is1,A2,A3,A4Representing four grades of water and fertilizer of tobacco leaves, B1,B2,B3,B4Representing four grades of tobacco plant growth, the algorithm flow is as follows:
inputting tobacco leaf and tobacco plant grade samples classified by experts, extracting characteristic values of images of the tobacco leaves and the tobacco plants, calculating the mean value of characteristic parameters of the images of the tobacco leaves and the tobacco plants at the same grade, and establishing a tobacco leaf and tobacco plant image standard grade characteristic vector library;
normalizing each feature in the feature vector library according to a normalization formula to form a fuzzy matrix A for evaluating the image grades of the tobacco leaves and the tobacco plantsiI is not less than 1 and not more than 4 and Bj,1≤j≤4;
Inputting images of tobacco leaves and tobacco plants to be identified, extracting characteristic values of the images of the tobacco leaves and the tobacco plants to form characteristic vectors, normalizing the characteristic vectors to form fuzzy vectors X and Y;
calculating standard grade fuzzy sets A of X and Y and tobacco leaves and tobacco plants respectively by using a maximum and minimum closeness formula in a near selection principleiAnd BjProximity of eta (X, A)i) And eta (Y, B)j) Calculating the maximum closeness eta of the images of the tobacco leaves and the tobacco plantsmax1And ηmax2
Comparison etamax1And η (X, A)i) Obtaining the grade of the tobacco leaves; comparison etamax2And eta (Y, B)j) Obtaining the grade of the tobacco plant;
and finally, the system gives corresponding planting guidance suggestions according to the evaluated grades of the tobacco leaves and the tobacco plants.
Furthermore, the functions of the user homepage modules of the mobile terminal APP and the browser terminal are the same, and the mobile terminal APP and the browser terminal are used for sending instructions, uploading information and displaying results.
Furthermore, flue-cured tobacco evaluation modules included by the mobile terminal APP and the browser terminal have the same functions and are used for online evaluation of the growth condition of flue-cured tobacco and decision-making of planting guidance opinions, and when a user uploads images of tobacco leaves and tobacco plants to be evaluated and selects the producing area, variety, growth period and year of the images, the system can give the levels of water and fertilizer of the tobacco leaves and the growth vigor of the tobacco plants and the planting guidance opinions.
Further, flue-cured tobacco evaluation record module that removal end APP and browser end all included is the same in function, all is arranged in the information of inquiry historical evaluation record, can help the user to carry out quick inquiry to the data of the flue-cured tobacco growth condition of different origins, varieties and years, is favorable to the user to the analysis of flue-cured tobacco growth condition.
Compared with the prior art, the invention has the advantages that:
(1) aiming at the defects that the water and fertilizer and the growth of the flue-cured tobacco need to be manually analyzed in the prior art, the method disclosed by the invention is integrated from the steps of image acquisition, processing, feature extraction and classification of the tobacco leaves and the tobacco plants to the final system. Through website and cell-phone APP, just can be fast accurate the growth condition of judgement flue-cured tobacco, to the user, brought very big facility.
(2) The invention provides an improved GrabCT algorithm aiming at the characteristics of complex image background and high segmentation difficulty in a preprocessing stage, which can avoid man-machine interaction and accelerate the segmentation of images.
(3) In the characteristic extraction stage, the invention provides the phyllotoxin ratio (namely the ratio of tobacco plants in the image) as an important characteristic for reflecting the growth vigor of the flue-cured tobacco, thereby improving the classification accuracy.
(4) The invention provides a new characteristic normalization method, which can more accurately reflect the influence of each characteristic on the growth of flue-cured tobacco.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
FIG. 1 is a diagram of the flue-cured tobacco planting guidance system architecture based on image processing according to the present invention;
FIG. 2 is a data flow chart of the flue-cured tobacco planting guidance system based on image processing according to the present invention;
FIG. 3 is a graph of the operation result of a flue-cured tobacco planting guidance browser end based on image processing according to the present invention;
FIG. 4 is a graph of the operation result of the APP terminal of the flue-cured tobacco planting guidance mobile phone based on image processing.
Detailed Description
For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
A flue-cured tobacco planting guidance system based on image processing comprises a server side, a browser side and a mobile side APP; the server end comprises a tobacco leaf and tobacco plant image preprocessing module, a tobacco leaf and tobacco plant image feature extraction module, a tobacco leaf and tobacco plant image classification module, a communication module and a database module; encapsulating the processing process of the flue-cured tobacco image into a function in a dynamic link library mode, and calling the function of the server side when the browser side or the mobile side requests to evaluate the growth condition of the flue-cured tobacco;
the browser end comprises a user homepage module, a flue-cured tobacco evaluation module and a flue-cured tobacco evaluation recording module, and after a user uploads images of tobacco leaves and tobacco plants locally, the user sends a request to the server end through the Internet to analyze and process the images, so that the on-line evaluation and planting guidance of water and fertilizer and growth of the flue-cured tobacco is achieved; the mobile terminal APP comprises an image acquisition module, a user homepage module, a flue-cured tobacco evaluation module and a flue-cured tobacco evaluation recording module, and after a user calls a mobile phone camera to shoot or upload images of tobacco leaves and tobacco plants locally, the user sends a request to the server terminal through a mobile network, so that flue-cured tobacco on-line evaluation and planting guidance are completed, and functions of inquiring and deleting evaluation records are achieved.
The image acquisition module is a camera of a common mobile phone, and when a user wants to know the growth condition of the flue-cured tobacco, images of the tobacco leaves and the tobacco plants are shot by the mobile phone camera according to a certain shooting standard.
The communication module is used for communication between the client and the server, and after the flue-cured tobacco image is collected, the photo and related information are sent to the server through the communication module; and after the flue-cured tobacco image is processed by the program of the server, writing the result into the database through the communication module and displaying the result back to the client.
And the database module is used for storing the information recorded by each flue-cured tobacco photo, and comprises the production area, the variety, the growth period and the year, the water and fertilizer grade of tobacco leaves, the growth grade of tobacco plants and corresponding planting guidance opinions.
The tobacco leaf and tobacco plant image preprocessing module is used for removing information irrelevant to a research object in an image, simplifying data information of the image, recovering information relevant to the research object in the image, enhancing the reliability of the image and improving the image quality, so that the follow-up feature extraction is guaranteed. After the flue-cured tobacco image is collected and sent to a server-side application program, the tobacco image is subjected to smoothing, sharpening and segmentation preprocessing, and the tobacco plant image is subjected to segmentation processing.
And the tobacco leaf and tobacco plant image feature extraction module is used for extracting features reflecting the water and fertilizer of the tobacco leaves and the growth vigor of the tobacco plants. After passing through the flue-cured tobacco image preprocessing module, the color features of the tobacco leaf image are extracted, including R, G, B features of RGB color space and H, I, S features of HSI color space, and the geometric features of the tobacco plant image are extracted, including plant height, plant width and leaf pixel ratio (proportion of tobacco plants to picture pixels).
And the tobacco leaf and tobacco plant image classification module is used for classifying water, fertilizer and growth vigor of the flue-cured tobacco images. After the flue-cured tobacco image features are extracted by the flue-cured tobacco image feature extraction module, the flue-cured tobacco image features are classified by using a near selection principle in fuzzy pattern recognition, and a planting guidance suggestion is given according to the grade of the flue-cured tobacco.
And the user homepage module of the client is used for sending instructions, uploading information and displaying results of the system.
The flue-cured tobacco evaluation module comprises a mobile terminal APP and a browser terminal, and is used for on-line evaluation of the growth condition of flue-cured tobacco and decision-making of planting guidance opinions. When the user uploads the images of the tobacco leaves and the tobacco plants to be evaluated, the production place, the variety, the growth period and the year of the images are selected. Then clicking an evaluation button, the system gives the water and fertilizer of the tobacco leaves and the growth rate of tobacco plants and planting guidance suggestions within two seconds.
The flue-cured tobacco evaluation recording module is used for inquiring information in the historical evaluation records, can help users to quickly inquire the data of the growth conditions of flue-cured tobaccos in different production areas, varieties and years, and is favorable for the analysis of the growth conditions of the flue-cured tobaccos by the users.
In this embodiment, the processing process of the flue-cured tobacco image encapsulated as a function specifically includes:
(1) and (4) image acquisition and uploading.
As can be seen from fig. 1 and 2, the system has two data flow directions, one is a mobile phone APP end, and the other is a browser end. When a user uses a mobile phone APP to evaluate, photos of tobacco leaves and tobacco plants in corresponding periods need to be shot, and photo information needs to be input; if the user uses a browser, only the images of the tobacco leaves and the tobacco plants are uploaded from the local place and the photo information is input. These pictures and information are transmitted to the Web server through a communication module (HTTP protocol), and the Web server calls an application program of image processing through an API interface.
(2) And (5) image preprocessing.
The flue-cured tobacco image needs to be subjected to photoelectric conversion in the acquisition process, and the image is noisy in the process. Therefore, the tobacco leaf images uploaded from the client terminal need to be preprocessed. Image smoothing is one type of pre-processing that can eliminate or attenuate image noise. The median filtering method is a non-linear smoothing technique, which takes the pixel as a unit, sorts the data sequence in the template, and replaces the current pixel value with the value in the middle of each point in the neighborhood. The expression for two-dimensional median filtering is:
g(x,y)=med{f(x-k,y-l),(k,l∈w)}
where f (x-k, y-l), g (x, y) are the original image and the smoothed image, respectively, and w is a two-dimensional template, typically 3 × 3, 5 × 5, 7 × 7, etc.
The tobacco leaf image is smoothed and the pixels are subjected to an averaging or integration operation, thus becoming blurred. In order to make the outline and the boundary of the image clear, reduce the adverse effect caused by the smoothing processing and highlight more characteristic information so as to more fully extract the color characteristic of the tobacco leaf, the tobacco leaf image needs to be sharpened. The Laplacian operator belongs to a second-order sharpening algorithm, which is a main means for image sharpening, and if f is a second-order differentiable real function, the Laplacian operator of f (x, y) is defined as:
Figure GDA0003134010710000071
wherein f (x, y) is a picture pixel point.
The background is complex in the flue-cured tobacco image acquisition process, the background and the tobacco leaf or tobacco plant image are inevitably acquired together, and the extraction of the characteristic parameters of the tobacco leaf and the tobacco plant can be influenced by the color of the background. The GrabCut algorithm is adopted for image segmentation, but the algorithm needs to select a target area, simply marks the front background and the rear background, and can be converged through multiple iterations, so that the speed is low. Aiming at the defect that the algorithm needs user interaction, the system constructs a marking function by scattering points representing the foreground and the background. The specific improved algorithm steps are as follows:
step 1: and (4) performing frame selection on the tobacco leaf or tobacco plant image by using an OpenCV (open circuit vehicle) self-contained rectangle drawing function, wherein the size of the rectangle is the length of the side of the original image minus 5-10 pixel points.
Step 2: points representing the background are scattered to four corners of the target rectangular area, and points representing the foreground are scattered to the middle of the rectangle.
Step 3: and randomly scattering a small number of foreground points and background points on other parts of the target rectangular area.
(3) And extracting and normalizing image features.
After image preprocessing, the feature extraction of the flue-cured tobacco image is easier and more accurate. The water and fertilizer of tobacco leaves are directly related to color characteristics. The RGB model can determine the color of a pixel point, the processing speed is high, but the RGB model is greatly influenced by illumination and cannot separate the intensity information of the color. The HSI model belongs to polar coordinate space definition and is capable of separating intensity information of colors. Therefore, the present system uses these two color space models, namely R, G, B, H, S and I six features of the extracted tobacco leaf. The tobacco leaf characteristic extraction steps are as follows:
step 1: carrying out pixel cyclic scanning on the segmented tobacco leaf image, judging whether a pixel point is black or not, and if so, scanning the next pixel point; if not, go to Step 2.
Step 2: the values of the components of the non-black pixels R, G, B are calculated.
Step 3: the mean value of H, S, I for the piece of tobacco was calculated according to the formula.
Step 4: judging whether the pixel is scanned completely, if not, returning to Step 1; if yes, the average value of R, G, B, H, S and I of all non-black pixels is calculated, and the average value is the characteristic value of the tobacco lamina.
The growth vigor of the tobacco plants is influenced by a plurality of factors and is finally shown on the appearance characteristics of the tobacco plants, and the system extracts three characteristics of plant height, plant width and phyllotoxin ratio. The phyllotoxin ratio of tobacco plants is extracted first, and therefore, the divided tobacco plant images need to be binarized. And (4) counting the white pixels in the binary image, and calculating the proportion of the white pixels in the total pixels of the image to obtain the leaf pixel ratio of the tobacco plant. And then extracting the plant height and the plant width, wherein the outline and the circumscribed rectangle of the tobacco plant need to be extracted, and the plant height and the plant width can be calculated according to the vertex of the circumscribed rectangle.
After the features are extracted, in order to eliminate the influence of feature values of different dimensions in the feature vector, meanwhile, the calculation of the closeness in the classification algorithm is convenient, the running time is reduced, and the feature values need to be normalized. The system provides a new normalization method, considers the different influence degrees of different characteristic parameters on the classification of the flue-cured tobacco, and is more in line with theory and practice, and the calculation formula is as follows:
Figure GDA0003134010710000081
where m is the number of samples, n is the number of features, i and k represent the ith sample and the kth feature, respectively, xikIs a characteristic value before normalization, x'ikIs a normalized characteristic value, wkIs the weight of the kth feature。
(4) Image grading and planting guidance opinions
The purpose of feature extraction is to grade flue-cured tobacco images. The difference between the tobacco leaf and the tobacco plant image levels is small, the tobacco leaf and the tobacco plant image levels are difficult to distinguish by naked eyes, the difference is often between the two levels, and it is difficult to accurately define the grade of a certain tobacco leaf or a certain tobacco plant. Therefore, the flue-cured tobacco image is graded by adopting a near selection principle in fuzzy pattern recognition.
Let the color characteristics of the identified tobacco leaves be x respectively1=R,x2=G,x3=B,x4=H,x5=S,x6I, the geometric characteristics of the tobacco plant are y1,y2,y3,y1Is the pixel height, y2Is pixel width, y3The ratio of the two is expressed as the ratio of the two. Thus forming the tobacco leaf characteristic vector X ═ X1,x2 x3,x4,x5,x6) And the tobacco plant characteristic vector Y ═ (Y)1,y2,y3). The standard model base of the tobacco leaf and tobacco plant images is set as U ═ A respectively1,A2,A3,A4) And V ═ B1,B2,B3,B4) Wherein A is1,A2,A3,A4Representing four grades of water and fertilizer of tobacco leaves, B1,B2,B3,B4Representing four grades of tobacco plant growth. The algorithm flow is as follows:
step 1: inputting tobacco leaf and tobacco plant grade samples classified by experts, extracting characteristic values of images of the tobacco leaves and the tobacco plants, calculating the mean value of characteristic parameters of the images of the tobacco leaves and the tobacco plants at the same grade, and establishing a tobacco leaf and tobacco plant image standard grade characteristic vector library.
Step 2: normalizing each feature in the feature vector library according to a normalization formula to form a fuzzy matrix A for evaluating the image grades of the tobacco leaves and the tobacco plantsiI is not less than 1 and not more than 4 and Bj,1≤j≤4。
Step 3: inputting images of tobacco leaves and tobacco plants to be identified, extracting characteristic values of the images of the tobacco leaves and the tobacco plants to form characteristic vectors, normalizing the characteristic vectors to form fuzzy vectors X and Y.
Step 4: calculating standard grade fuzzy sets A of X and Y and tobacco leaves and tobacco plants respectively by using a maximum and minimum closeness formula in a near selection principleiAnd BjProximity of eta (X, A)i) And eta (Y, B)j) Calculating the maximum closeness eta of the images of the tobacco leaves and the tobacco plantsmax1And ηmax2
Step 5: comparison etamax1And η (X, A)i) Obtaining the grade of the tobacco leaves; comparison etamax2And eta (Y, B)j) And obtaining the grade of the tobacco plant.
Before the planting guidance opinions are output, an expert is needed to establish a planting guidance opinion expert base for the standard sample, and then the system provides corresponding planting guidance opinions according to the evaluated grades of the tobacco leaves and the tobacco plants.
(5) Evaluation result output and display
The grading result and the planting guidance opinions obtained through the image processing are written into the database through a communication module (API), and are displayed back to the client through a communication module (http), and the operation results of the system on the mobile phone APP and the browser are shown in the figures 3 and 4.
The method can realize the on-line evaluation of the growth condition of the flue-cured tobacco, gives out the planting guidance suggestion, solves the problems of long time consumption, strong subjectivity and low accuracy rate caused by artificial evaluation, and has important significance for improving the yield and quality of the flue-cured tobacco.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (7)

1. A flue-cured tobacco planting guidance system based on image processing is characterized by comprising a server end, a browser end and a mobile end APP; the server end comprises a tobacco leaf and tobacco plant image preprocessing module, a tobacco leaf and tobacco plant image feature extraction module, a tobacco leaf and tobacco plant image classification module, a communication module and a database module; the processing process of the flue-cured tobacco image is encapsulated into a function in a dynamic link library mode and stored in a server side, and when a browser side or a mobile side requests to evaluate the growth condition of the flue-cured tobacco, the function of the server side is called;
the browser end comprises a user homepage module, a flue-cured tobacco evaluation module and a flue-cured tobacco evaluation recording module, after a user uploads images of tobacco leaves and tobacco plants locally, a request is sent to the server end through the Internet, and the server end analyzes and processes the images, so that on-line evaluation and planting guidance of water and fertilizer and growth of the flue-cured tobacco are achieved; the mobile terminal APP comprises an image acquisition module, a user homepage module, a flue-cured tobacco evaluation module and a flue-cured tobacco evaluation recording module, and after a user calls a mobile phone camera to shoot or locally upload images of tobacco leaves and tobacco plants, the user sends a request to the server terminal through a mobile network to complete online evaluation and planting guidance of flue-cured tobacco and evaluate, record, inquire and delete functions;
the pretreatment process of the tobacco leaf and tobacco plant image pretreatment module specifically comprises the following steps:
firstly, smoothing the collected tobacco leaf or tobacco plant images by adopting a median filtering method, sequencing data sequences in a template by taking pixels as units, replacing the current pixel value with the value in the middle of each point in the neighborhood, wherein the expression of two-dimensional median filtering is as follows:
g(x,y)=med{f(x-k,y-l),(k,l∈w)},
wherein f (x-k, y-l), g (x, y) are the original image and the smoothed image respectively, and w is a two-dimensional template;
then sharpening the tobacco leaf or tobacco plant image by adopting a Laplacian operator second-order sharpening algorithm, setting f to be a second-order differentiable real function, and defining the Laplacian operator of f (x, y) as:
Figure FDA0003134010700000011
wherein f (x, y) is a picture pixel point;
and finally, carrying out image segmentation by adopting an improved GrabCut algorithm, wherein the improved algorithm is as follows:
using an OpenCV (open circuit graphics for content analysis) self-contained rectangle drawing function to frame the tobacco leaf or tobacco plant image, wherein the size of a rectangle is that the side length of an original image is reduced by 5-10 pixel points, broadcasting points representing the background to four corners of a target rectangular area, broadcasting points representing the foreground to the middle of the rectangle, and randomly broadcasting a small number of foreground points and background points to other places of the target rectangular area;
finally, obtaining the tobacco leaf or tobacco plant image after smoothing, sharpening and segmentation processing;
the process of extracting the characteristics reflecting the water fertilizer and the growth vigor of the tobacco leaves and the tobacco plants by the tobacco leaf and tobacco plant image characteristic extraction module specifically comprises the following steps of:
after image preprocessing is completed, an RGB model and an HSI model are used for extracting R, G, B, H, S and I six characteristics of tobacco leaves, and the tobacco leaf characteristic extraction steps are as follows:
s1, carrying out pixel cycle scanning on the segmented tobacco leaf image, judging whether a pixel point is black or not, and if so, scanning the next pixel point; if not, go to S2;
s2, calculating the value of each component of the non-black pixel R, G, B;
s3, calculating the mean value of H, S, I of the tobacco leaves according to a model formula;
s4, judging whether the pixel is scanned completely, if not, returning to S1; if yes, calculating the average value of R, G, B, H, S and I of all non-black pixels, namely the characteristic value of the tobacco leaf;
after the characteristics are extracted, the characteristic values are normalized to facilitate subsequent data processing, and the calculation formula is as follows:
Figure FDA0003134010700000021
where m is the number of samples, n is the number of features, i and k represent the ith sample and the kth feature, respectively, xikIs a characteristic value before normalization, x'ikIs a normalized characteristic value, wkIs the weight of the kth feature;
finally obtaining a characteristic value after normalization processing;
the process of classifying the water, fertilizer and growth vigor of the flue-cured tobacco image by the tobacco leaf and tobacco plant image classification module specifically comprises the following steps:
after the characteristic extraction is completed, grading the flue-cured tobacco image, and grading the flue-cured tobacco image by adopting a near selection principle in fuzzy pattern recognition:
let the color characteristics of the identified tobacco leaves be x respectively1=R,x2=G,x3=B,x4=H,x5=S,x6I, the geometric characteristics of the tobacco plant are y1,y2,y3,y1Is the pixel height, y2Is pixel width, y3The leaf element ratio is obtained, so that the tobacco leaf characteristic vector X ═ X (X) is formed1,x2 x3,x4,x5,x6) And the tobacco plant characteristic vector Y ═ (Y)1,y2,y3) And respectively setting the standard model libraries of the images of the tobacco leaves and the tobacco plants as U ═ A1,A2,A3,A4) And V ═ B1,B2,B3,B4) Wherein A is1,A2,A3,A4Representing four grades of water and fertilizer of tobacco leaves, B1,B2,B3,B4Representing four grades of tobacco plant growth, the algorithm flow is as follows:
inputting tobacco leaf and tobacco plant grade samples classified by experts, extracting characteristic values of images of the tobacco leaves and the tobacco plants, calculating the mean value of characteristic parameters of the images of the tobacco leaves and the tobacco plants at the same grade, and establishing a tobacco leaf and tobacco plant image standard grade characteristic vector library;
normalizing each feature in the feature vector library according to a normalization formula to form a fuzzy matrix A for evaluating the image grades of the tobacco leaves and the tobacco plantsiI is not less than 1 and not more than 4 and Bj,1≤j≤4;
Inputting images of tobacco leaves and tobacco plants to be identified, extracting characteristic values of the images of the tobacco leaves and the tobacco plants to form characteristic vectors, normalizing the characteristic vectors to form fuzzy vectors X and Y;
calculating standard grade fuzzy sets A of X and Y and tobacco leaves and tobacco plants respectively by using a maximum and minimum closeness formula in a near selection principleiAnd BjProximity of eta (X, A)i) And eta (Y, B)j) Calculating the maximum closeness eta of the images of the tobacco leaves and the tobacco plantsmax1And ηmax2
Comparison etamax1And η (X, A)i) Obtaining the grade of the tobacco leaves; comparison etamax2And eta (Y, B)j) Obtaining the grade of the tobacco plant;
and finally, the system gives corresponding planting guidance suggestions according to the evaluated grades of the tobacco leaves and the tobacco plants.
2. The image processing-based flue-cured tobacco planting guidance system according to claim 1, wherein the image acquisition module is a camera of a mobile phone, and when a user wants to know the growth condition of the flue-cured tobacco, images of the tobacco leaves and the tobacco plants are shot by the camera of the mobile phone according to a certain shooting standard.
3. The image processing-based flue-cured tobacco planting guidance system according to claim 1, wherein the communication module is used for communication between the client and the server, and after the flue-cured tobacco image is collected, the photo and related information are sent to the server through the communication module; and after the flue-cured tobacco image is processed by the program of the server, writing the result into the database through the communication module and displaying the result back to the browser end or the mobile end APP.
4. The image processing-based flue-cured tobacco planting guidance system according to claim 1, characterized in that the database module is used for storing information recorded by each flue-cured tobacco photo, including producing area, variety, growth period, year, and water and fertilizer grade of tobacco leaves, growth grade of tobacco plants and corresponding planting guidance opinions.
5. The image processing-based flue-cured tobacco planting guidance system according to claim 1, characterized in that the functions of the user homepage modules of the mobile terminal APP and the browser terminal are the same and are used for sending instructions, uploading information and displaying results.
6. The image processing-based flue-cured tobacco planting guidance system according to claim 1, characterized in that the flue-cured tobacco evaluation modules of the mobile terminal APP and the browser terminal have the same functions and are used for on-line evaluation of the growth condition of the flue-cured tobacco and decision-making of planting guidance opinions, and when a user uploads images of tobacco leaves and tobacco plants to be evaluated and selects the production area, variety, growth period and year of the images, the system gives the grade of water and fertilizer of the tobacco leaves and the growth vigor of the tobacco plants and the planting guidance opinions.
7. The flue-cured tobacco planting guidance system based on image processing as claimed in claim 1, characterized in that the flue-cured tobacco evaluation recording modules included by the mobile terminal APP and the browser terminal have the same function and are all used for querying information in historical evaluation records, so that a user can be helped to rapidly query data of flue-cured tobacco growth conditions of different production places, varieties and years, and the analysis of the flue-cured tobacco growth conditions by the user is facilitated.
CN201910250565.8A 2019-03-29 2019-03-29 Flue-cured tobacco planting guidance system based on image processing Expired - Fee Related CN110111263B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910250565.8A CN110111263B (en) 2019-03-29 2019-03-29 Flue-cured tobacco planting guidance system based on image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910250565.8A CN110111263B (en) 2019-03-29 2019-03-29 Flue-cured tobacco planting guidance system based on image processing

Publications (2)

Publication Number Publication Date
CN110111263A CN110111263A (en) 2019-08-09
CN110111263B true CN110111263B (en) 2021-08-27

Family

ID=67484834

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910250565.8A Expired - Fee Related CN110111263B (en) 2019-03-29 2019-03-29 Flue-cured tobacco planting guidance system based on image processing

Country Status (1)

Country Link
CN (1) CN110111263B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112949663B (en) * 2021-01-28 2024-01-23 贵州省烟草科学研究院 Tobacco leaf baking control system and method based on image recognition
CN114119612A (en) * 2022-01-25 2022-03-01 武汉精立电子技术有限公司 Picture-based appearance detection method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101762583A (en) * 2009-12-16 2010-06-30 中国烟草总公司郑州烟草研究院 Method for characterizing color of characteristic tobacco by place of origin
CN103743486A (en) * 2014-01-02 2014-04-23 上海大学 Automatic grading system and method based on mass tobacco leaf data
CN104268834A (en) * 2014-09-19 2015-01-07 贵州大学 Standard-grade tobacco leaf image database synthetic method based on digital image processing technique
CN108268895A (en) * 2018-01-12 2018-07-10 上海烟草集团有限责任公司 The recognition methods of tobacco leaf position, electronic equipment and storage medium based on machine vision
CN108427971A (en) * 2018-04-19 2018-08-21 云南佳叶现代农业发展有限公司 The method and system of tobacco leaf grading based on mobile terminal

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SU701573A1 (en) * 1978-06-12 1979-12-05 Всесоюзный Научно-Исследовательский Институт Табака И Махорки Им. А.И.Микояна Apparatus for inserting and retaining plants in the working bed of a tobacco harvester
DE19817609C1 (en) * 1998-04-21 2000-02-24 Leo Knoll Tobacco harvester
CN104866970B (en) * 2015-05-26 2018-07-24 徐吉祥 Intelligent Cultivate administration method and intelligent planting equipment
CN204808033U (en) * 2015-07-14 2015-11-25 田虎 Intelligence horticulture system
CN105510335B (en) * 2015-12-21 2018-01-16 厦门脉控电子技术有限公司 A kind of vegetation growth state detection method of Domestic planting machine
CN105467959B (en) * 2015-12-21 2018-03-13 厦门脉控电子技术有限公司 Domestic planting machine system and its control method based on wireless telecommunications
CN105630045B (en) * 2015-12-28 2018-03-20 北京联合大学 A kind of intelligent system and method for raising flowers
CN105631451A (en) * 2016-01-07 2016-06-01 同济大学 Plant leave identification method based on android system
CN106372196A (en) * 2016-08-31 2017-02-01 北京小米移动软件有限公司 Plantation management method and system and terminal
CN108650321A (en) * 2018-05-16 2018-10-12 河南科技大学 A kind of intelligence vegetable garden control system and its control method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101762583A (en) * 2009-12-16 2010-06-30 中国烟草总公司郑州烟草研究院 Method for characterizing color of characteristic tobacco by place of origin
CN103743486A (en) * 2014-01-02 2014-04-23 上海大学 Automatic grading system and method based on mass tobacco leaf data
CN104268834A (en) * 2014-09-19 2015-01-07 贵州大学 Standard-grade tobacco leaf image database synthetic method based on digital image processing technique
CN108268895A (en) * 2018-01-12 2018-07-10 上海烟草集团有限责任公司 The recognition methods of tobacco leaf position, electronic equipment and storage medium based on machine vision
CN108427971A (en) * 2018-04-19 2018-08-21 云南佳叶现代农业发展有限公司 The method and system of tobacco leaf grading based on mobile terminal

Also Published As

Publication number Publication date
CN110111263A (en) 2019-08-09

Similar Documents

Publication Publication Date Title
CN108562589B (en) Method for detecting surface defects of magnetic circuit material
CN108960245B (en) Tire mold character detection and recognition method, device, equipment and storage medium
CN110705655A (en) Tobacco leaf classification method based on coupling of spectrum and machine vision
CN108319894A (en) Fruit recognition methods based on deep learning and device
CN110111263B (en) Flue-cured tobacco planting guidance system based on image processing
CN113920453A (en) Pig body size weight estimation method based on deep learning
El Khoury et al. Color and sharpness assessment of single image dehazing
CN106446968A (en) FPGA (field programmable gate array)-based automatic tobacco leaf grading system
CN114926407A (en) Steel surface defect detection system based on deep learning
CN111199192A (en) Method for detecting integral maturity of field red globe grapes by adopting parallel line sampling
Marzan et al. Automated tobacco grading using image processing techniques and a convolutional neural network
CN112464762A (en) Agricultural product screening system and method based on image processing
CN115099297A (en) Soybean plant phenotype data statistical method based on improved YOLO v5 model
Hortinela et al. Classification of Cacao Beans Based on their External Physical Features Using Convolutional Neural Network
CN114299059A (en) Method for judging scratch defects of unsorted casting blanks on surfaces of hot-rolled strip steel
CN114612399A (en) Picture identification system and method for mobile phone appearance mark
CN114399480A (en) Method and device for detecting severity of vegetable leaf disease
CN116524279A (en) Artificial intelligent image recognition crop growth condition analysis method for digital agriculture
Sulaiman et al. Automatic grading system for oil palm fruit ripeness
Portalés et al. An image-based system to preliminary assess the quality of grape harvest batches on arrival at the winery
CN113610185B (en) Wood color sorting method based on dominant hue identification
Rony et al. BottleNet18: Deep Learning-Based Bottle Gourd Leaf Disease Classification
CN115760594A (en) Cigarette detection and identification method based on deep learning
CN114548250A (en) Mobile phone appearance detection method and device based on data analysis
CN113569880A (en) Rapid primary sorting system and method for naturally curled tobacco leaves after baking

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20210827

CF01 Termination of patent right due to non-payment of annual fee