CN110443272A - A kind of complicated cigarette strain image classification method based on fuzzy selecting rules - Google Patents
A kind of complicated cigarette strain image classification method based on fuzzy selecting rules Download PDFInfo
- Publication number
- CN110443272A CN110443272A CN201910548945.XA CN201910548945A CN110443272A CN 110443272 A CN110443272 A CN 110443272A CN 201910548945 A CN201910548945 A CN 201910548945A CN 110443272 A CN110443272 A CN 110443272A
- Authority
- CN
- China
- Prior art keywords
- cigarette strain
- image
- pixel
- cigarette
- strain
- 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
Links
- 235000019504 cigarettes Nutrition 0.000 title claims abstract description 278
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000010606 normalization Methods 0.000 claims abstract description 26
- 239000011159 matrix material Substances 0.000 claims description 6
- 230000006872 improvement Effects 0.000 claims description 5
- 230000008859 change Effects 0.000 claims description 4
- 239000000284 extract Substances 0.000 claims description 4
- 210000005252 bulbus oculi Anatomy 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 claims description 3
- 239000000203 mixture Substances 0.000 claims description 3
- 238000011524 similarity measure Methods 0.000 claims description 3
- 238000009331 sowing Methods 0.000 claims description 3
- 238000009394 selective breeding Methods 0.000 claims 1
- 241000196324 Embryophyta Species 0.000 abstract description 15
- 241000208125 Nicotiana Species 0.000 abstract description 12
- 235000002637 Nicotiana tabacum Nutrition 0.000 abstract description 12
- 230000011218 segmentation Effects 0.000 abstract description 11
- 230000000694 effects Effects 0.000 abstract description 9
- 238000000605 extraction Methods 0.000 abstract description 6
- 230000003993 interaction Effects 0.000 abstract description 3
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 230000008901 benefit Effects 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 238000000638 solvent extraction Methods 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 241001057636 Dracaena deremensis Species 0.000 description 1
- 241000209140 Triticum Species 0.000 description 1
- 235000021307 Triticum Nutrition 0.000 description 1
- 240000008042 Zea mays Species 0.000 description 1
- 235000005824 Zea mays ssp. parviglumis Nutrition 0.000 description 1
- 235000002017 Zea mays subsp mays Nutrition 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 235000005822 corn Nutrition 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 210000001508 eye Anatomy 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000003595 mist Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2413—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on distances to training or reference patterns
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/28—Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The present invention provides a kind of complicated cigarette strain image classification method based on fuzzy selecting rules, comprising: initially set up cigarette strain master pattern library, and the image of cigarette strain to be sorted is acquired;Then using improved GrabCut algorithm in the cigarette strain image cigarette strain and image background be split;And then binaryzation is carried out to the cigarette strain image after removal background, and then feature extraction is carried out to the cigarette strain image after binaryzation, obtain wide three characteristic values of foline ratio, pixel plant height and pixel strain of cigarette strain to be sorted;The foline ratio, pixel plant height and wide three characteristic values of pixel strain are normalized again;Finally according to after normalization three characteristic values and cigarette strain master pattern library, classified using fuzzy selecting rules to cigarette strain to be sorted, obtain the classification results of cigarette strain to be sorted.The beneficial effects of the present invention are: segmentation effect is good, and avoid human-computer interaction;More accurately to reflect influence of each feature to tobacco growing;Improve cigarette strain classification accuracy.
Description
Technical field
The present invention relates to IT application to agriculture field more particularly to a kind of complicated cigarette strain images based on fuzzy selecting rules point
Class method.
Background technique
Tobacco is the important industrial crops in China, is played a crucial role in agricultural product.In cigarette strain growth course
In there are four important period: Stage of Top Dressing is taken off the compartment phase on film, Topping Stage and adopts the roasting phase.In the meantime, the quality of cigarette strain growing way is straight
Connect the yield and quality for influencing tobacco leaf.Therefore, how in each period the growing way situation of cigarette strain is accurately grasped, is related to final effect
Benefit.In conventional methods where, come the growing way situation for judging cigarette strain in such a way that eye is seen and hand is touched, then rule of thumb tobacco grower is
It takes appropriate measures.However this mode is influenced by subjective factor, and it can be because of all ages and classes, the tobacco grower of Different Culture degree leads
Cause the result difference of judgement larger.
With the development of image processing techniques so that tobacco image is detected and is identified by computer become can
Can, however since tobacco Image Acquisition is in farmland, background is complicated, is illuminated by the light, the weather such as rainwater are affected, therefore, how right
Complicated cigarette strain image, which carries out identification, becomes the difficult point of research.
Existing research be all by special image collecting device, such as PMD depth camera to the corn of Seedling Stage or
Person's wheat image is acquired, and is then measured using specific algorithm to corn plant height, stem thickness and Leaf inclination.However, right
But rarely has research in the extraction of cigarette strain parameter, and the relationship between these parameters and cigarette strain growing way is related to not yet.Moreover, In
In actual production process, tobacco grower without specific image collecting device, can only often be shot by mobile phone.
Summary of the invention
To solve the above-mentioned problems, the present invention provides a kind of complicated cigarette strain image classification side based on fuzzy selecting rules
Method.
A kind of complicated cigarette strain image classification method based on fuzzy selecting rules, mainly comprises the steps that
S101: cigarette strain master pattern library is established;And the image of cigarette strain to be sorted is acquired, obtain cigarette strain to be sorted
Image;It include multiple cigarette strain image patterns, the cigarette strain image pattern and the cigarette strain to be sorted in the master pattern library
The acquisition method of image is the same;And each cigarette strain image pattern has a growing way grade label;
S102: using improved GrabCut algorithm in the cigarette strain image cigarette strain and image background be split, obtain
Cigarette strain image to after removal background;
S103: to it is described removal background after cigarette strain image carry out binaryzation, and then to the cigarette strain image after binaryzation into
Row feature extraction obtains wide three characteristic values of foline ratio, pixel plant height and pixel strain of cigarette strain to be sorted;
S104: the foline ratio, pixel plant height and wide three characteristic values of pixel strain are normalized, after obtaining normalization
Three characteristic values;
S105: according to after normalization three characteristic values and cigarette strain master pattern library, using fuzzy selecting rules pair
The growing way grade of the cigarette strain to be sorted is classified, and the growing way classification results of the cigarette strain to be sorted are obtained.
Further, in step S101, cigarette strain master pattern library includes four grades for representing cigarette strain growing way: one
Grade, second level, three-level and level Four, respectively correspond cigarette strain attribute classification it is excellent, good, neutralize it is poor;And each grade includes multiple presses
According to the cigarette strain image pattern of acquisition standard acquisition;The acquisition standard are as follows: acquisition cigarette strain image when, shooting tool need to cigarette strain just
Top h meters of distance is with the angle shot perpendicular to ground, and cigarette strain is located at the middle part of whole image;Wherein, h is preset value, h
Value range be [1.9,2.1].
Further, in step S102, the improvement of the improved GrabCut algorithm are as follows: change tradition GrabCut algorithm
The shortcomings that manually choosing cigarette strain and background pixel is needed, proposes a kind of automatic method for choosing cigarette strain pixel and background pixel, tool
Body includes:
Firstly, being selected using the picture rectangular function that OpenCV is carried the cigarette strain in the cigarette strain image, to use
Cigarette strain in the cigarette strain image is framed by rectangle frame;The size of the rectangle frame is that the cigarette strain image side length subtracts t picture
Element value;Wherein, t is preset value, and the value range of t is [5,10];
Then, the pixel for representing background is sowed using four angles of the RNG class of OpenCV to the rectangle frame region
Point, to the pixel for representing cigarette strain is sowed in the middle part of the rectangle frame region, to other of the rectangle frame region
The pixel of the local representative cigarette strain for sowing preset quantity at random and the pixel for representing background;
Finally, according to the pixel for representing background and the pixel for representing cigarette strain, using traditional GrabCut
Algorithm is removed the background in the cigarette strain image, to obtain the cigarette strain image after removal background.
Further, in step S103, binaryzation is carried out to the cigarette strain image after the removal background, after obtaining binaryzation
Cigarette strain image, and then cigarette strain feature is extracted according to the cigarette strain image after the binaryzation;It specifically includes:
S301: binaryzation is carried out to the cigarette strain image after the removal background, the cigarette strain image after obtaining binaryzation;It is described
Cigarette strain image after binaryzation only includes the pixel of multiple whites and the pixel of multiple black;Wherein, threshold when binaryzation
Value preset threshold value for the growth period according to locating for cigarette strain to be sorted;
S302: counting the white pixel point in the cigarette strain image after binaryzation, obtains total of white pixel point
Number a;Foline ratio v is calculated according to the following formula:
In above formula, sum is the pixel total number in the cigarette strain image after the binaryzation;
S303: using the findContours function in OpenCV to all wheels in the cigarette strain image after the binaryzation
Exterior feature is searched, and multiple profiles are obtained;And then the pixel of each profile is drawn using the drawContours function in OpenCV
Point set;
S304: for profile described in each, according to its corresponding point set, using the boundingRect letter in OpenCV
Number draws the positive boundary rectangle of the profile;All profiles are traversed, and then obtain the contoured positive boundary rectangle of institute;
S305: by the size of contoured positive boundary rectangle compare, select the maximum positive boundary rectangle of area to make
For the pixel plant height of a length of cigarette strain of the height of cigarette strain, quant's sign value and the maximum positive boundary rectangle of the area, the area is most
The width of big positive boundary rectangle is that the pixel strain of cigarette strain is wide.
Further, in step S104, three characteristic values are normalized according to such as following formula:
In above formula, xkFor the characteristic value before normalization, x 'kFor the characteristic value after normalization, n is characterized quantity, n=3, k table
Show k-th of feature, wkIt is preset value for the weight coefficient of k-th of feature.
Further, in step S105, according to after normalization three characteristic values and cigarette strain master pattern library, use
Fuzzy selecting rules classify to the cigarette strain to be sorted, obtain the classification results of the cigarette strain to be sorted;It specifically includes:
S401: the master pattern library is U=(A1,A2,A3,A4), wherein A1,A2,A3,A4Respectively represent cigarette strain growing way
Four grades: level-one, second level, three-level and level Four;
S402: it is normalized using feature of the following formula to all eyeball image patterns in the master pattern library;
The fuzzy matrix A ' of cigarette strain image gradation evaluation after to normalizationi:
In above formula, xikFor the characteristic value before normalization, x 'ikFor the characteristic value after normalization, m is characterized value xikAffiliated cigarette
Total cigarette strain image pattern quantity of the strain affiliated grade of image, n are characterized quantity, n=3;I and k respectively indicates i-th of sample and
K feature, wkIt is preset value for the weight coefficient of k-th of characteristic parameter;1≤i≤4;
S403: inputting cigarette strain image to be identified, extracts each characteristic value of cigarette strain image, and composition characteristic vector simultaneously normalizes,
Form fuzzy vector X;
S404: using the minimax similarity measures in Similarity Principle, calculate separately the cigarette strain image obscure to
Measure X and A 'iClose to degree value;
In above formula, X=(x1,x2,x3), x1For the pixel plant height of cigarette strain to be sorted, x2It is wide for the pixel strain of cigarette strain to be sorted,
x3For the foline ratio of cigarette strain to be sorted;The dimension that n is characterized, n=3;yiIndicate fuzzy set A 'iIth feature value;1≤i≤
4;
And then available η (X, A '1)、η(X,A′2) and η (X, A '3) three close to degree value;It is maximum in selection three
One growing way classification grade close to grade belonging to fuzzy matrix corresponding to degree value as affiliated cigarette strain image.
It is following excellent that technical solution provided by the invention has the benefit that technical solution proposed by the invention has
Point:
(1) for the cigarette strain image under complex background, a kind of improved GrabCut partitioning algorithm, segmentation effect are proposed
It is good, and avoid human-computer interaction;
(2) a kind of growing way of new cigarette strain feature (foline ratio) Lai Fanying cigarette strain is proposed, the accuracy of classification is improved;
(3) a kind of new feature normalization method is proposed, can more accurately reflect each feature to tobacco growing
It influences;
(4) it is various for cigarette strain image classification factor in need of consideration, and is fuzzy feature, proposes one kind
The classification method of fuzzy selecting rules can preferably solve the problems, such as cigarette strain fuzzy classification, improve cigarette strain classification accuracy.
Detailed description of the invention
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is a kind of process of the complicated cigarette strain image classification method based on fuzzy selecting rules in the embodiment of the present invention
Figure;
Fig. 2 is that roasting phase cigarette strain image is adopted in the embodiment of the present invention;
Fig. 3 (a) is that roasting phase cigarette strain image tradition GrabCut algorithm segmentation figure is adopted in the embodiment of the present invention;
Fig. 3 (b) is GrabCut algorithm segmentation figure after adopting roasting phase cigarette strain image improvement in the embodiment of the present invention;
Fig. 4 is that roasting phase cigarette strain binary picture is adopted in the embodiment of the present invention;
Fig. 5 is that roasting phase cigarette strain plant height and the wide extraction figure of strain are adopted in the embodiment of the present invention.
Specific embodiment
For a clearer understanding of the technical characteristics, objects and effects of the present invention, now control attached drawing is described in detail
A specific embodiment of the invention.
The embodiment provides a kind of complicated cigarette strain image classification method based on fuzzy selecting rules.
Referring to FIG. 1, Fig. 1 is a kind of complicated cigarette strain image classification side based on fuzzy selecting rules in the embodiment of the present invention
The flow chart of method, specifically comprises the following steps:
S101: cigarette strain master pattern library is established;And the image of cigarette strain to be sorted is acquired, obtain cigarette strain to be sorted
Image;It include multiple cigarette strain image patterns, the cigarette strain image pattern and the cigarette strain to be sorted in the master pattern library
The acquisition method of image is the same;And each cigarette strain image pattern has a growing way grade label;
S102: using improved GrabCut algorithm in the cigarette strain image cigarette strain and image background be split, obtain
Cigarette strain image to after removal background;
S103: to it is described removal background after cigarette strain image carry out binaryzation, and then to the cigarette strain image after binaryzation into
Row feature extraction obtains wide three characteristic values of foline ratio, pixel plant height and pixel strain of cigarette strain to be sorted;
S104: the foline ratio, pixel plant height and wide three characteristic values of pixel strain are normalized, after obtaining normalization
Three characteristic values;
S105: according to after normalization three characteristic values and cigarette strain master pattern library, using fuzzy selecting rules pair
The growing way grade of the cigarette strain to be sorted is classified, and the growing way classification results of the cigarette strain to be sorted are obtained.
In step S101, cigarette strain master pattern library includes four grades for representing cigarette strain growing way: level-one, second level, three
Grade and level Four, respectively correspond cigarette strain attribute classification it is excellent, good, neutralize it is poor;And each grade includes multiple according to acquisition standard
The cigarette strain image pattern of acquisition;The acquisition standard are as follows: when acquisition cigarette strain image, shooting tool need to be h meters right above cigarette strain
Distance is with the angle shot perpendicular to ground, and cigarette strain is located at the middle part of whole image;Wherein, h is preset value, the value model of h
It encloses for [1.9,2.1].
In step S102, the improvement of the improved GrabCut algorithm are as follows: change tradition GrabCut algorithm and need manually
The shortcomings that choosing cigarette strain and background pixel proposes a kind of automatic method for choosing cigarette strain pixel and background pixel, specifically includes:
Firstly, being selected using the picture rectangular function that OpenCV is carried the cigarette strain in the cigarette strain image, to use
Cigarette strain in the cigarette strain image is framed by rectangle frame;The size of the rectangle frame is that the cigarette strain image side length subtracts t picture
Element value;Wherein, t is preset value, and the value range of t is [5,10];
Then, the pixel for representing background is sowed using four angles of the RNG class of OpenCV to the rectangle frame region
Point, to the pixel for representing cigarette strain is sowed in the middle part of the rectangle frame region, to other of the rectangle frame region
The pixel of the local representative cigarette strain for sowing preset quantity at random and the pixel for representing background;
Finally, according to the pixel for representing background and the pixel for representing cigarette strain, using traditional GrabCut
Algorithm is removed the background in the cigarette strain image, to obtain the cigarette strain image after removal background;It is specific as follows:
Step 1: using the rectangle frame region as initial pictures I;For the pixel of outer rectangular frame, all mark
It is denoted as background pixel Ib;For the pixel in box, in addition to the pixel for the representative background sowed, all label is for other
Strain pixel If;To IbInterior each pixel i, initialized pixel label pi=0, i.e. background pixel;To IfInterior each pixel j,
Initialized pixel label pj=1, i.e. cigarette strain pixel;
Step 2: pass through these pixels IbAnd IfTo estimate the GMM (mixed Gauss model) of cigarette strain and background;Pass through k-
Mean algorithm clusters respectively the pixel for belonging to cigarette strain and background for K class (K Gauss model);Each Gauss in GMM at this time
Model just has pixel samples collection, its mean value and covariance can be obtained by rgb value, and the weight of the Gauss model is to be somebody's turn to do
The number of pixels of Gauss model and the ratio of the total number of pixels of cigarette strain image;
Step 3: the Gauss model of each pixel distribution is substituted into target Gauss model;For given image data,
Optimize the parameter of mixed Gauss model;Partitioning estimation;
Step 4: iteration Step4, until convergence, and the boundary of segmentation is smoothed, after segmentation can be obtained
Cigarette strain image.
In step S103, binaryzation is carried out to the cigarette strain image after the removal background, the cigarette strain figure after obtaining binaryzation
Picture, and then cigarette strain feature is extracted according to the cigarette strain image after the binaryzation;It specifically includes:
S301: binaryzation is carried out to the cigarette strain image after the removal background, the cigarette strain image after obtaining binaryzation;It is described
Cigarette strain image after binaryzation only includes the pixel of multiple whites and the pixel of multiple black;Wherein, threshold when binaryzation
Value preset threshold value for the growth period according to locating for cigarette strain to be sorted;
S302: counting the white pixel point in the cigarette strain image after binaryzation, obtains total of white pixel point
Number a;Foline ratio v is calculated according to the following formula:
In above formula, sum is the pixel total number in the cigarette strain image after the binaryzation;
S303: using the findContours function in OpenCV to all wheels in the cigarette strain image after the binaryzation
Exterior feature is searched, and multiple profiles are obtained;And then the pixel of each profile is drawn using the drawContours function in OpenCV
Point set;
S304: for profile described in each, according to its corresponding point set, using the boundingRect letter in OpenCV
Number draws the positive boundary rectangle of the profile;All profiles are traversed, and then obtain the contoured positive boundary rectangle of institute;
S305: by the size of contoured positive boundary rectangle compare, select the maximum positive boundary rectangle of area to make
For the pixel plant height of a length of cigarette strain of the height of cigarette strain, quant's sign value and the maximum positive boundary rectangle of the area, the area is most
The width of big positive boundary rectangle is that the pixel strain of cigarette strain is wide.
In step S104, three characteristic values are normalized according to such as following formula:
In above formula, xkFor the characteristic value before normalization, x 'kFor the characteristic value after normalization, n is characterized quantity, n=3, k table
Show k-th of feature, wkIt is preset value for the weight coefficient of k-th of feature.
In step S105, according to after normalization three characteristic values and cigarette strain master pattern library, using it is fuzzy select it is close
Principle classifies to the cigarette strain to be sorted, obtains the classification results of the cigarette strain to be sorted;It specifically includes:
S401: the master pattern library is U=(A1,A2,A3,A4), wherein A1,A2,A3,A4Respectively represent cigarette strain growing way
Four grades: level-one, second level, three-level and level Four;
S402: it is normalized using feature of the following formula to all eyeball image patterns in the master pattern library;
The fuzzy matrix A ' of cigarette strain image gradation evaluation after to normalizationi:
In above formula, xikFor the characteristic value before normalization, x 'ikFor the characteristic value after normalization, m is characterized value xikAffiliated cigarette
Total cigarette strain image pattern quantity of the strain affiliated grade of image, n are characterized quantity, n=3;I and k respectively indicates i-th of sample and
K feature, wkIt is preset value for the weight coefficient of k-th of characteristic parameter;1≤i≤4;
S403: inputting cigarette strain image to be identified, extracts each characteristic value of cigarette strain image, and composition characteristic vector simultaneously normalizes,
Form fuzzy vector X;
S404: using the minimax similarity measures in Similarity Principle, calculate separately the cigarette strain image obscure to
Measure X and A 'iClose to degree value;
In above formula, X=(x1,x2,x3), x1For the pixel plant height of cigarette strain to be sorted, x2It is wide for the pixel strain of cigarette strain to be sorted,
x3For the foline ratio of cigarette strain to be sorted;The dimension that n is characterized, n=3;yiIndicate fuzzy set A 'iIth feature value;1≤i≤
4;
And then available η (X, A '1)、η(X,A′2) and η (X, A '3) three close to degree value;It is maximum in selection three
One growing way classification grade close to grade belonging to fuzzy matrix corresponding to degree value as affiliated cigarette strain image.
Test specification:
(1) acquisition of cigarette strain image pattern and the building of master pattern library
The embodiment of the present invention acquires cigarette strain sample in four periods of tobacco growing, respectively at Guiyang Longgang District and Pingba County
This, the kind of acquisition is k326 and cloud and mist 87.Each period, each kind have taken 400 cigarette strain photos respectively, and in total 1600
Open cigarette strain figure.Fig. 2 is the cigarette strain image pattern for adopting four grades of roasting phase, wherein A, B, C, D indicate the cigarette strain of different growing ways.Table 1
To adopt roasting each rank master pattern of phase cigarette strain growing way library.
Table 1 adopts roasting each rank master pattern of phase cigarette strain library
As can be seen from Table 1, the cigarette strain growing way for adopting the roasting phase is better, and plant height, strain is wide and foline ratio is bigger.This and actual conditions
And be consistent, cigarette strain feature is normalized, treated, and data are as shown in table 2.
Each rank master pattern of cigarette strain library after the normalization of table 2
(2) cigarette strain image segmentation
Fig. 3 (a) and Fig. 3 (b) is respectively using GrabCut algorithm and to improve the comparison of GrabCut algorithm cigarette strain segmentation effect
Figure.It can be seen that the either interference of other cigarette strains or weeds or the influence of other backgrounds, calculated using improved GrabCut
Within the acceptable range, and parts of images segmentation effect is even better for the segmentation effect of method.
(3) cigarette strain image characteristics extraction
Binaryzation, the effect of binaryzation such as Fig. 4 are carried out to the cigarette strain after segmentation in Fig. 3 (b).To the white pixel in Fig. 4
It is counted, calculates its ratio for accounting for the total pixel of picture, the size of cigarette strain foline ratio can be acquired.Wherein, (A) cigarette strain is
0.47, (B) cigarette strain is 0.43, and (C) cigarette strain is 0.39, and (D) cigarette strain is 0.30.As can be seen that cigarette strain growing way is better, foline ratio is got over
Greatly, illustrate that this feature can effectively reflect the growing way of cigarette strain
Contours extract is carried out to the cigarette strain binary image in Fig. 4 and boundary rectangle is drawn, as shown in Figure 5.Due to shooting
Shi Shouji is perpendicular to cigarette strain, so the length and width of positive boundary rectangle are that pixel plant height and pixel strain are wide.Photo size be 600 ×
300 pixels, wherein (a) cigarette strain is 527 × 275 pixels, and (b) cigarette strain is 497 × 284 pixels, and (c) cigarette strain is 468 × 272 pictures
Element, (d) cigarette strain be 459 × 250 pixels, according to these positive boundary rectangles can acquire cigarette strain pixel plant height and pixel strain it is wide.
(4) cigarette strain image classification
Cigarette strain image to be sorted is inputted, such as one level-one cigarette strain image of input can by extracting its feature and normalizing
To obtain its feature vector as X=(0.754,0.297,0.746).According to minimax approach degree calculation formula, available X
It is respectively as follows: with the approach degree of four grade tobacco leaves
η1(X,A1)=0.963, η2(X,A2)=0.928, η3(X,A3)=0.807, η4(X,A4It)=0.686 therefore, can be with
The growing way grade for obtaining the cigarette strain image is level-one.
The beneficial effects of the present invention are: technical solution proposed by the invention has the advantage that
(1) for the cigarette strain image under complex background, a kind of improved GrabCut partitioning algorithm, segmentation effect are proposed
It is good, and avoid human-computer interaction;
(2) a kind of growing way of new cigarette strain feature (foline ratio) Lai Fanying cigarette strain is proposed, the accuracy of classification is improved;
(3) a kind of new feature normalization method is proposed, can more accurately reflect each feature to tobacco growing
It influences;
(4) it is various for cigarette strain image classification factor in need of consideration, and is fuzzy feature, proposes one kind
The classification method of fuzzy selecting rules can preferably solve the problems, such as cigarette strain fuzzy classification, improve cigarette strain classification accuracy.
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and
Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (6)
1. a kind of complicated cigarette strain image classification method based on fuzzy selecting rules, it is characterised in that: the following steps are included:
S101: cigarette strain master pattern library is established;And the image of cigarette strain to be sorted is acquired, obtain cigarette strain figure to be sorted
Picture;It include multiple cigarette strain image patterns, the cigarette strain image pattern and the cigarette strain figure to be sorted in the master pattern library
As acquisition method be;And each cigarette strain image pattern has a growing way grade label;
S102: using improved GrabCut algorithm in the cigarette strain image cigarette strain and image background be split, gone
Except the cigarette strain image after background;
S103: binaryzation is carried out to the cigarette strain image after the removal background, and then the cigarette strain image after binaryzation is carried out special
Sign is extracted, and wide three characteristic values of foline ratio, pixel plant height and pixel strain of cigarette strain to be sorted are obtained;
S104: the foline ratio, pixel plant height and wide three characteristic values of pixel strain are normalized, three after being normalized
A characteristic value;
S105: according to after normalization three characteristic values and cigarette strain master pattern library, using fuzzy selecting rules to described
The growing way grade of cigarette strain to be sorted is classified, and the growing way classification results of the cigarette strain to be sorted are obtained.
2. a kind of complicated cigarette strain image classification method based on fuzzy selecting rules as described in claim 1, it is characterised in that:
In step S101, cigarette strain master pattern library includes four grades for representing cigarette strain growing way: level-one, second level, three-level and level Four,
Respectively correspond cigarette strain attribute classification it is excellent, good, neutralize it is poor;And each grade includes multiple cigarette strains according to acquisition standard acquisition
Image pattern;The acquisition standard are as follows: when acquisition cigarette strain image, shooting tool need to right above cigarette strain h meters of distance with vertical
Angle shot in ground, and cigarette strain is located at the middle part of whole image;Wherein, h is preset value, the value range of h be [1.9,
2.1]。
3. a kind of complicated cigarette strain image classification method based on fuzzy selecting rules as described in claim 1, it is characterised in that:
In step S102, the improvement of the improved GrabCut algorithm are as follows: change tradition GrabCut algorithm and need artificial selection cigarette strain
And the shortcomings that background pixel, it proposes a kind of automatic method for choosing cigarette strain pixel and background pixel, specifically includes:
Firstly, being selected using the picture rectangular function that OpenCV is carried the cigarette strain in the cigarette strain image, to use rectangle
Cigarette strain in the cigarette strain image is framed by frame;The size of the rectangle frame is that the cigarette strain image side length subtracts t pixel value;
Wherein, t is preset value, and the value range of t is [5,10];
Then, the pixel for representing background is sowed using four angles of the RNG class of OpenCV to the rectangle frame region, it is right
Sow the pixel for representing cigarette strain in the middle part of the rectangle frame region, to the rectangle frame region elsewhere with
Machine sowing spreads the pixel of the representative cigarette strain of preset quantity and represents the pixel of background;
Finally, according to the pixel for representing background and the pixel for representing cigarette strain, using traditional GrabCut algorithm
Background in the cigarette strain image is removed, to obtain the cigarette strain image after removal background.
4. a kind of complicated cigarette strain image classification method based on fuzzy selecting rules as described in claim 1, it is characterised in that:
In step S103, binaryzation is carried out to the cigarette strain image after the removal background, the cigarette strain image after obtaining binaryzation, Jin Ergen
Cigarette strain feature is extracted according to the cigarette strain image after the binaryzation;It specifically includes:
S301: binaryzation is carried out to the cigarette strain image after the removal background, the cigarette strain image after obtaining binaryzation;The two-value
Cigarette strain image after change only includes the pixel of multiple whites and the pixel of multiple black;Wherein, threshold value when binaryzation is
The preset threshold value according to growth period locating for cigarette strain to be sorted;
S302: the white pixel point in the cigarette strain image after binaryzation is counted, the total number a of white pixel point is obtained;
Foline ratio v is calculated according to the following formula:
In above formula, sum is the pixel total number in the cigarette strain image after the binaryzation;
S303: using the findContours function in OpenCV to all profiles in the cigarette strain image after the binaryzation into
Row is searched, and multiple profiles are obtained;And then the pixel point set of each profile is drawn using the drawContours function in OpenCV;
S304: profile described in each is drawn according to its corresponding point set using the boundingRect function in OpenCV
The positive boundary rectangle of the profile out;
All profiles are traversed, and then obtain the contoured positive boundary rectangle of institute;
S305: by the size of contoured positive boundary rectangle compare, select the maximum positive boundary rectangle of area as cigarette
The pixel plant height of the height of strain, a length of cigarette strain of quant's sign value and the maximum positive boundary rectangle of the area, the area are maximum
The width of positive boundary rectangle is that the pixel strain of cigarette strain is wide.
5. a kind of complicated cigarette strain image classification method based on fuzzy selecting rules as described in claim 1, it is characterised in that:
In step S104, three characteristic values are normalized according to such as following formula:
In above formula, xkFor the characteristic value before normalization, x 'kFor the characteristic value after normalization, n is characterized quantity, and n=3, k indicate the
K feature, wkIt is preset value for the weight coefficient of k-th of feature.
6. a kind of complicated cigarette strain image classification method based on fuzzy selecting rules as claimed in claim 2, it is characterised in that:
In step S105, according to after normalization three characteristic values and cigarette strain master pattern library, using fuzzy selecting rules to institute
It states cigarette strain to be sorted to classify, obtains the classification results of the cigarette strain to be sorted;It specifically includes:
S401: the master pattern library is U=(A1,A2,A3,A4), wherein A1,A2,A3,A4Respectively represent four of cigarette strain growing way
Grade: level-one, second level, three-level and level Four;
S402: it is normalized using feature of the following formula to all eyeball image patterns in the master pattern library;Returned
The fuzzy matrix A ' of cigarette strain image gradation evaluation after one changei:
In above formula, xikFor the characteristic value before normalization, x 'ikFor the characteristic value after normalization, m is characterized value xikAffiliated cigarette strain figure
As total cigarette strain image pattern quantity of affiliated grade, n is characterized quantity, n=3;I and k respectively indicates i-th of sample and k-th
Feature, wkIt is preset value for the weight coefficient of k-th of characteristic parameter;1≤i≤4;
S403: inputting cigarette strain image to be identified, extracts each characteristic value of cigarette strain image, and composition characteristic vector simultaneously normalizes, and is formed
Fuzzy vector X;
S404: using the minimax similarity measures in Similarity Principle, calculate separately the cigarette strain image fuzzy vector X and
A′iClose to degree value;
In above formula, X=(x1,x2,x3), x1For the pixel plant height of cigarette strain to be sorted, x2Wide, the x for the pixel strain of cigarette strain to be sorted3For
The foline ratio of cigarette strain to be sorted;The dimension that n is characterized, n=3;yiIndicate fuzzy set A 'iIth feature value;1≤i≤4;
And then available η (X, A '1)、η(X,A′2) and η (X, A '3) three close to degree value;Maximum one in selection three
Growing way classification grade close to grade belonging to fuzzy matrix corresponding to degree value as affiliated cigarette strain image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910548945.XA CN110443272B (en) | 2019-06-24 | 2019-06-24 | Complex tobacco plant image classification method based on fuzzy selection principle |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910548945.XA CN110443272B (en) | 2019-06-24 | 2019-06-24 | Complex tobacco plant image classification method based on fuzzy selection principle |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110443272A true CN110443272A (en) | 2019-11-12 |
CN110443272B CN110443272B (en) | 2023-01-03 |
Family
ID=68428299
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910548945.XA Expired - Fee Related CN110443272B (en) | 2019-06-24 | 2019-06-24 | Complex tobacco plant image classification method based on fuzzy selection principle |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110443272B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106408569A (en) * | 2016-08-29 | 2017-02-15 | 北京航空航天大学 | Brain MRI (magnetic resonance image) segmentation method based on improved fuzzy C-means clustering algorithm |
CN108387262A (en) * | 2018-01-03 | 2018-08-10 | 江苏大学 | A kind of greenhouse information automatic monitoring method based on suspension type sliding rail platform |
WO2019000653A1 (en) * | 2017-06-30 | 2019-01-03 | 清华大学深圳研究生院 | Image target identification method and apparatus |
-
2019
- 2019-06-24 CN CN201910548945.XA patent/CN110443272B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106408569A (en) * | 2016-08-29 | 2017-02-15 | 北京航空航天大学 | Brain MRI (magnetic resonance image) segmentation method based on improved fuzzy C-means clustering algorithm |
WO2019000653A1 (en) * | 2017-06-30 | 2019-01-03 | 清华大学深圳研究生院 | Image target identification method and apparatus |
CN108387262A (en) * | 2018-01-03 | 2018-08-10 | 江苏大学 | A kind of greenhouse information automatic monitoring method based on suspension type sliding rail platform |
Also Published As
Publication number | Publication date |
---|---|
CN110443272B (en) | 2023-01-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wang et al. | Image segmentation of overlapping leaves based on Chan–Vese model and Sobel operator | |
CN109308697B (en) | Leaf disease identification method based on machine learning algorithm | |
CN104598908B (en) | A kind of crops leaf diseases recognition methods | |
CN105718945B (en) | Apple picking robot night image recognition method based on watershed and neural network | |
CN109961024A (en) | Wheat weeds in field detection method based on deep learning | |
CN109034269A (en) | A kind of bollworm female male imago method of discrimination based on computer vision technique | |
CN107316289A (en) | Crop field spike of rice dividing method based on deep learning and super-pixel segmentation | |
CN110232389A (en) | A kind of stereoscopic vision air navigation aid based on green crop feature extraction invariance | |
CN109360236B (en) | Sunflower disc size measurement method | |
CN109978822A (en) | Banana maturity evaluation modeling method and evaluation method based on machine vision | |
CN107392929A (en) | A kind of intelligent target detection and dimension measurement method based on human vision model | |
CN108668637A (en) | A kind of machine vision places grape cluster crawl independent positioning method naturally | |
CN103345617A (en) | Method and system for recognizing traditional Chinese medicine | |
CN102663397B (en) | Automatic detection method of wheat seedling emergence | |
CN114067207A (en) | Vegetable seedling field weed detection method based on deep learning and image processing | |
CN109101891A (en) | A kind of rice pest detection system and its detection method merging artificial intelligence | |
Ji et al. | In-field automatic detection of maize tassels using computer vision | |
CN106846334A (en) | Field corn plant recognition methods based on Support Vector data description | |
CN108805924A (en) | A kind of lily picking independent positioning method and system | |
CN105787966A (en) | An aesthetic evaluation method for computer pictures | |
CN107330898A (en) | Altitudinal vegetation zone quantitatively delineates computational methods and system | |
CN108416814A (en) | Quick positioning and recognition methods and the system on a kind of pineapple head | |
Li et al. | An automatic approach for detecting seedlings per hill of machine-transplanted hybrid rice utilizing machine vision | |
CN110455201A (en) | Stalk plant height measurement method based on machine vision | |
CN108037123A (en) | A kind of hybrid paddy rice disc type sows performance parameter accurate detecting method |
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: 20230103 |