CN112966705A - Adaboost-based agricultural irrigation drip irrigation head quality online identification method - Google Patents
Adaboost-based agricultural irrigation drip irrigation head quality online identification method Download PDFInfo
- Publication number
- CN112966705A CN112966705A CN202011327530.9A CN202011327530A CN112966705A CN 112966705 A CN112966705 A CN 112966705A CN 202011327530 A CN202011327530 A CN 202011327530A CN 112966705 A CN112966705 A CN 112966705A
- Authority
- CN
- China
- Prior art keywords
- drip irrigation
- irrigation head
- image
- value
- adaboost
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000003973 irrigation Methods 0.000 title claims abstract description 115
- 230000002262 irrigation Effects 0.000 title claims abstract description 115
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000007781 pre-processing Methods 0.000 claims abstract description 11
- 239000013598 vector Substances 0.000 claims description 24
- 239000011159 matrix material Substances 0.000 claims description 13
- 238000012545 processing Methods 0.000 claims description 9
- 238000004364 calculation method Methods 0.000 claims description 5
- 238000010606 normalization Methods 0.000 claims description 5
- 238000001914 filtration Methods 0.000 claims description 3
- 241000894006 Bacteria Species 0.000 claims description 2
- 230000006835 compression Effects 0.000 claims description 2
- 238000007906 compression Methods 0.000 claims description 2
- 238000003066 decision tree Methods 0.000 claims description 2
- 238000005286 illumination Methods 0.000 claims description 2
- 238000003706 image smoothing Methods 0.000 claims description 2
- 239000002356 single layer Substances 0.000 claims description 2
- 239000000126 substance Substances 0.000 claims description 2
- 238000005520 cutting process Methods 0.000 claims 1
- 238000009776 industrial production Methods 0.000 claims 1
- 238000001514 detection method Methods 0.000 abstract description 12
- 238000012360 testing method Methods 0.000 abstract description 4
- 230000000694 effects Effects 0.000 abstract description 3
- 238000004422 calculation algorithm Methods 0.000 description 11
- 238000007689 inspection Methods 0.000 description 10
- 238000000605 extraction Methods 0.000 description 8
- 238000002474 experimental method Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000001580 bacterial effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000001419 dependent effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000002349 favourable effect Effects 0.000 description 2
- 238000003384 imaging method Methods 0.000 description 2
- 238000002372 labelling Methods 0.000 description 2
- 238000012216 screening Methods 0.000 description 2
- 238000012549 training Methods 0.000 description 2
- 230000032683 aging Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000012512 characterization method Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 201000010099 disease Diseases 0.000 description 1
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 1
- 238000009826 distribution Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012567 pattern recognition method Methods 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/243—Classification techniques relating to the number of classes
- G06F18/24323—Tree-organised classifiers
-
- 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/30—Noise filtering
-
- 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)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Cheminformatics (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Image Processing (AREA)
Abstract
The invention discloses an agricultural irrigation drip irrigation head quality online identification method based on adaboost, and belongs to the field of product quality image identification. The traditional drip irrigation head quality detection needs manual judgment by a person with a large amount of experience, or a part of product selection test is carried out, time and labor are consumed, and therefore a quick detection method is urgently needed in the field of drip irrigation head quality detection. The invention provides a method for identifying the image of the drip irrigation head product and establishing an online quality identification system, thereby meeting the requirement of rapid detection of the product. The method provided by the invention is used for preprocessing the quality image of the drip irrigation head, extracting the characteristics, classifying and identifying by using an adaboost method, and meanwhile, comparing with the SVM classification effect, wherein the final classification accuracy is 79% of SVM and 100% of adaboost. And a system is built through the idea, so that the on-line detection of the image of the drip irrigation head is realized.
Description
Technical Field
The invention relates to the field of agricultural drip irrigation head images, in particular to an image pattern recognition method, relates to recognition and screening of whether a drip irrigation head is qualified or not, and particularly relates to online detection of whether the drip irrigation head of an agricultural irrigator is qualified or not based on an Adaboost method.
Background
Based on the multi-directional image recognition of the drip irrigation head, the method is used for on-line on-site inspection of whether products are qualified or not, can save time cost and labor cost, and has very important practical significance.
At present, in water-saving irrigation engineering, the quality inspection of the drip irrigation head is mainly performed by a traditional experiment inspection method, and a material pressure resistance experiment, a pipeline connection experiment, a water pressure experiment, a tightness experiment and the like are required to detect whether the drip irrigation head is qualified or not. Related product standards are established early in China, but no test equipment for quality inspection exists. The quality of the products controlled by manufacturers can be judged only by home-made simple and crude devices or by certain accumulated experience, scientific basis is lacked, and the quality control cannot be mentioned. Although there are many manufacturers of domestic detection equipment, the equipment production for irrigation products is not provided. In the face of rapid market expansion and relative scarcity of quality inspection equipment, it is of great significance to develop a set of quality on-line detection method suitable for mass manufacturers. The detection method has the requirements of high efficiency, low cost, simple and convenient operation and the like. The Adaboost method is an improved method in Boosting algorithm. Based on Boosting addition and forward thought, the Boosting algorithm becomes reality. Firstly, a plurality of weak classifiers are established, the weight values of the classifiers and samples are adjusted according to the classification error rate, so that the acting ranges of different classifiers are different, and finally, all the weak classifiers are integrated to form a strong classifier, thereby achieving the effect of improving the classification accuracy.
Disclosure of Invention
Due to the blank of the quality detection method of the water-saving drip irrigation head, the invention aims to provide a quality identification method based on a drip irrigation head image, which comprises a plurality of processes of acquisition of a certain number of drip irrigation heads, acquisition of drip irrigation head images by a multispectral image acquisition system, data transmission, image preprocessing, feature selection, feature extraction, identification method selection, result judgment and the like.
The technical scheme adopted by the invention for solving the technical problems is as follows: a quality identification method based on a drip irrigation head image aims to establish an online identification and classification system and method based on an agricultural irrigation drip irrigation head image.
The main contents of the method used by the system comprise the following steps:
step 1: the drip irrigation head is obtained from a drip irrigation head production factory, and the image of the drip irrigation head is obtained through a multispectral image acquisition system.
Step 2: and storing the drip irrigation head image, and performing image preprocessing on the obtained drip irrigation head image.
And step 3: and (4) performing feature extraction on the pretreated drip irrigation head image.
And 4, step 4: and training the weak classifier by using an Adaboost method to finally form a strong classifier, obtaining a final classification result and finally transmitting the result to a computer of a specified user.
Further, the method for acquiring the image of the drip irrigation head in the step 1 of the invention specifically comprises the following steps:
step 1-1: a batch of drip irrigation heads is obtained from a drip irrigation head manufacturer.
Step 1-2: and turning on a power supply of the multispectral image acquisition system.
Step 1-3: and placing a drip irrigation head sample, focusing a lens, and manually adjusting exposure time to obtain a proper drip irrigation head image.
Further, the drip irrigation head image is stored in the step 2 of the invention, and the obtained drip irrigation head image is subjected to image preprocessing. The process specifically comprises the following steps:
step 2-1: the obtained drip irrigation head image is saved into a jpg format.
Step 2-2: and carrying out smooth denoising treatment on the image noise of the drip irrigation head, which can be generated due to factors such as exposure, equipment aging and the like.
And the image preprocessing adopts a median filtering method to carry out smooth denoising processing on the image. An odd-length L-length window is defined, wherein L is 2N +1, and N is an integer. The signal samples in the window are x (i-N), …, x (i), … … x (i + N), wherein x (i) is the signal sample value positioned in the center of the window, the L signal sample values are arranged from small to large, the value is the sample value at i, and the value of the original pixel point is replaced by the median value to obtain the preprocessed image.
Further, the method for extracting the features of the preprocessed image in step 3 of the present invention specifically includes the steps of:
step 3-1: the extracted features include: the HOG features (histogram of gradient directions) and Tamura features are two main types of features. Wherein the Tamura textural features include six indices. Roughness (Coarseness), Contrast (Contrast), direction (Directionality), linearity (linerikenss), Regularity (Regularity), and Coarseness (Roughness), and the general paper uses only the first three features, namely, the first three features are linearly independent, and the second three features are linearly dependent on the first three features, so only the first three features are used.
Further HOG feature extraction:
(1) standardizing gamma space and color space;
and (3) the pixel points in the image are (x, y), the whole image is normalized, and the image I is compressed. Gamma compression formula:
I(x,y)=I(x,y)gamma,
(2) segmenting the image;
the image is divided into grid cells of 20 × 20 size, then 2 × 2 cells constitute a Block, and finally all blocks constitute the image.
(3) Calculating the image gradient;
for image I (x, y), the gradient of pixel point (x, y) in the image is:
Gx(x,y)=H(x+1,y)-H(x-1,y)
Gy(x,y)=H(x,y+1)-H(x,y-1)
wherein G isx(x,y),Gy(x, y), H (x, y) respectively represents the horizontal gradient, the vertical gradient and the pixel value at the pixel point (x, y) in the input image, and the gradient magnitude and the gradient direction at the pixel point (x, y) are:
where α (x, y) ranges from [0,360 °) or [0,180 °).
The angle of the gradient direction calculated by the above formula is an arc value within a range of 0-360 degrees, for the sake of simple calculation, the range of the gradient direction is constrained to be 0-180 degrees, and is divided into 9 directions, each direction is 20 degrees, and the constrained angle is divided by 20, so that the current value of the angle of the gradient direction becomes a range of [0,9 ], the gradient amplitude value in each small Cell is counted according to the 9 directions, and after calculation, a direction gradient histogram with the abscissa X as the gradient direction and the ordinate Y as the gradient amplitude value is generated.
(4) Histogram feature vector normalization
In order to overcome the variation of uneven illumination and the contrast difference between the foreground and background, the feature vector calculated in each small area needs to be normalized. In the program, normalization processing is directly performed using the CV _ L2 norm in the normaize function in OpenCV.
(5) Hog feature vector generation
And forming the HOG feature vectors of the small cells in the image into a larger HOG feature vector of a Block, wherein a specific combination mode is that 2 × 2 cells are used for forming one Block. And then all Block HOG feature vectors are combined into a full image HOG feature vector H. The specific combination mode of the feature vectors is to combine small feature vectors into a feature vector with a larger dimension in an end-to-end connection mode.
Step 3-2: calculating Tamura texture feature roughness;
first calculate 2 in the imagek×2kThe average intensity value of the pixels in the active area of each pixel.
Where g (i, j) is the pixel gray value located at (i, j) and (x, y) represents the position of the selected area over the entire image area.
The second step calculates, for each pixel, the average intensity difference between windows that do not overlap each other in the horizontal and vertical directions
Ek·h(x,y)=|Ak(x+2k-1,y)-Ak(x-2k-1,y)|,
Ek·v(x,y)=|Ak(x+2k-1)-Ak(x·y-2k-1)|
The optimum size is set by taking the value of k that maximizes E:
Sbest(x,y)=2k
finally, the roughness is determined by calculating S in the entire imagebestThe average value of (x, y) is obtained by the expression
Where m and n are the width and height of the image, respectively.
Step 3-3: calculating the contrast of Tamura texture features;
where σ is the standard deviation of the image gray scale, a4Representing the peak state of the grey value of the image, by a4=μ4/σ4Defining; mu.s4Representing the mean of the fourth order moments, σ2Representing the variance of the image grey value.
Step 3-4: calculating the orientation degree of Tamura texture features;
the modulus of the gradient vector at each pixel and the direction of the local edge are first calculated. The formula is as follows
|ΔG|=(|ΔH|+|ΔV|)/2
Where | Δ V | and | Δ H | are the horizontal and vertical direction changes, respectively, obtained by convolving the image with the next two 3 x 3 convolution kernels
-1 | 0 | 1 |
-1 | 0 | 1 |
-1 | 0 | 1 |
1 | 1 | 1 |
0 | 0 | 0 |
-1 | -1 | -1 |
Dividing the region from 0 to pi into 16 equal parts, and taking the maximum value of each intervalThe statistical theta angle corresponds to the number n of pixels in each region for which the corresponding deltag is greater than a given thresholdpCalculating the number of gradient vectors of all pixels to construct a histogram HDThe histogram HDThe range of values for θ is first discretized.Is the histogram HDThe peak center position in (a). The directionality of the final image population can be obtained by calculating the sharpness of the peaks in the histogram:
where P represents the peak in the histogram, pairAt a certain peak value p, wpRepresenting all of the discrete regions encompassed by the peak.
Step 3-5: arranging the calculated characteristics of each image according to an array mode: all the characteristics are put in the same matrix to form a bacteria image characteristic matrix Xmn=[P,Fcns,Fcon,Fdir]. Where m is the number of samples and n is the feature data for each sample. X is the characteristic data matrix of the drip irrigation head.
And 4, step 4: training a plurality of weak classifiers to finally form a strong classifier, and classifying different bacterial images by using an Adaboost method.
Further Adaboost algorithm process of step 4:
weak classifiers are established by a single-layer decision tree method:
setting the step size to be 50, and taking the maximum value max and the minimum value min of each column of characteristics.
For each classification, the classification greater than the threshold is +1 and the classification less than the threshold is-1. After the binary classification, the classification result of the sample is compared with the actual labeling of the sample for which the labeling is realized. The error rate of the weak classifier is:
where a is the number of misclassified samples and m is the number of all samples.
Selecting the threshold with the minimum classification error rate in the 50 thresholds as the threshold of the weak classifier of the current time
in the first weak classifier calculation, the initial weight of the first distributed sample is:after the first weak classifier is calculated, the weight of the sample is updated as:
After 10 weak classifiers are calculated, the final strong classifier is:
the finally formed strong classifier can be used for classifying 2 types (qualified and unqualified) of drip irrigation head images, can screen unqualified products from a batch of drip irrigation heads and is used for detection in the field of drip irrigation head product inspection.
A main module of an online quality identification system for agricultural irrigation drip irrigation head images based on Adaboost comprises the following modules:
computer end of connecting multi-light influence acquisition system: and (4) placing the drip irrigation head sample on an objective table for shooting, and imaging after adjustment. And shooting complete information images of the drip irrigation head in multiple directions as much as possible according to the imaging characteristics.
An image preprocessing module: and transmitting the shot complete information image of the drip irrigation head to a computer for algorithm processing by using a digital image transmission technology. The method is used for preprocessing the drip irrigation head image acquired by the computer end, and mainly comprises image jpg format storage and image smoothing and denoising processing.
A feature extraction module: two main types of features, namely HOG features (directional gradient histograms) and Tamura features, in the image are extracted from the processed image acquired by the preprocessing module. Wherein the Tamura textural features include six indices. Roughness (Coarseness), Contrast (Contrast), direction (Directionality), linearity (linerikenss), Regularity (Regularity), and Coarseness (Roughness), and the general paper uses only the first three features, namely, the first three features are linearly independent, and the second three features are linearly dependent on the first three features, so only the first three features are used.
A result prediction module: and the result prediction module is a trained Adaboost model, inputs the acquired image feature matrix into the trained model, and judges the type of the acquired image so as to judge the type of the product quality displayed by the image.
A client terminal: the final data results are respectively output to a computer used on line in a factory for quality inspection in the production process
The invention can be applied to the quick pre-inspection of whether the quality of the drip irrigation head is qualified or not.
Has the advantages that:
1. the invention can be used for the production line of the drip irrigation head, is used for the rapid inspection of the quality of the drip irrigation head, solves the time cost and the economic cost of needing a large amount of experienced manual inspection, is beneficial to improving the resource waste condition caused by the unqualified production of the drip irrigation head, and is beneficial to the formation of the environment-friendly society in China.
2. The samples obtained by the invention and used as the test set are increased along with the continuous use of the algorithm. The method is favorable for establishing a database with a certain data base. The method can be used as a special database for the quality of the drip irrigation head product, continuously improves the accuracy of the quality detection of the drip irrigation head, and is favorable for establishing a database of quality images of the drip irrigation head product.
Drawings
Fig. 1 is a system diagram of a system for performing quality recognition of a drip irrigation head image based on the Adaboost method according to the present invention.
Fig. 2 and 3 are a feature extraction process and a feature parameter matrix establishing process in step 3.
Fig. 4 is a flowchart of the Adaboost algorithm of step 4.
Fig. 5 is a drip irrigation head image.
Fig. 6 is a diagram of a multi-spectral image acquisition system.
Fig. 7 is a three-dimensional graph of HOG feature results.
Fig. 8 is a diagram of classification results of the Adaboost algorithm.
Detailed Description
The invention is explained in detail with reference to the content and embodiments of the drawings.
As shown in fig. 1, the present invention provides a system for identifying the quality of an agricultural irrigation drip irrigation head based on the Adaboost method, and the present invention is further described in detail below to make the purpose, technical scheme and effect of the present invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Please refer to fig. 1. Fig. 1 is a system diagram of an agricultural irrigation drip irrigation head quality identification system based on the Adaboost method, and as shown in the figure, the processing steps include the following steps:
step 1: after the clear image is acquired by the multispectral image acquisition system, the clear image is stored, and the image is transmitted to the image preprocessing module by the digital image transmission technology. And a firewall is arranged between the two modules to prevent the loss caused by instrument damage.
Step 2: in an image preprocessing module contained in the system, the image is stored in a jpg format, and the smooth denoising processing is carried out on the image through central filtering.
And step 3: the HOG and Tamura features are obtained in a feature extraction module, and fig. 2 is a HOG feature extraction flow chart. FIG. 4 is a Tamura feature extraction process.
And 4, step 4: in a result prediction module, the acquired feature matrix is calculated through an Adaboost algorithm, a strong classifier is combined by establishing a plurality of weak classifiers, a predicted result is finally obtained, and the bacterial category is confirmed.
And 5: the final classification result obtained from the result prediction module can be transmitted to a required client terminal according to the requirement, and the quality of the drip irrigation head product is identified.
Table 1 shows Tamura characterization data for one of the two types of drip irrigation head images obtained.
Table 2 shows the number of images of the selected pass and fail drip irrigation head products herein, wherein 80% were selected as the test set and 20% were selected as the validation set. The defective products are classified and used as application examples to illustrate the function of the algorithm.
As can be seen from fig. 8: the SVM recognition accuracy is 78%. The classification result of the Adaboost algorithm is 100%. Therefore, the Adaboost algorithm has the advantages in the aspect of identification and classification of the quality of the drip irrigation head products, can completely and correctly identify unqualified product images, and provides help for screening the drip irrigation head.
It should be understood that the application of the present invention is not limited to the above-mentioned identification of the quality of the drip irrigation head, and that for the field of disease control, the subject of study may be changed according to the above description, and that the identification of the product is true, and the design concept and concept of the system should fall within the scope of the appended claims.
Table 1 drip irrigation head image Tamura characteristics
Table 2 drip irrigation head image sample distribution
Claims (5)
1. An agricultural irrigation drip irrigation head quality online identification method based on adaboost is characterized in that: based on an Adaboost method, shooting images of the drip irrigation head from different angles in a multi-spectral image acquisition system in a multi-azimuth mode, extracting features from the images of the drip irrigation head, inputting the features into an Adaboost classifier for classification and prediction, and finally distinguishing the type of the drip irrigation head, namely whether the drip irrigation head is qualified or unqualified; the method comprises the following steps:
(1) acquiring a multi-azimuth drip irrigation head image through a multi-spectral image acquisition system;
(2) carrying out image smoothing and denoising pretreatment on the obtained drip irrigation head image;
(3) extracting image characteristics of the preprocessed drip irrigation head image;
(4) forming a characteristic matrix by using the obtained drip irrigation head image characteristics;
(5) and forming a data matrix for the acquired drip irrigation head characteristics by using an Adaboost method, wherein the data matrix is used for modeling, identifying and classifying, and determining whether the final qualified type of the drip irrigation head is determined.
2. The method for on-line identification of the quality of the agricultural irrigation drip irrigation head based on adaboost as claimed in claim 1, wherein the method comprises the following steps:
the preprocessing adopts a median filtering method to carry out smooth denoising processing on the drip irrigation head image; defining an L long window with odd length, wherein L is 2N +1, and N is an integer; the signal samples in the window are x (i-N), wherein x (i) is the signal sample value positioned in the center of the window, and the L signal sample values are arranged from small to large, wherein the value is the sample value at i; and replacing the value of the original pixel point with the median value to obtain a preprocessed drip irrigation head image.
3. The method for on-line identification of the quality of the agricultural irrigation drip irrigation head based on adaboost as claimed in claim 1, wherein the method comprises the following steps:
and (3) extracting Hog characteristics:
(1) standardizing gamma space and color space;
the pixel point in the drip irrigation head image is (x, y), the whole drip irrigation head image is normalized, and the image I is compressed; gamma compression formula:
I(x,y)=I(x,y)gamma,
(2) cutting the image of the drip irrigation head;
dividing the drip irrigation head image into grid cells with the size of 20 × 20, forming a Block by 2 × 2 cells, and forming the drip irrigation head image by all the blocks;
(3) calculating the image gradient of the drip irrigation head;
for the drip irrigation head image I (x, y), the gradient of the pixel point (x, y) in the drip irrigation head image is:
Gx(x,y)=H(x+1,y)-H(x-1,y)
Gy(x,y)=H(x,y+1)-H(x,y-1)
wherein G isx(x,y),Gy(x, y), H (x, y) represent horizontal direction gradient, vertical direction gradient and the pixel value of pixel (x, y) department in the input drip irrigation head image respectively, and the gradient amplitude and the gradient direction of pixel (x, y) department are:
wherein α (x, y) ranges from [0,360 °) or [0,180 °);
the angle of the gradient direction is an arc value within a range of 0-360 degrees, the range of the gradient direction is restricted to be 0-180 degrees and is divided into 9 directions, each direction is 20 degrees, the restricted angle is divided by 20, then the current value of the angle of the gradient direction is changed into a range of [0,9 ], the gradient amplitude value in each small Cell is counted according to the 9 directions, and after calculation, a direction gradient histogram with the abscissa X as the gradient direction and the ordinate Y as the gradient amplitude value is generated;
(4) histogram feature vector normalization
In order to overcome the uneven change of illumination and the contrast difference between the foreground and background, normalization processing needs to be carried out on the characteristic vector calculated in each small area; normalization processing is performed using the CV _ L2 norm in the normaize function in OpenCV;
(5) hog feature vector generation
Forming HOG characteristic vectors of small cells in the drip irrigation head image into a larger HOG characteristic vector of a Block, wherein a specific combination mode is that 2 × 2 cells are used for forming one Block; then, forming the HOG characteristic vectors of all blocks into HOG characteristic vectors H of the whole image; the combination mode of the feature vectors is to form the feature vectors by connecting small feature vectors end to end;
tamura texture characteristics:
in the Tamura texture characteristics, three characteristics of roughness, contrast and direction degree are adopted;
(1) roughness:
firstly, 2 in the drip irrigation head image is calculatedk×2kAn average intensity value of pixels in the active area of pixels;
wherein g (i, j) is the pixel gray value at (i, j) and (x, y) represents the position of the selected area over the entire drip head image area;
the second step calculates, for each pixel, the average intensity difference between windows that do not overlap each other in the horizontal and vertical directions
Ek·h(x,y)=|Ak(x+2k-1,y)-Ak(x-2k-1,y)|,
Ek·v(x,y)=|Ak(x+2k-1)-Ak(x·y-2k-1)|
The optimum size is set by taking the value of k that maximizes E:
Sbest(x,y)=2k
finally, coarseRoughness is calculated by calculating S in the whole drip irrigation head imagebestThe average value of (x, y) is obtained by the expression
Wherein m and n are the width and height, respectively, of the drip irrigation head image;
(2) contrast ratio
Where σ is the standard deviation of the image gray scale of the drip irrigation head, a4Representing the peak state of the gray value of the image of the drip irrigation head, by a4=μ4/σ4Defining; mu.s4Representing the mean of the fourth order moments, σ2Representing the variance of the gray value of the drip irrigation head image;
(3) degree of direction
The modulus of the gradient vector at each pixel and the direction of the local edge are first calculated as follows
|ΔG|=(|ΔH|+|ΔV|)/2
Where | Δ V | and | Δ H | are the amount of change in the horizontal and vertical directions, respectively, obtained by the image convolution of the next two 3 x 3 convolution kernels;
dividing the region from 0 to pi into 16 equal parts, and taking the maximum value of each intervalThe statistical theta angle corresponds to the number n of pixels in each region for which the corresponding deltag is greater than a given thresholdpCalculating the number of gradient vectors of all pixels to construct a histogram HDFirstly, discretizing the value range of theta by the histogram;is the peak center position in the histogram; the directionality of the final image population can be obtained by calculating the sharpness of the peaks in the histogram:
where P represents the peak in the histogram and for a certain peak P, wp represents all the discrete areas that this peak contains.
4. The method for on-line identification of the quality of the agricultural irrigation drip irrigation head based on adaboost as claimed in claim 1, wherein the method comprises the following steps:
arranging the calculated characteristics of each drip irrigation head image according to an array mode: all the characteristics are put in the same matrix to form a bacteria image characteristic matrix Xmn=[P,Fcns,Fcon,Fdir](ii) a Wherein m is the number of samples, and n is the characteristic data of each sample; x is the characteristic data matrix of the drip irrigation head.
5. The method for on-line identification of the quality of the agricultural irrigation drip irrigation head based on adaboost as claimed in claim 1, wherein the method comprises the following steps: the method is characterized in that:
weak classifiers are established by a single-layer decision tree method: setting the step length to be 50, and taking the maximum value max and the minimum value min of each column of characteristics for the matrix X;
each increase in the thresholdSo that the threshold value at each time isIn each classification, the classification greater than the threshold is +1, and the classification smaller than the threshold is-1; after performing the binary classification, the samples are classifiedComparing the class result with the actual mark of the sample for realizing the mark; the error rate of the weak classifier is:
wherein a is the number of samples with classification errors, and m is the number of all samples;
selecting the threshold with the minimum classification error rate in the 50 thresholds as the threshold of the weak classifier at the time;
in the first weak classifier calculation, the initial weight of the first distributed sample is:after the first weak classifier is calculated, the weight of the sample is updated as:
select 10 classifiers Gt(x);
After 10 weak classifiers are calculated, the final strong classifier is:
the finally formed strong classifier is used for classifying qualified quality and unqualified quality drip irrigation heads, and unqualified drip irrigation heads are found out from a batch of drip irrigation heads in industrial production.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011327530.9A CN112966705A (en) | 2020-11-24 | 2020-11-24 | Adaboost-based agricultural irrigation drip irrigation head quality online identification method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011327530.9A CN112966705A (en) | 2020-11-24 | 2020-11-24 | Adaboost-based agricultural irrigation drip irrigation head quality online identification method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112966705A true CN112966705A (en) | 2021-06-15 |
Family
ID=76271164
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011327530.9A Pending CN112966705A (en) | 2020-11-24 | 2020-11-24 | Adaboost-based agricultural irrigation drip irrigation head quality online identification method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112966705A (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2008151471A1 (en) * | 2007-06-15 | 2008-12-18 | Tsinghua University | A robust precise eye positioning method in complicated background image |
CN103699907A (en) * | 2014-01-04 | 2014-04-02 | 复旦大学 | Pesticide spraying detection method based on machine learning |
CN104504365A (en) * | 2014-11-24 | 2015-04-08 | 闻泰通讯股份有限公司 | System and method for smiling face recognition in video sequence |
CN106250936A (en) * | 2016-08-16 | 2016-12-21 | 广州麦仑信息科技有限公司 | Multiple features multithreading safety check contraband automatic identifying method based on machine learning |
CN108696379A (en) * | 2017-04-07 | 2018-10-23 | 南京航空航天大学 | Cellular network fault diagnosis system based on integrated study and SMOTE |
US20190050948A1 (en) * | 2017-08-08 | 2019-02-14 | Indigo Ag, Inc. | Machine learning in agricultural planting, growing, and harvesting contexts |
CN109446913A (en) * | 2018-09-28 | 2019-03-08 | 桂林电子科技大学 | A kind of detection method for judging vehicle bottom and whether reequiping |
CN109800616A (en) * | 2019-01-17 | 2019-05-24 | 柳州康云互联科技有限公司 | A kind of two dimensional code positioning identification system based on characteristics of image |
CN111079596A (en) * | 2019-12-05 | 2020-04-28 | 国家海洋环境监测中心 | System and method for identifying typical marine artificial target of high-resolution remote sensing image |
-
2020
- 2020-11-24 CN CN202011327530.9A patent/CN112966705A/en active Pending
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2008151471A1 (en) * | 2007-06-15 | 2008-12-18 | Tsinghua University | A robust precise eye positioning method in complicated background image |
CN103699907A (en) * | 2014-01-04 | 2014-04-02 | 复旦大学 | Pesticide spraying detection method based on machine learning |
CN104504365A (en) * | 2014-11-24 | 2015-04-08 | 闻泰通讯股份有限公司 | System and method for smiling face recognition in video sequence |
CN106250936A (en) * | 2016-08-16 | 2016-12-21 | 广州麦仑信息科技有限公司 | Multiple features multithreading safety check contraband automatic identifying method based on machine learning |
CN108696379A (en) * | 2017-04-07 | 2018-10-23 | 南京航空航天大学 | Cellular network fault diagnosis system based on integrated study and SMOTE |
US20190050948A1 (en) * | 2017-08-08 | 2019-02-14 | Indigo Ag, Inc. | Machine learning in agricultural planting, growing, and harvesting contexts |
CN109446913A (en) * | 2018-09-28 | 2019-03-08 | 桂林电子科技大学 | A kind of detection method for judging vehicle bottom and whether reequiping |
CN109800616A (en) * | 2019-01-17 | 2019-05-24 | 柳州康云互联科技有限公司 | A kind of two dimensional code positioning identification system based on characteristics of image |
CN111079596A (en) * | 2019-12-05 | 2020-04-28 | 国家海洋环境监测中心 | System and method for identifying typical marine artificial target of high-resolution remote sensing image |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113160192B (en) | Visual sense-based snow pressing vehicle appearance defect detection method and device under complex background | |
CN106875381B (en) | Mobile phone shell defect detection method based on deep learning | |
CN110148130B (en) | Method and device for detecting part defects | |
CN115115644B (en) | Vehicle welding defect detection method based on artificial intelligence | |
CN111915572B (en) | Adaptive gear pitting quantitative detection system and method based on deep learning | |
Yogesh et al. | Computer vision based analysis and detection of defects in fruits causes due to nutrients deficiency | |
CN101661004B (en) | Visible detection method of welding quality of circuit board based on support vector machine | |
CN116664559B (en) | Machine vision-based memory bank damage rapid detection method | |
CN111008961B (en) | Transmission line equipment defect detection method and system, equipment and medium thereof | |
CN109461141A (en) | A kind of workpiece starved detection method | |
CN108846831B (en) | Band steel surface defect classification method based on combination of statistical characteristics and image characteristics | |
CN101140216A (en) | Gas-liquid two-phase flow type recognition method based on digital graphic processing technique | |
CN117253024B (en) | Industrial salt quality inspection control method and system based on machine vision | |
CN111178177A (en) | Cucumber disease identification method based on convolutional neural network | |
CN109815923B (en) | Needle mushroom head sorting and identifying method based on LBP (local binary pattern) features and deep learning | |
CN112258470B (en) | Intelligent industrial image critical compression rate analysis system and method based on defect detection | |
CN111768402A (en) | MU-SVM-based method for evaluating freshness of iced pomfret | |
CN112419397A (en) | Ore particle size grading method and system based on image and deep neural network | |
CN117593193B (en) | Sheet metal image enhancement method and system based on machine learning | |
CN113421223B (en) | Industrial product surface defect detection method based on deep learning and Gaussian mixture | |
CN117314901B (en) | Scale-adaptive chip detection neural network system | |
CN115294009A (en) | Method and equipment for detecting welding defects of battery tabs based on machine learning and storage medium | |
CN111127407B (en) | Fourier transform-based style migration forged image detection device and method | |
CN116596922A (en) | Production quality detection method of solar water heater | |
CN112966705A (en) | Adaboost-based agricultural irrigation drip irrigation head quality online identification 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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210615 |