8
Research Article Aphid Identification and Counting Based on Smartphone and Machine Vision Suo Xuesong, Liu Zi, Sun Lei, Wang Jiao, and Zhao Yang Mechanical and Electrical Engineering, Agricultural University of Hebei, Baoding, Hebei 071001, China Correspondence should be addressed to Suo Xuesong; [email protected] Received 27 April 2017; Revised 20 June 2017; Accepted 17 July 2017; Published 29 August 2017 Academic Editor: Oleg Sergiyenko Copyright © 2017 Suo Xuesong et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. Exact enumeration of aphids before the aphids outbreak can provide basis for precision spray. is paper designs counting soſtware that can be run on smartphones for real-time enumeration of aphids. As a first step of the method used in this paper, images of the yellow sticky board that is aiming to catch insects are segmented from complex background by using GrabCut method; then the images will be normalized by perspective transformation method. e second step is the pretreatment on the images; images of aphids will be segmented by using OSTU threshold method aſter the effect of random illumination is eliminated by single image difference method. e last step of the method is aphids’ recognition and counting according to area feature of aphids aſter extracting contours of aphids by contour detection method. At last, the result of the experiment proves that the effect of random illumination can be effectively eliminated by using single image difference method. e counting accuracy in greenhouse is above 95%, while it can reach 92.5% outside. us, it can be seen that the counting soſtware designed in this paper can realize exact enumeration of aphids under complicated illumination which can be used widely. e design method proposed in this paper can provide basis for precision spray according to its effective detection insects. 1. Introduction As the main representative of crop pests affecting wheat field and orchard fruit output [1], aphids with a huge number are widely distributed. By hanging the yellow sticky board on plants, people can take count of the aphids on the board so that they can determine if pesticide is needed. However, this method is imprecise. Compared with manual counting, machine vision can calculate the number of pests objectively, accurately, and effectively through analyzing the image information. To solve these problems, a lot of research has been carried out. Cassani et al. approached automated EEG-based Alzheim- er’s disease diagnosis using relevance vector machines [2], Chakraborty and Newton studied climate change, plant dis- eases, and food security [3], Pal and Foody used evaluation of SVM, RVM, and SMLR for accurate image classification with limited ground data [4], Patel et al. used improved multiple features based algorithm for fruit detection [5], Luo et al. develop an aphid damage hyperspectral index for detecting aphid (Hemiptera: Aphididae) damage levels in winter wheat and so on [6]. Yue-hua et al. [7] extracted the aphids by using region growing algorithm and OSTU threshold algorithm in the nat- ural environment, and the recognition rate of vector machine training images can reach 90.7% by using -means; Bai-jing et al. [8] extracted the aphids on the use of the method of G component threshold (each pixel in the aphids and leaves) and carried out counting research on the use of connected area markers. Jingxiao [9] transmitted the image of the pest to the PC side for HSV color model segmentation and then the pest is identified by BP neural network. Vincent et al. [10] proposed a target detector that uses the analytical decision support system to make the detector adapt to changes in the plant to identify aphids on the plant; Tirelli et al. studied the remote monitoring system to prevent pest outbreaks and trigger an alarm when the number of pests is too high [11]; Ukatsu achieved the remote counting function of rice margin bugs through using the wireless network technology. ese methods reflect the following problems: they will be influenced by illumination and the threshold is not unique in threshold extraction method. Extracting aphids by PC remoting method costs too much network traffic with Hindawi Journal of Sensors Volume 2017, Article ID 3964376, 7 pages https://doi.org/10.1155/2017/3964376

Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

Research ArticleAphid Identification and Counting Based on Smartphone andMachine Vision

Suo Xuesong Liu Zi Sun Lei Wang Jiao and Zhao Yang

Mechanical and Electrical Engineering Agricultural University of Hebei Baoding Hebei 071001 China

Correspondence should be addressed to Suo Xuesong 13903120861163com

Received 27 April 2017 Revised 20 June 2017 Accepted 17 July 2017 Published 29 August 2017

Academic Editor Oleg Sergiyenko

Copyright copy 2017 Suo Xuesong et al This is an open access article distributed under the Creative Commons Attribution Licensewhich permits unrestricted use distribution and reproduction in any medium provided the original work is properly cited

Exact enumeration of aphids before the aphids outbreak can provide basis for precision sprayThis paper designs counting softwarethat can be run on smartphones for real-time enumeration of aphids As a first step of the method used in this paper images ofthe yellow sticky board that is aiming to catch insects are segmented from complex background by using GrabCut method thenthe images will be normalized by perspective transformation method The second step is the pretreatment on the images imagesof aphids will be segmented by using OSTU threshold method after the effect of random illumination is eliminated by single imagedifferencemethodThe last step of themethod is aphidsrsquo recognition and counting according to area feature of aphids after extractingcontours of aphids by contour detection method At last the result of the experiment proves that the effect of random illuminationcan be effectively eliminated by using single image difference method The counting accuracy in greenhouse is above 95 whileit can reach 925 outside Thus it can be seen that the counting software designed in this paper can realize exact enumeration ofaphids under complicated illumination which can be used widely The design method proposed in this paper can provide basis forprecision spray according to its effective detection insects

1 Introduction

As the main representative of crop pests affecting wheat fieldand orchard fruit output [1] aphids with a huge number arewidely distributed By hanging the yellow sticky board onplants people can take count of the aphids on the board sothat they can determine if pesticide is needed However thismethod is imprecise

Compared with manual counting machine vision cancalculate the number of pests objectively accurately andeffectively through analyzing the image information To solvethese problems a lot of research has been carried out

Cassani et al approached automatedEEG-basedAlzheim-errsquos disease diagnosis using relevance vector machines [2]Chakraborty and Newton studied climate change plant dis-eases and food security [3] Pal and Foody used evaluation ofSVM RVM and SMLR for accurate image classification withlimited ground data [4] Patel et al used improved multiplefeatures based algorithm for fruit detection [5] Luo et aldevelop an aphid damage hyperspectral index for detectingaphid (Hemiptera Aphididae) damage levels in winter wheatand so on [6]

Yue-hua et al [7] extracted the aphids by using regiongrowing algorithm andOSTU threshold algorithm in the nat-ural environment and the recognition rate of vector machinetraining images can reach 907 by using 119896-means Bai-jinget al [8] extracted the aphids on the use of the method ofG component threshold (each pixel in the aphids and leaves)and carried out counting research on the use of connectedarea markers Jingxiao [9] transmitted the image of the pestto the PC side for HSV color model segmentation and thenthe pest is identified by BP neural network Vincent et al [10]proposed a target detector that uses the analytical decisionsupport system to make the detector adapt to changes in theplant to identify aphids on the plant Tirelli et al studiedthe remote monitoring system to prevent pest outbreaks andtrigger an alarm when the number of pests is too high [11]Ukatsu achieved the remote counting function of rice marginbugs through using the wireless network technology

These methods reflect the following problems they willbe influenced by illumination and the threshold is notunique in threshold extraction method Extracting aphids byPC remoting method costs too much network traffic with

HindawiJournal of SensorsVolume 2017 Article ID 3964376 7 pageshttpsdoiorg10115520173964376

2 Journal of Sensors

poor timeliness Therefore to obtain images in the complexenvironment and high impact of the scene pests can beidentified and counted without relying on the feedback of thePC side

2 Materials and Methods

The acquisition of experimental images was obtained at theWest Campus of Agricultural University of Hebei imageacquisition equipment is Samsung Galaxy 4 phone that hasa Qualcomm eight-core processor with Android 23 systemAPI 25 It is a common type with satisfactory parametersThe chapter contains two parts of picture distillation inthe first part the GrabCut algorithm [12] is used to extractyellow sticky board image from complex background andcorrect it to the same size and position by perspectivecorrection method in order to extract aphid image [13] inthe second part the method of weighted average gray scaleis used to make the yellow sticky board image preprocessingsingle image difference method is used to eliminate theinfluence of illumination and OSTU threshold segmentationand morphological erosion method is used to extract yellowsticky board image laying the groundwork for the subsequentcounting program

21 Extraction the of Yellow Sticky Board Image GrabCutis an improved algorithm based on GraphCut GrabCut isan algorithm that uses the RGB three-channel hybrid Gaussmodel for color segmentation segmentation can be com-pleted by using region pixel set which contains backgroundThe algorithm belongs to iterative segmentation and thesegmentation accuracy is higher Gibbs energy function is aspecific vocabulary that means a formula that can calculatethe weights and cost

119864 (120572 119901 120579 119911) = 119880 (120573 119901 120579 119911) + 119881 (120572 119911) (1)

119880 is a method when the target pixels are classified asforeground or background models which are obtained bymatrix119863 iteration of classifying and rewriting pixel

119880(120572 119901 120579 119911) = sum119899

119863(120572119899 119901119899 120579 119911119899)

119863 (120572119899 119901119899 120579 119911119899) = log120587 (120572119899 119901119899) + 12 log detsum(120572119899 119901119899)

+ 12 [119911119899 minus 120583 (120572119899 119901119899)minus1]

sdot sum (120572119899 119901119899)minus1 [119911119899 minus 120583 (120572119899 119901119899)]minus1

(2)

119881 is the boundary energy smoothing term when theboundary pixels are discontinuous it will do some boundarypixel classification processing

119881 (120572 119911) = 120574 sum(119909119910)isin119888

[120572119909 120572119910] exp minus 120573 10038171003817100381710038171003817119911119909 minus 119911119910100381710038171003817100381710038172 (3)

120579 makes the boundary energy more and more little byiterative method after iteration the parameters of the Gaussmixture model of target and background are higher

120579 = 120587 (120572 119901) 120583 (120572 119901) sum (120572 119901) 120572 = 0 1 119896= 1 sdot sdot sdot 119896

(4)

22 Correction of Yellow Sticky Board Because the shootingangle is not fixed the positions of yellow sticky board whichhas been extracted are not fixed In order to improve theaccuracy of aphid identification and counting the yellowsticky board must be corrected to the same size and the sameposition when a target image has been segmented getting theelevation view the aphids can be counted accurately

Transformation from distortion to elevation view canbe completed by using perspective correction method [14]which uses the four vertexes of distortion image and elevationview as the correction basisThe top left vertex (119909 119910) is the keyof correction Firstly the corrected image matrix [1199092 1199102 1199112]is obtained by using the distorted image matrix [1199091 1199101 1199111]you can get the top left vertex (119909 119910) by using the relationshipbetween [1199091 1199101 1199111] Secondly according to top left vertexthe length and width of the rectangle can be used to obtainthe information of four vertices

119863 = [1199092 1199102 1199112] = [1199092 1199102 1199112] [[[

11988611 11988612 1198861311988621 11988622 1198862311988631 11988632 11988633

]]]

119909 = 11990921199112 =119886111199091 + 119886211199101 + 11988631119886131199091 + 119886231199101 + 11988633

119909 = 11991021199112 =119886121199091 + 119886221199101 + 11988632119886131199091 + 119886231199101 + 11988633

(5)

Figure 1 is the elevation view of yellow sticky board byusing GrabCut and perspective correction method We cansee that the picture has a clear boundary and regular shapewhich will make the aphids extracted easily

23 The Image of the Yellow Sticky Board Preprocessing Thecolor image change into gray image can reduce amount ofcomputation in the image processing process and reduce thecomplexity of the calculation [15 16] the gray scale valueobtained by the weighted gray scale method is more in linewith the perception of the corresponding gray scale of eachpixel and the brightness is moderate it is conducive to thenext aphid image extraction

24 Aphids Extraction

241 Image Difference Due to the influence of light evenif more than two thresholds segmentations are proposedeach of the pictures taken in the natural environment hasan uncertain gray value so the threshold is uncertain tooAphid color is relatively single so the impact of light ismainly reflected in the background an image can be seen toconsist of foreground and background when the backgroundis removed the influence of light is removed Regarding the

Journal of Sensors 3

Figure 1 Perspective correction

process of image difference firstly the original gray imagewill be taken for fuzzification as SRC and then subtract thefuzzy background DST The difference that results DIFF isthe aphids image

SRC minus DST = DIFF (6)

242 Fuzzy Background The gray scale image after blurringis compared with the gray scale distribution in the originalgray scale graph and if the local gray scale distribution isequal it can be used as the background image Comparedwith the fuzzy effect of the three filters the Gaussian weightfilter has the smallest noise which is consistent with theoriginal gray scale distribution When the kernel value is (5151) the background blurring is the best

243 Threshold Selection Image difference is only grayimage and the gray image is not the result of image seg-mentation and needs the threshold segmentation [17] Alarge number of aphids are missing counted by using binarythreshold method while there are too many contour breakpoints by using self-adaption thresholdmethod So this paperuses the OSTU threshold segmentation method which has aclear and integrated contour as the binarization method

244 Morphological Operation In the natural environmentthe aphids on the yellow sticky board have a high base anda high density and some of the aphidsrsquo adhesion does notaffect the overall counting result and requires some corrosionof the partially adhered aphids to reduce the error Thispaper uses the elliptical nucleus with a nuclear value of (4 4)for corrosion operation This method has a good effect onelimination of adhesions

119864 (119909) = 119886 | 119861119886 isin 119883 = 119883Θ119861 (7)

Figure 2 shows the use of image difference algorithm toobtain the aphid images aphid images are clear and complete

Figure 2 Image difference method for extracting aphids

Figure 3 A digital mark of a binary image

25 Aphids Count251 Feature Extraction In order to count accurately it isnecessary to identify whether there are aphids With accessto relevant information we can see that the aphidrsquos length isbetween 15mmand 49mmMost aphids are 2mm in lengthand there are differences in the lengths of other insects in theorchard for example the apple leaf mites are about 03mmSo distinguish between aphids and nonaphids according toarea characteristics First all the contours in the binary imageare identified as digital marks and the sum of the pixels ineach connection domain is calculated to find the relationshipbetween the actual length of the aphids and the pixel valuesas shown in Figure 3

According to Table 1 based on the relationship betweenthe pixel values in each connected domain and the actuallengths of aphids we can draw a conclusion that when thepixel value is less than 20 the insectrsquos body length increases by01mmand the pixel value is increased by 1 pxsim2 px when thepixel value is higher than 20 the insectrsquos body length increasesby 01mm and the pixel value is increased by 3 pxsim4 px Inthis paper the aphids involved are mostly 15mm to 28mmso when the aphid area characteristics range from 15 px to48 px nonaphids range from 1 px to 10 px is themost suitableAccording to the range of aphid area characteristics derivedfrom the above study to identify aphid images on the yellowsticky board [18] in the obtained result graph the aphid

4 Journal of Sensors

Table 1 Part of the connection domain number pixel values andthe relationship between the lengths of pests

Pest category The pixel value within the contour (contournumber pixel value and aphid lengthmm)

Aphid

(29 41 26) (31 28 22) (32 35 25)(34 21 2) (35 19 19) (36 19 19)(37 20 19) (38 21 19) (39 27 22)(43 32 22) (44 29 22) (45 19 18)(47 20 19) (48 20 19) (49 42 26)(50 18 19) (51 40 26) (53 35 25)(56 25 21) (58 19 18) (60 23 21)(61 48 28) (63 32 24) (64 19 19)

Nonaphids(30 2 02) (41 4 04) (52 6 06)(42 9 09) (54 8 09) (57 10 1)(59 9 09) (65 10 1)

image is marked with white and nonaphid images are notmarked with white consistent with the human eye

252 Aphids Counting Method Using findContours() con-tour extraction method to find all the contours of the imageFirstly the outline which can be detected in the image willbe converted to vector form to iterate and then the aphidssection will be screened out by using ldquofor-cyclerdquo according totheir area features [19]

26 Design and Implementation Based onthe Android Platform

261 SoftwareOverall FlowChart In order tomeet the needsof the public for the convenience of equipment Androidsystem as a mobile platform mainstream system [20] in themobile side of the software development plays a guidingrole based on the Android platform aphid count APP willgreatly facilitate the majority of farmers and agriculturalscience and technology workers The aphid counting soft-ware in this paper uses the Java programming languagein the Android studio platform with OpenCV computervision library development for Android 403 and above Thesoftware implements the counting of aphids the whole isdivided into threemodules image acquisitionmodule imageprocessing module and image counting module as shownin Figure 4 now we design and implement the part of thecontent of the software

(i) ImageAcquisitionModuleThe software obtains the picturein two ways invoking the local camera to shoot in realtime or retrieving the existing photo in the local albumAfter the photo is taken to ensure the quality of the picturethe appropriate image compression can not only reduce thecomputational complexity of the image processing processbut also avoid the overflow caused by the image beingtoo large to cause the program to crash First create anintent object and set the action of the object as the stringof MediaStore ACTION IMAGE CAPTURE Then use thestring of startActivityForResult to start Intent program Aftersetting the length and width the image information will be

Call the local camera

Main interface

Retrieve the local album image

Image compression

Extraction of yellow sticky board

Correction of yellow stickyboard

Aphid extraction

Identification and counting of aphids

Image acquisition module

Image processing module

Image counting module

Figure 4 Software flow chart

loaded into Imageview by using decodeFile method At lastthe image information will return and be displayed on thenext interface

(ii) Image Processing Module In the image processing mod-ule we set ldquoyellow sticky board segmentationrdquo ldquoyellowsticky board correctionrdquo ldquoaphids identificationrdquo to extract theaphids

Using GrabCut algorithm to extract yellow sticky boardfirst create a Rect object to create a rectangular box toselect the possible prospects in the image and use thecanvasdrawRect () method to draw the rectangle and passinto the mask matrix Create a mask object as the displayposition of the segmented yellow sticky board image whichis the image of the CvTypeCV 8UC1 channel that needs tobe of the same size as the original image Black is used as thecolor of scallar which means the background of output imageis black as well Finally the segmentation can be completed bycalling the arguments

Use the perspectiveTransform () method to correct theyellow sticky board Use the ldquofor-cyclerdquo to traverse the fouredge vertexes of the two intersecting lines in the segmentedimage by using GrabCut Then compare the coordinates ofthe four vertexeswith themidpoint of the yellow sticky boardFor example in the coordinates (119909 119910) of the horizontal axisthe value of the vertical axis is less than the correspondingvalue of the midpoint then the point is the top left vertexAccording to the upper left upper right lower left and lowerright of the order of the four vertex coordinates in the variable

Journal of Sensors 5

(a) In greenhouse (b) Orchard

Figure 5 Practical application of aphid counting software

called startM the perspective transformation method can becorrected

Use single image difference method to extract aphidsThrough the Imgproc class cvtColor color image will beconverted to the output image grayMat gray image Setthe parameters of nuclear value Size (119908 ℎ) as Size (51 51)then use the ImgprocGaussianBlur method to completethe process of fuzzy background Use Coreabsdiff() fordifferential operation Use the ImgprocTHRESH OTSU forthreshold operation after difference background image Thedifferential images need to undergomorphological corrosionto remove the effects of the aphids Set the morphologicalaction as MORPH ERODE and set the shape of structureelement kernel1 as MORPH ELLIPSE with a new Size (5 5)by using getStructuringElement() Elimination of adhesionswill be completed

(iii) Image Counting Module The image counting modulefilters the contours based on the total pixel range in eachconnected domain and stores the count on the counter Theoutput value is the number of aphids

The counting process can be seen as a traversal of theldquofunnelrdquo then we should define two containers the first con-tainer is stored in all the contour data whether or notmeetingthe characteristics of the requirements and the second con-tainer is stored after the screening of the contour informationTraverse the contour type to ImgprocRETR CCOMP andoutput it as ImgprocCHAIN APPROX SIMPLE The ldquofor-cyclerdquo is the key of selecting Set 15 px to 18 px as the shape ofaphids image in the connected domain and set scallar (255255 255) to show aphids as white

3 Results and Discussions

Using the aphid counting software to count the images ingreenhouse and the images in orchards Figure 5(a) shows

50 13012011010090807060

50

60

70

80

90

100

110

120

130

140

GreenhouseOrchardLinear fit of greenhouse

Man

ual c

ount

s num

ber

APP counts number

Equation

Manual countsnumber

Manual countsnumber

Intercept

Slope

Value Standard error

104846 002468

183911minus229425

y = a + b lowast x

adj R2 099504

Figure 6 The comparison of accuracy between the manual countand the APP count

the counting results of the aphids in the greenhouse andFigure 5(b) shows the counting results of the aphids in theorchard

Based on the least squares method a linear regressionanalysis has been carried out by taking 10 sets of data fromTable 2 in the greenhouse to get the fitting curve 119909-axis isthe APP counts number and 119910-axis is the manual countsnumber As shown in Figure 6 the relationship of the fittingbetween the mobile APP count and the manual count is119910 = 104846119909 minus 229425 the fit degree 1198772 factor is up to

6 Journal of Sensors

Table 2 Error analysis of manual count and APP count

Image source Image number Number of manual countsmonth APP counts numbermonth Relative error Accuracy

Greenhouse

(1) 52 52 0 100(2) 80 79 125 9875(3) 62 61 161 9838(4) 84 82 238 9761(5) 86 87 116 9883(6) 55 53 37 9622(7) 54 54 0 100(8) 69 67 29 9701(9) 70 70 0 100(10) 121 116 413 9586

Orchard (11) 71 66 704 9295(12) 138 128 724 9275

099504 indicating that the aphid recognition and mobileAPP counting can be used to achieve functions of recognitionand counting Adding two sets of orchard data from Table 2into the coordinate system we can find that the two pointsare in the vicinity of the curve indicating that the method isbasically effective Because the orchard environment is morecomplex the accuracy rate of the method is slightly worsethan the greenhouse as shown in Table 2 the greenhouseaccuracy rate is up to 95 and orchard accuracy rate is upto 92 In general the aphids identification and countingmethod is highly reliable

4 Conclusion

In the past aphid identification focuses on the separation ofa single kind of aphids few on different kinds of pests Thecount number is less and the aphidsrsquo antennae foot andwings need to be extracted precisely because the operationcomplexity is high most of the application software thatimplements the aphid recognition and counting function isconcentrated on the PC side The traditional counting APPcollects the photos through the Internet to transfer data bythe PC processing and then the results return back to themobile App the process Overreliance on the PC side andthe Internet its real time performance is poor Collection ofaphids requires special equipment this professional equip-ment is not convenient and also very expensive The devicethat collects the aphids is not universal

This paper uses yellow sticky board in the naturalenvironment to attracts aphids and some other pests andcollects images in the real growth environment of plantsAphid counting software overcomes the complex naturalenvironment and the impact of light caused by image pro-cessing difficulties it does not rely on the PC side and thenetwork feedback it can quickly identify and count aphidswhich are the representative of the pest group it has verypractical value The accuracy of the aphid counting softwareis compared with the result of manual counting the accuracyrate of the aphid counting software is more than 95 inthe greenhouse environment the accuracy rate of the aphidcounting software is more than 92The operation is smooth

and convenient The method proposed in this paper canextract and correct the image of yellow sticky board eliminateinfluence of illumination on the image and count aphidsaccurately

Due to the limitations of the season and the study site theaphid counting software needs to design a memory storagemodule to achieve the same number of yellow sticky insectboards to make trend prediction function

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the new facilities of agriculturalmachinery research and development (17227206D)

References

[1] X Zhan-li L Xiao-xia Z Qing-wen et al ldquoCharacteristics ofaphid age identification of wheat long piperdquo Acta EntomologicaSinica vol 01 pp 81ndash87 2014

[2] R Cassani T H Falk F J Fraga P A Kanda and R AnghinahldquoTowards automated EEG-Based Alzheimerrsquos disease diagnosisusing relevance vector machinesrdquo in Proceedings of the 5thISSNIP - IEEE Biosignals and Biorobotics Conference (BRC rsquo14)pp 1ndash6 IEEE May 2014

[3] S Chakraborty and A C Newton ldquoClimate change plantdiseases and food security an overviewrdquo Plant Pathology vol60 no 1 pp 2ndash14 2011

[4] M Pal and G M Foody ldquoEvaluation of SVM RVM and SMLRfor accurate image classificationwith limited grounddatardquo IEEEJournal of Selected Topics in Applied Earth Observations andRemote Sensing vol 5 no 5 pp 1344ndash1355 2012

[5] H N Patel R K Jain and M V Joshi ldquoFruit detection usingimproved multiple features based algorithmrdquo InternationalJournal of Computer Applications vol 13 no 2 pp 1ndash5 2011

[6] J Luo D Wang Y Dong W Huang and J Wang ldquoDevelopingan aphid damage hyperspectral index for detecting aphid(Hemiptera Aphididae) damage levels in winter wheatrdquo inProceedings of the 2011 IEEE International Geoscience and

Journal of Sensors 7

Remote Sensing Symposium (IGARSS rsquo11) pp 1744ndash1747 IEEEJuly 2011

[7] C Yue-huaHU Xiao-guang andZ Chang-li ldquoStudy onwheatpest segmentation algorithm based on machine visionrdquo Journalof Agricultural Engineering vol 12 pp 187ndash191 2007

[8] Q Bai-jing W Tian-bo L Juan-juan et al ldquoImage recognitionand counting method of cucumber aphidsrdquo Journal of Agricul-tural Mechanization vol 08 pp 151ndash155 2010

[9] R Jingxiao Image-based pest automatic counting and recognitionsystem Zhejiang University 2014

[10] M Vincent et al ldquoTowards a Video Camera Network for EarlyPest Detection in Greenhousesrdquo 2008 httpwww-sopinriafrpulsarprojectsbioserrefileendurepdf

[11] P Tirelli N A Borghese F Pedersini G Galassi and ROberti ldquoAutomatic monitoring of pest insects traps by Zigbee-based wireless networking of image sensorsrdquo in Proceedings ofthe 2011 IEEE International Instrumentation and MeasurementTechnology Conference (I2MTC rsquo11) pp 1ndash5 IEEE May 2011

[12] J Wang L Ji A Liang and D Yuan ldquoThe identification of but-terfly families using content-based image retrievalrdquo BiosystemsEngineering vol 111 no 1 pp 24ndash32 2012

[13] H Ran Image Segmentation Algorithm Based on Visual Atten-tionMechanism and Its Application Beijing Jiaotong University2016

[14] D Qin W Yanjie and H Han Guangliang ldquoPerspective cor-rection based on improved Hough transform and perspectivetransformationrdquo Journal of Liquid Crystals and Display vol 04pp 552ndash556 2012

[15] J Faria T Martins M Ferreira and C Santos ldquoA computervision system for color gradingwoodboards using Fuzzy Logicrdquoin Proceedings of the 2008 IEEE International Symposium onIndustrial Electronics (ISIE rsquo08) pp 1082ndash1087 July 2008

[16] Z Jian-wei W Yong-mo and S Zu-ruo ldquoStudy on automaticcounting of aphids in wheat fieldrdquo Chinese Journal of Agricul-tural Engineering vol 09 pp 159ndash162 2006

[17] W Zhi-bin W Kai-yi Z Shui-fa and M Cui-xia ldquoClasscounting algorithm of whitefly based on K-means clusteringand elliptic fitting methodrdquo Journal of Agricultural Engineeringvol 01 pp 105ndash112 2014

[18] B Kui J Chao L Lei and W Cheng ldquoNon-nondestructivemeasurement of wheat morphological characteristics basedon morphological image processingrdquo Journal of AgriculturalEngineering vol 12 pp 212ndash216 2010

[19] N Goncalves V Carvalho M Belsley R M Vasconcelos FO Soares and J Machado ldquoYarn features extraction usingimage processing and computer visionmdasha studywith cotton andpolyester yarnsrdquoMeasurement vol 68 pp 1ndash15 2015

[20] WHuaxu ldquoDevelopment and design of software framework forandroid platform image processing softwarerdquo Software vol 02pp 46-47 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal of

Volume 201

Submit your manuscripts athttpswwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 201

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 2: Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

2 Journal of Sensors

poor timeliness Therefore to obtain images in the complexenvironment and high impact of the scene pests can beidentified and counted without relying on the feedback of thePC side

2 Materials and Methods

The acquisition of experimental images was obtained at theWest Campus of Agricultural University of Hebei imageacquisition equipment is Samsung Galaxy 4 phone that hasa Qualcomm eight-core processor with Android 23 systemAPI 25 It is a common type with satisfactory parametersThe chapter contains two parts of picture distillation inthe first part the GrabCut algorithm [12] is used to extractyellow sticky board image from complex background andcorrect it to the same size and position by perspectivecorrection method in order to extract aphid image [13] inthe second part the method of weighted average gray scaleis used to make the yellow sticky board image preprocessingsingle image difference method is used to eliminate theinfluence of illumination and OSTU threshold segmentationand morphological erosion method is used to extract yellowsticky board image laying the groundwork for the subsequentcounting program

21 Extraction the of Yellow Sticky Board Image GrabCutis an improved algorithm based on GraphCut GrabCut isan algorithm that uses the RGB three-channel hybrid Gaussmodel for color segmentation segmentation can be com-pleted by using region pixel set which contains backgroundThe algorithm belongs to iterative segmentation and thesegmentation accuracy is higher Gibbs energy function is aspecific vocabulary that means a formula that can calculatethe weights and cost

119864 (120572 119901 120579 119911) = 119880 (120573 119901 120579 119911) + 119881 (120572 119911) (1)

119880 is a method when the target pixels are classified asforeground or background models which are obtained bymatrix119863 iteration of classifying and rewriting pixel

119880(120572 119901 120579 119911) = sum119899

119863(120572119899 119901119899 120579 119911119899)

119863 (120572119899 119901119899 120579 119911119899) = log120587 (120572119899 119901119899) + 12 log detsum(120572119899 119901119899)

+ 12 [119911119899 minus 120583 (120572119899 119901119899)minus1]

sdot sum (120572119899 119901119899)minus1 [119911119899 minus 120583 (120572119899 119901119899)]minus1

(2)

119881 is the boundary energy smoothing term when theboundary pixels are discontinuous it will do some boundarypixel classification processing

119881 (120572 119911) = 120574 sum(119909119910)isin119888

[120572119909 120572119910] exp minus 120573 10038171003817100381710038171003817119911119909 minus 119911119910100381710038171003817100381710038172 (3)

120579 makes the boundary energy more and more little byiterative method after iteration the parameters of the Gaussmixture model of target and background are higher

120579 = 120587 (120572 119901) 120583 (120572 119901) sum (120572 119901) 120572 = 0 1 119896= 1 sdot sdot sdot 119896

(4)

22 Correction of Yellow Sticky Board Because the shootingangle is not fixed the positions of yellow sticky board whichhas been extracted are not fixed In order to improve theaccuracy of aphid identification and counting the yellowsticky board must be corrected to the same size and the sameposition when a target image has been segmented getting theelevation view the aphids can be counted accurately

Transformation from distortion to elevation view canbe completed by using perspective correction method [14]which uses the four vertexes of distortion image and elevationview as the correction basisThe top left vertex (119909 119910) is the keyof correction Firstly the corrected image matrix [1199092 1199102 1199112]is obtained by using the distorted image matrix [1199091 1199101 1199111]you can get the top left vertex (119909 119910) by using the relationshipbetween [1199091 1199101 1199111] Secondly according to top left vertexthe length and width of the rectangle can be used to obtainthe information of four vertices

119863 = [1199092 1199102 1199112] = [1199092 1199102 1199112] [[[

11988611 11988612 1198861311988621 11988622 1198862311988631 11988632 11988633

]]]

119909 = 11990921199112 =119886111199091 + 119886211199101 + 11988631119886131199091 + 119886231199101 + 11988633

119909 = 11991021199112 =119886121199091 + 119886221199101 + 11988632119886131199091 + 119886231199101 + 11988633

(5)

Figure 1 is the elevation view of yellow sticky board byusing GrabCut and perspective correction method We cansee that the picture has a clear boundary and regular shapewhich will make the aphids extracted easily

23 The Image of the Yellow Sticky Board Preprocessing Thecolor image change into gray image can reduce amount ofcomputation in the image processing process and reduce thecomplexity of the calculation [15 16] the gray scale valueobtained by the weighted gray scale method is more in linewith the perception of the corresponding gray scale of eachpixel and the brightness is moderate it is conducive to thenext aphid image extraction

24 Aphids Extraction

241 Image Difference Due to the influence of light evenif more than two thresholds segmentations are proposedeach of the pictures taken in the natural environment hasan uncertain gray value so the threshold is uncertain tooAphid color is relatively single so the impact of light ismainly reflected in the background an image can be seen toconsist of foreground and background when the backgroundis removed the influence of light is removed Regarding the

Journal of Sensors 3

Figure 1 Perspective correction

process of image difference firstly the original gray imagewill be taken for fuzzification as SRC and then subtract thefuzzy background DST The difference that results DIFF isthe aphids image

SRC minus DST = DIFF (6)

242 Fuzzy Background The gray scale image after blurringis compared with the gray scale distribution in the originalgray scale graph and if the local gray scale distribution isequal it can be used as the background image Comparedwith the fuzzy effect of the three filters the Gaussian weightfilter has the smallest noise which is consistent with theoriginal gray scale distribution When the kernel value is (5151) the background blurring is the best

243 Threshold Selection Image difference is only grayimage and the gray image is not the result of image seg-mentation and needs the threshold segmentation [17] Alarge number of aphids are missing counted by using binarythreshold method while there are too many contour breakpoints by using self-adaption thresholdmethod So this paperuses the OSTU threshold segmentation method which has aclear and integrated contour as the binarization method

244 Morphological Operation In the natural environmentthe aphids on the yellow sticky board have a high base anda high density and some of the aphidsrsquo adhesion does notaffect the overall counting result and requires some corrosionof the partially adhered aphids to reduce the error Thispaper uses the elliptical nucleus with a nuclear value of (4 4)for corrosion operation This method has a good effect onelimination of adhesions

119864 (119909) = 119886 | 119861119886 isin 119883 = 119883Θ119861 (7)

Figure 2 shows the use of image difference algorithm toobtain the aphid images aphid images are clear and complete

Figure 2 Image difference method for extracting aphids

Figure 3 A digital mark of a binary image

25 Aphids Count251 Feature Extraction In order to count accurately it isnecessary to identify whether there are aphids With accessto relevant information we can see that the aphidrsquos length isbetween 15mmand 49mmMost aphids are 2mm in lengthand there are differences in the lengths of other insects in theorchard for example the apple leaf mites are about 03mmSo distinguish between aphids and nonaphids according toarea characteristics First all the contours in the binary imageare identified as digital marks and the sum of the pixels ineach connection domain is calculated to find the relationshipbetween the actual length of the aphids and the pixel valuesas shown in Figure 3

According to Table 1 based on the relationship betweenthe pixel values in each connected domain and the actuallengths of aphids we can draw a conclusion that when thepixel value is less than 20 the insectrsquos body length increases by01mmand the pixel value is increased by 1 pxsim2 px when thepixel value is higher than 20 the insectrsquos body length increasesby 01mm and the pixel value is increased by 3 pxsim4 px Inthis paper the aphids involved are mostly 15mm to 28mmso when the aphid area characteristics range from 15 px to48 px nonaphids range from 1 px to 10 px is themost suitableAccording to the range of aphid area characteristics derivedfrom the above study to identify aphid images on the yellowsticky board [18] in the obtained result graph the aphid

4 Journal of Sensors

Table 1 Part of the connection domain number pixel values andthe relationship between the lengths of pests

Pest category The pixel value within the contour (contournumber pixel value and aphid lengthmm)

Aphid

(29 41 26) (31 28 22) (32 35 25)(34 21 2) (35 19 19) (36 19 19)(37 20 19) (38 21 19) (39 27 22)(43 32 22) (44 29 22) (45 19 18)(47 20 19) (48 20 19) (49 42 26)(50 18 19) (51 40 26) (53 35 25)(56 25 21) (58 19 18) (60 23 21)(61 48 28) (63 32 24) (64 19 19)

Nonaphids(30 2 02) (41 4 04) (52 6 06)(42 9 09) (54 8 09) (57 10 1)(59 9 09) (65 10 1)

image is marked with white and nonaphid images are notmarked with white consistent with the human eye

252 Aphids Counting Method Using findContours() con-tour extraction method to find all the contours of the imageFirstly the outline which can be detected in the image willbe converted to vector form to iterate and then the aphidssection will be screened out by using ldquofor-cyclerdquo according totheir area features [19]

26 Design and Implementation Based onthe Android Platform

261 SoftwareOverall FlowChart In order tomeet the needsof the public for the convenience of equipment Androidsystem as a mobile platform mainstream system [20] in themobile side of the software development plays a guidingrole based on the Android platform aphid count APP willgreatly facilitate the majority of farmers and agriculturalscience and technology workers The aphid counting soft-ware in this paper uses the Java programming languagein the Android studio platform with OpenCV computervision library development for Android 403 and above Thesoftware implements the counting of aphids the whole isdivided into threemodules image acquisitionmodule imageprocessing module and image counting module as shownin Figure 4 now we design and implement the part of thecontent of the software

(i) ImageAcquisitionModuleThe software obtains the picturein two ways invoking the local camera to shoot in realtime or retrieving the existing photo in the local albumAfter the photo is taken to ensure the quality of the picturethe appropriate image compression can not only reduce thecomputational complexity of the image processing processbut also avoid the overflow caused by the image beingtoo large to cause the program to crash First create anintent object and set the action of the object as the stringof MediaStore ACTION IMAGE CAPTURE Then use thestring of startActivityForResult to start Intent program Aftersetting the length and width the image information will be

Call the local camera

Main interface

Retrieve the local album image

Image compression

Extraction of yellow sticky board

Correction of yellow stickyboard

Aphid extraction

Identification and counting of aphids

Image acquisition module

Image processing module

Image counting module

Figure 4 Software flow chart

loaded into Imageview by using decodeFile method At lastthe image information will return and be displayed on thenext interface

(ii) Image Processing Module In the image processing mod-ule we set ldquoyellow sticky board segmentationrdquo ldquoyellowsticky board correctionrdquo ldquoaphids identificationrdquo to extract theaphids

Using GrabCut algorithm to extract yellow sticky boardfirst create a Rect object to create a rectangular box toselect the possible prospects in the image and use thecanvasdrawRect () method to draw the rectangle and passinto the mask matrix Create a mask object as the displayposition of the segmented yellow sticky board image whichis the image of the CvTypeCV 8UC1 channel that needs tobe of the same size as the original image Black is used as thecolor of scallar which means the background of output imageis black as well Finally the segmentation can be completed bycalling the arguments

Use the perspectiveTransform () method to correct theyellow sticky board Use the ldquofor-cyclerdquo to traverse the fouredge vertexes of the two intersecting lines in the segmentedimage by using GrabCut Then compare the coordinates ofthe four vertexeswith themidpoint of the yellow sticky boardFor example in the coordinates (119909 119910) of the horizontal axisthe value of the vertical axis is less than the correspondingvalue of the midpoint then the point is the top left vertexAccording to the upper left upper right lower left and lowerright of the order of the four vertex coordinates in the variable

Journal of Sensors 5

(a) In greenhouse (b) Orchard

Figure 5 Practical application of aphid counting software

called startM the perspective transformation method can becorrected

Use single image difference method to extract aphidsThrough the Imgproc class cvtColor color image will beconverted to the output image grayMat gray image Setthe parameters of nuclear value Size (119908 ℎ) as Size (51 51)then use the ImgprocGaussianBlur method to completethe process of fuzzy background Use Coreabsdiff() fordifferential operation Use the ImgprocTHRESH OTSU forthreshold operation after difference background image Thedifferential images need to undergomorphological corrosionto remove the effects of the aphids Set the morphologicalaction as MORPH ERODE and set the shape of structureelement kernel1 as MORPH ELLIPSE with a new Size (5 5)by using getStructuringElement() Elimination of adhesionswill be completed

(iii) Image Counting Module The image counting modulefilters the contours based on the total pixel range in eachconnected domain and stores the count on the counter Theoutput value is the number of aphids

The counting process can be seen as a traversal of theldquofunnelrdquo then we should define two containers the first con-tainer is stored in all the contour data whether or notmeetingthe characteristics of the requirements and the second con-tainer is stored after the screening of the contour informationTraverse the contour type to ImgprocRETR CCOMP andoutput it as ImgprocCHAIN APPROX SIMPLE The ldquofor-cyclerdquo is the key of selecting Set 15 px to 18 px as the shape ofaphids image in the connected domain and set scallar (255255 255) to show aphids as white

3 Results and Discussions

Using the aphid counting software to count the images ingreenhouse and the images in orchards Figure 5(a) shows

50 13012011010090807060

50

60

70

80

90

100

110

120

130

140

GreenhouseOrchardLinear fit of greenhouse

Man

ual c

ount

s num

ber

APP counts number

Equation

Manual countsnumber

Manual countsnumber

Intercept

Slope

Value Standard error

104846 002468

183911minus229425

y = a + b lowast x

adj R2 099504

Figure 6 The comparison of accuracy between the manual countand the APP count

the counting results of the aphids in the greenhouse andFigure 5(b) shows the counting results of the aphids in theorchard

Based on the least squares method a linear regressionanalysis has been carried out by taking 10 sets of data fromTable 2 in the greenhouse to get the fitting curve 119909-axis isthe APP counts number and 119910-axis is the manual countsnumber As shown in Figure 6 the relationship of the fittingbetween the mobile APP count and the manual count is119910 = 104846119909 minus 229425 the fit degree 1198772 factor is up to

6 Journal of Sensors

Table 2 Error analysis of manual count and APP count

Image source Image number Number of manual countsmonth APP counts numbermonth Relative error Accuracy

Greenhouse

(1) 52 52 0 100(2) 80 79 125 9875(3) 62 61 161 9838(4) 84 82 238 9761(5) 86 87 116 9883(6) 55 53 37 9622(7) 54 54 0 100(8) 69 67 29 9701(9) 70 70 0 100(10) 121 116 413 9586

Orchard (11) 71 66 704 9295(12) 138 128 724 9275

099504 indicating that the aphid recognition and mobileAPP counting can be used to achieve functions of recognitionand counting Adding two sets of orchard data from Table 2into the coordinate system we can find that the two pointsare in the vicinity of the curve indicating that the method isbasically effective Because the orchard environment is morecomplex the accuracy rate of the method is slightly worsethan the greenhouse as shown in Table 2 the greenhouseaccuracy rate is up to 95 and orchard accuracy rate is upto 92 In general the aphids identification and countingmethod is highly reliable

4 Conclusion

In the past aphid identification focuses on the separation ofa single kind of aphids few on different kinds of pests Thecount number is less and the aphidsrsquo antennae foot andwings need to be extracted precisely because the operationcomplexity is high most of the application software thatimplements the aphid recognition and counting function isconcentrated on the PC side The traditional counting APPcollects the photos through the Internet to transfer data bythe PC processing and then the results return back to themobile App the process Overreliance on the PC side andthe Internet its real time performance is poor Collection ofaphids requires special equipment this professional equip-ment is not convenient and also very expensive The devicethat collects the aphids is not universal

This paper uses yellow sticky board in the naturalenvironment to attracts aphids and some other pests andcollects images in the real growth environment of plantsAphid counting software overcomes the complex naturalenvironment and the impact of light caused by image pro-cessing difficulties it does not rely on the PC side and thenetwork feedback it can quickly identify and count aphidswhich are the representative of the pest group it has verypractical value The accuracy of the aphid counting softwareis compared with the result of manual counting the accuracyrate of the aphid counting software is more than 95 inthe greenhouse environment the accuracy rate of the aphidcounting software is more than 92The operation is smooth

and convenient The method proposed in this paper canextract and correct the image of yellow sticky board eliminateinfluence of illumination on the image and count aphidsaccurately

Due to the limitations of the season and the study site theaphid counting software needs to design a memory storagemodule to achieve the same number of yellow sticky insectboards to make trend prediction function

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the new facilities of agriculturalmachinery research and development (17227206D)

References

[1] X Zhan-li L Xiao-xia Z Qing-wen et al ldquoCharacteristics ofaphid age identification of wheat long piperdquo Acta EntomologicaSinica vol 01 pp 81ndash87 2014

[2] R Cassani T H Falk F J Fraga P A Kanda and R AnghinahldquoTowards automated EEG-Based Alzheimerrsquos disease diagnosisusing relevance vector machinesrdquo in Proceedings of the 5thISSNIP - IEEE Biosignals and Biorobotics Conference (BRC rsquo14)pp 1ndash6 IEEE May 2014

[3] S Chakraborty and A C Newton ldquoClimate change plantdiseases and food security an overviewrdquo Plant Pathology vol60 no 1 pp 2ndash14 2011

[4] M Pal and G M Foody ldquoEvaluation of SVM RVM and SMLRfor accurate image classificationwith limited grounddatardquo IEEEJournal of Selected Topics in Applied Earth Observations andRemote Sensing vol 5 no 5 pp 1344ndash1355 2012

[5] H N Patel R K Jain and M V Joshi ldquoFruit detection usingimproved multiple features based algorithmrdquo InternationalJournal of Computer Applications vol 13 no 2 pp 1ndash5 2011

[6] J Luo D Wang Y Dong W Huang and J Wang ldquoDevelopingan aphid damage hyperspectral index for detecting aphid(Hemiptera Aphididae) damage levels in winter wheatrdquo inProceedings of the 2011 IEEE International Geoscience and

Journal of Sensors 7

Remote Sensing Symposium (IGARSS rsquo11) pp 1744ndash1747 IEEEJuly 2011

[7] C Yue-huaHU Xiao-guang andZ Chang-li ldquoStudy onwheatpest segmentation algorithm based on machine visionrdquo Journalof Agricultural Engineering vol 12 pp 187ndash191 2007

[8] Q Bai-jing W Tian-bo L Juan-juan et al ldquoImage recognitionand counting method of cucumber aphidsrdquo Journal of Agricul-tural Mechanization vol 08 pp 151ndash155 2010

[9] R Jingxiao Image-based pest automatic counting and recognitionsystem Zhejiang University 2014

[10] M Vincent et al ldquoTowards a Video Camera Network for EarlyPest Detection in Greenhousesrdquo 2008 httpwww-sopinriafrpulsarprojectsbioserrefileendurepdf

[11] P Tirelli N A Borghese F Pedersini G Galassi and ROberti ldquoAutomatic monitoring of pest insects traps by Zigbee-based wireless networking of image sensorsrdquo in Proceedings ofthe 2011 IEEE International Instrumentation and MeasurementTechnology Conference (I2MTC rsquo11) pp 1ndash5 IEEE May 2011

[12] J Wang L Ji A Liang and D Yuan ldquoThe identification of but-terfly families using content-based image retrievalrdquo BiosystemsEngineering vol 111 no 1 pp 24ndash32 2012

[13] H Ran Image Segmentation Algorithm Based on Visual Atten-tionMechanism and Its Application Beijing Jiaotong University2016

[14] D Qin W Yanjie and H Han Guangliang ldquoPerspective cor-rection based on improved Hough transform and perspectivetransformationrdquo Journal of Liquid Crystals and Display vol 04pp 552ndash556 2012

[15] J Faria T Martins M Ferreira and C Santos ldquoA computervision system for color gradingwoodboards using Fuzzy Logicrdquoin Proceedings of the 2008 IEEE International Symposium onIndustrial Electronics (ISIE rsquo08) pp 1082ndash1087 July 2008

[16] Z Jian-wei W Yong-mo and S Zu-ruo ldquoStudy on automaticcounting of aphids in wheat fieldrdquo Chinese Journal of Agricul-tural Engineering vol 09 pp 159ndash162 2006

[17] W Zhi-bin W Kai-yi Z Shui-fa and M Cui-xia ldquoClasscounting algorithm of whitefly based on K-means clusteringand elliptic fitting methodrdquo Journal of Agricultural Engineeringvol 01 pp 105ndash112 2014

[18] B Kui J Chao L Lei and W Cheng ldquoNon-nondestructivemeasurement of wheat morphological characteristics basedon morphological image processingrdquo Journal of AgriculturalEngineering vol 12 pp 212ndash216 2010

[19] N Goncalves V Carvalho M Belsley R M Vasconcelos FO Soares and J Machado ldquoYarn features extraction usingimage processing and computer visionmdasha studywith cotton andpolyester yarnsrdquoMeasurement vol 68 pp 1ndash15 2015

[20] WHuaxu ldquoDevelopment and design of software framework forandroid platform image processing softwarerdquo Software vol 02pp 46-47 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal of

Volume 201

Submit your manuscripts athttpswwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 201

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 3: Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

Journal of Sensors 3

Figure 1 Perspective correction

process of image difference firstly the original gray imagewill be taken for fuzzification as SRC and then subtract thefuzzy background DST The difference that results DIFF isthe aphids image

SRC minus DST = DIFF (6)

242 Fuzzy Background The gray scale image after blurringis compared with the gray scale distribution in the originalgray scale graph and if the local gray scale distribution isequal it can be used as the background image Comparedwith the fuzzy effect of the three filters the Gaussian weightfilter has the smallest noise which is consistent with theoriginal gray scale distribution When the kernel value is (5151) the background blurring is the best

243 Threshold Selection Image difference is only grayimage and the gray image is not the result of image seg-mentation and needs the threshold segmentation [17] Alarge number of aphids are missing counted by using binarythreshold method while there are too many contour breakpoints by using self-adaption thresholdmethod So this paperuses the OSTU threshold segmentation method which has aclear and integrated contour as the binarization method

244 Morphological Operation In the natural environmentthe aphids on the yellow sticky board have a high base anda high density and some of the aphidsrsquo adhesion does notaffect the overall counting result and requires some corrosionof the partially adhered aphids to reduce the error Thispaper uses the elliptical nucleus with a nuclear value of (4 4)for corrosion operation This method has a good effect onelimination of adhesions

119864 (119909) = 119886 | 119861119886 isin 119883 = 119883Θ119861 (7)

Figure 2 shows the use of image difference algorithm toobtain the aphid images aphid images are clear and complete

Figure 2 Image difference method for extracting aphids

Figure 3 A digital mark of a binary image

25 Aphids Count251 Feature Extraction In order to count accurately it isnecessary to identify whether there are aphids With accessto relevant information we can see that the aphidrsquos length isbetween 15mmand 49mmMost aphids are 2mm in lengthand there are differences in the lengths of other insects in theorchard for example the apple leaf mites are about 03mmSo distinguish between aphids and nonaphids according toarea characteristics First all the contours in the binary imageare identified as digital marks and the sum of the pixels ineach connection domain is calculated to find the relationshipbetween the actual length of the aphids and the pixel valuesas shown in Figure 3

According to Table 1 based on the relationship betweenthe pixel values in each connected domain and the actuallengths of aphids we can draw a conclusion that when thepixel value is less than 20 the insectrsquos body length increases by01mmand the pixel value is increased by 1 pxsim2 px when thepixel value is higher than 20 the insectrsquos body length increasesby 01mm and the pixel value is increased by 3 pxsim4 px Inthis paper the aphids involved are mostly 15mm to 28mmso when the aphid area characteristics range from 15 px to48 px nonaphids range from 1 px to 10 px is themost suitableAccording to the range of aphid area characteristics derivedfrom the above study to identify aphid images on the yellowsticky board [18] in the obtained result graph the aphid

4 Journal of Sensors

Table 1 Part of the connection domain number pixel values andthe relationship between the lengths of pests

Pest category The pixel value within the contour (contournumber pixel value and aphid lengthmm)

Aphid

(29 41 26) (31 28 22) (32 35 25)(34 21 2) (35 19 19) (36 19 19)(37 20 19) (38 21 19) (39 27 22)(43 32 22) (44 29 22) (45 19 18)(47 20 19) (48 20 19) (49 42 26)(50 18 19) (51 40 26) (53 35 25)(56 25 21) (58 19 18) (60 23 21)(61 48 28) (63 32 24) (64 19 19)

Nonaphids(30 2 02) (41 4 04) (52 6 06)(42 9 09) (54 8 09) (57 10 1)(59 9 09) (65 10 1)

image is marked with white and nonaphid images are notmarked with white consistent with the human eye

252 Aphids Counting Method Using findContours() con-tour extraction method to find all the contours of the imageFirstly the outline which can be detected in the image willbe converted to vector form to iterate and then the aphidssection will be screened out by using ldquofor-cyclerdquo according totheir area features [19]

26 Design and Implementation Based onthe Android Platform

261 SoftwareOverall FlowChart In order tomeet the needsof the public for the convenience of equipment Androidsystem as a mobile platform mainstream system [20] in themobile side of the software development plays a guidingrole based on the Android platform aphid count APP willgreatly facilitate the majority of farmers and agriculturalscience and technology workers The aphid counting soft-ware in this paper uses the Java programming languagein the Android studio platform with OpenCV computervision library development for Android 403 and above Thesoftware implements the counting of aphids the whole isdivided into threemodules image acquisitionmodule imageprocessing module and image counting module as shownin Figure 4 now we design and implement the part of thecontent of the software

(i) ImageAcquisitionModuleThe software obtains the picturein two ways invoking the local camera to shoot in realtime or retrieving the existing photo in the local albumAfter the photo is taken to ensure the quality of the picturethe appropriate image compression can not only reduce thecomputational complexity of the image processing processbut also avoid the overflow caused by the image beingtoo large to cause the program to crash First create anintent object and set the action of the object as the stringof MediaStore ACTION IMAGE CAPTURE Then use thestring of startActivityForResult to start Intent program Aftersetting the length and width the image information will be

Call the local camera

Main interface

Retrieve the local album image

Image compression

Extraction of yellow sticky board

Correction of yellow stickyboard

Aphid extraction

Identification and counting of aphids

Image acquisition module

Image processing module

Image counting module

Figure 4 Software flow chart

loaded into Imageview by using decodeFile method At lastthe image information will return and be displayed on thenext interface

(ii) Image Processing Module In the image processing mod-ule we set ldquoyellow sticky board segmentationrdquo ldquoyellowsticky board correctionrdquo ldquoaphids identificationrdquo to extract theaphids

Using GrabCut algorithm to extract yellow sticky boardfirst create a Rect object to create a rectangular box toselect the possible prospects in the image and use thecanvasdrawRect () method to draw the rectangle and passinto the mask matrix Create a mask object as the displayposition of the segmented yellow sticky board image whichis the image of the CvTypeCV 8UC1 channel that needs tobe of the same size as the original image Black is used as thecolor of scallar which means the background of output imageis black as well Finally the segmentation can be completed bycalling the arguments

Use the perspectiveTransform () method to correct theyellow sticky board Use the ldquofor-cyclerdquo to traverse the fouredge vertexes of the two intersecting lines in the segmentedimage by using GrabCut Then compare the coordinates ofthe four vertexeswith themidpoint of the yellow sticky boardFor example in the coordinates (119909 119910) of the horizontal axisthe value of the vertical axis is less than the correspondingvalue of the midpoint then the point is the top left vertexAccording to the upper left upper right lower left and lowerright of the order of the four vertex coordinates in the variable

Journal of Sensors 5

(a) In greenhouse (b) Orchard

Figure 5 Practical application of aphid counting software

called startM the perspective transformation method can becorrected

Use single image difference method to extract aphidsThrough the Imgproc class cvtColor color image will beconverted to the output image grayMat gray image Setthe parameters of nuclear value Size (119908 ℎ) as Size (51 51)then use the ImgprocGaussianBlur method to completethe process of fuzzy background Use Coreabsdiff() fordifferential operation Use the ImgprocTHRESH OTSU forthreshold operation after difference background image Thedifferential images need to undergomorphological corrosionto remove the effects of the aphids Set the morphologicalaction as MORPH ERODE and set the shape of structureelement kernel1 as MORPH ELLIPSE with a new Size (5 5)by using getStructuringElement() Elimination of adhesionswill be completed

(iii) Image Counting Module The image counting modulefilters the contours based on the total pixel range in eachconnected domain and stores the count on the counter Theoutput value is the number of aphids

The counting process can be seen as a traversal of theldquofunnelrdquo then we should define two containers the first con-tainer is stored in all the contour data whether or notmeetingthe characteristics of the requirements and the second con-tainer is stored after the screening of the contour informationTraverse the contour type to ImgprocRETR CCOMP andoutput it as ImgprocCHAIN APPROX SIMPLE The ldquofor-cyclerdquo is the key of selecting Set 15 px to 18 px as the shape ofaphids image in the connected domain and set scallar (255255 255) to show aphids as white

3 Results and Discussions

Using the aphid counting software to count the images ingreenhouse and the images in orchards Figure 5(a) shows

50 13012011010090807060

50

60

70

80

90

100

110

120

130

140

GreenhouseOrchardLinear fit of greenhouse

Man

ual c

ount

s num

ber

APP counts number

Equation

Manual countsnumber

Manual countsnumber

Intercept

Slope

Value Standard error

104846 002468

183911minus229425

y = a + b lowast x

adj R2 099504

Figure 6 The comparison of accuracy between the manual countand the APP count

the counting results of the aphids in the greenhouse andFigure 5(b) shows the counting results of the aphids in theorchard

Based on the least squares method a linear regressionanalysis has been carried out by taking 10 sets of data fromTable 2 in the greenhouse to get the fitting curve 119909-axis isthe APP counts number and 119910-axis is the manual countsnumber As shown in Figure 6 the relationship of the fittingbetween the mobile APP count and the manual count is119910 = 104846119909 minus 229425 the fit degree 1198772 factor is up to

6 Journal of Sensors

Table 2 Error analysis of manual count and APP count

Image source Image number Number of manual countsmonth APP counts numbermonth Relative error Accuracy

Greenhouse

(1) 52 52 0 100(2) 80 79 125 9875(3) 62 61 161 9838(4) 84 82 238 9761(5) 86 87 116 9883(6) 55 53 37 9622(7) 54 54 0 100(8) 69 67 29 9701(9) 70 70 0 100(10) 121 116 413 9586

Orchard (11) 71 66 704 9295(12) 138 128 724 9275

099504 indicating that the aphid recognition and mobileAPP counting can be used to achieve functions of recognitionand counting Adding two sets of orchard data from Table 2into the coordinate system we can find that the two pointsare in the vicinity of the curve indicating that the method isbasically effective Because the orchard environment is morecomplex the accuracy rate of the method is slightly worsethan the greenhouse as shown in Table 2 the greenhouseaccuracy rate is up to 95 and orchard accuracy rate is upto 92 In general the aphids identification and countingmethod is highly reliable

4 Conclusion

In the past aphid identification focuses on the separation ofa single kind of aphids few on different kinds of pests Thecount number is less and the aphidsrsquo antennae foot andwings need to be extracted precisely because the operationcomplexity is high most of the application software thatimplements the aphid recognition and counting function isconcentrated on the PC side The traditional counting APPcollects the photos through the Internet to transfer data bythe PC processing and then the results return back to themobile App the process Overreliance on the PC side andthe Internet its real time performance is poor Collection ofaphids requires special equipment this professional equip-ment is not convenient and also very expensive The devicethat collects the aphids is not universal

This paper uses yellow sticky board in the naturalenvironment to attracts aphids and some other pests andcollects images in the real growth environment of plantsAphid counting software overcomes the complex naturalenvironment and the impact of light caused by image pro-cessing difficulties it does not rely on the PC side and thenetwork feedback it can quickly identify and count aphidswhich are the representative of the pest group it has verypractical value The accuracy of the aphid counting softwareis compared with the result of manual counting the accuracyrate of the aphid counting software is more than 95 inthe greenhouse environment the accuracy rate of the aphidcounting software is more than 92The operation is smooth

and convenient The method proposed in this paper canextract and correct the image of yellow sticky board eliminateinfluence of illumination on the image and count aphidsaccurately

Due to the limitations of the season and the study site theaphid counting software needs to design a memory storagemodule to achieve the same number of yellow sticky insectboards to make trend prediction function

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the new facilities of agriculturalmachinery research and development (17227206D)

References

[1] X Zhan-li L Xiao-xia Z Qing-wen et al ldquoCharacteristics ofaphid age identification of wheat long piperdquo Acta EntomologicaSinica vol 01 pp 81ndash87 2014

[2] R Cassani T H Falk F J Fraga P A Kanda and R AnghinahldquoTowards automated EEG-Based Alzheimerrsquos disease diagnosisusing relevance vector machinesrdquo in Proceedings of the 5thISSNIP - IEEE Biosignals and Biorobotics Conference (BRC rsquo14)pp 1ndash6 IEEE May 2014

[3] S Chakraborty and A C Newton ldquoClimate change plantdiseases and food security an overviewrdquo Plant Pathology vol60 no 1 pp 2ndash14 2011

[4] M Pal and G M Foody ldquoEvaluation of SVM RVM and SMLRfor accurate image classificationwith limited grounddatardquo IEEEJournal of Selected Topics in Applied Earth Observations andRemote Sensing vol 5 no 5 pp 1344ndash1355 2012

[5] H N Patel R K Jain and M V Joshi ldquoFruit detection usingimproved multiple features based algorithmrdquo InternationalJournal of Computer Applications vol 13 no 2 pp 1ndash5 2011

[6] J Luo D Wang Y Dong W Huang and J Wang ldquoDevelopingan aphid damage hyperspectral index for detecting aphid(Hemiptera Aphididae) damage levels in winter wheatrdquo inProceedings of the 2011 IEEE International Geoscience and

Journal of Sensors 7

Remote Sensing Symposium (IGARSS rsquo11) pp 1744ndash1747 IEEEJuly 2011

[7] C Yue-huaHU Xiao-guang andZ Chang-li ldquoStudy onwheatpest segmentation algorithm based on machine visionrdquo Journalof Agricultural Engineering vol 12 pp 187ndash191 2007

[8] Q Bai-jing W Tian-bo L Juan-juan et al ldquoImage recognitionand counting method of cucumber aphidsrdquo Journal of Agricul-tural Mechanization vol 08 pp 151ndash155 2010

[9] R Jingxiao Image-based pest automatic counting and recognitionsystem Zhejiang University 2014

[10] M Vincent et al ldquoTowards a Video Camera Network for EarlyPest Detection in Greenhousesrdquo 2008 httpwww-sopinriafrpulsarprojectsbioserrefileendurepdf

[11] P Tirelli N A Borghese F Pedersini G Galassi and ROberti ldquoAutomatic monitoring of pest insects traps by Zigbee-based wireless networking of image sensorsrdquo in Proceedings ofthe 2011 IEEE International Instrumentation and MeasurementTechnology Conference (I2MTC rsquo11) pp 1ndash5 IEEE May 2011

[12] J Wang L Ji A Liang and D Yuan ldquoThe identification of but-terfly families using content-based image retrievalrdquo BiosystemsEngineering vol 111 no 1 pp 24ndash32 2012

[13] H Ran Image Segmentation Algorithm Based on Visual Atten-tionMechanism and Its Application Beijing Jiaotong University2016

[14] D Qin W Yanjie and H Han Guangliang ldquoPerspective cor-rection based on improved Hough transform and perspectivetransformationrdquo Journal of Liquid Crystals and Display vol 04pp 552ndash556 2012

[15] J Faria T Martins M Ferreira and C Santos ldquoA computervision system for color gradingwoodboards using Fuzzy Logicrdquoin Proceedings of the 2008 IEEE International Symposium onIndustrial Electronics (ISIE rsquo08) pp 1082ndash1087 July 2008

[16] Z Jian-wei W Yong-mo and S Zu-ruo ldquoStudy on automaticcounting of aphids in wheat fieldrdquo Chinese Journal of Agricul-tural Engineering vol 09 pp 159ndash162 2006

[17] W Zhi-bin W Kai-yi Z Shui-fa and M Cui-xia ldquoClasscounting algorithm of whitefly based on K-means clusteringand elliptic fitting methodrdquo Journal of Agricultural Engineeringvol 01 pp 105ndash112 2014

[18] B Kui J Chao L Lei and W Cheng ldquoNon-nondestructivemeasurement of wheat morphological characteristics basedon morphological image processingrdquo Journal of AgriculturalEngineering vol 12 pp 212ndash216 2010

[19] N Goncalves V Carvalho M Belsley R M Vasconcelos FO Soares and J Machado ldquoYarn features extraction usingimage processing and computer visionmdasha studywith cotton andpolyester yarnsrdquoMeasurement vol 68 pp 1ndash15 2015

[20] WHuaxu ldquoDevelopment and design of software framework forandroid platform image processing softwarerdquo Software vol 02pp 46-47 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal of

Volume 201

Submit your manuscripts athttpswwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 201

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 4: Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

4 Journal of Sensors

Table 1 Part of the connection domain number pixel values andthe relationship between the lengths of pests

Pest category The pixel value within the contour (contournumber pixel value and aphid lengthmm)

Aphid

(29 41 26) (31 28 22) (32 35 25)(34 21 2) (35 19 19) (36 19 19)(37 20 19) (38 21 19) (39 27 22)(43 32 22) (44 29 22) (45 19 18)(47 20 19) (48 20 19) (49 42 26)(50 18 19) (51 40 26) (53 35 25)(56 25 21) (58 19 18) (60 23 21)(61 48 28) (63 32 24) (64 19 19)

Nonaphids(30 2 02) (41 4 04) (52 6 06)(42 9 09) (54 8 09) (57 10 1)(59 9 09) (65 10 1)

image is marked with white and nonaphid images are notmarked with white consistent with the human eye

252 Aphids Counting Method Using findContours() con-tour extraction method to find all the contours of the imageFirstly the outline which can be detected in the image willbe converted to vector form to iterate and then the aphidssection will be screened out by using ldquofor-cyclerdquo according totheir area features [19]

26 Design and Implementation Based onthe Android Platform

261 SoftwareOverall FlowChart In order tomeet the needsof the public for the convenience of equipment Androidsystem as a mobile platform mainstream system [20] in themobile side of the software development plays a guidingrole based on the Android platform aphid count APP willgreatly facilitate the majority of farmers and agriculturalscience and technology workers The aphid counting soft-ware in this paper uses the Java programming languagein the Android studio platform with OpenCV computervision library development for Android 403 and above Thesoftware implements the counting of aphids the whole isdivided into threemodules image acquisitionmodule imageprocessing module and image counting module as shownin Figure 4 now we design and implement the part of thecontent of the software

(i) ImageAcquisitionModuleThe software obtains the picturein two ways invoking the local camera to shoot in realtime or retrieving the existing photo in the local albumAfter the photo is taken to ensure the quality of the picturethe appropriate image compression can not only reduce thecomputational complexity of the image processing processbut also avoid the overflow caused by the image beingtoo large to cause the program to crash First create anintent object and set the action of the object as the stringof MediaStore ACTION IMAGE CAPTURE Then use thestring of startActivityForResult to start Intent program Aftersetting the length and width the image information will be

Call the local camera

Main interface

Retrieve the local album image

Image compression

Extraction of yellow sticky board

Correction of yellow stickyboard

Aphid extraction

Identification and counting of aphids

Image acquisition module

Image processing module

Image counting module

Figure 4 Software flow chart

loaded into Imageview by using decodeFile method At lastthe image information will return and be displayed on thenext interface

(ii) Image Processing Module In the image processing mod-ule we set ldquoyellow sticky board segmentationrdquo ldquoyellowsticky board correctionrdquo ldquoaphids identificationrdquo to extract theaphids

Using GrabCut algorithm to extract yellow sticky boardfirst create a Rect object to create a rectangular box toselect the possible prospects in the image and use thecanvasdrawRect () method to draw the rectangle and passinto the mask matrix Create a mask object as the displayposition of the segmented yellow sticky board image whichis the image of the CvTypeCV 8UC1 channel that needs tobe of the same size as the original image Black is used as thecolor of scallar which means the background of output imageis black as well Finally the segmentation can be completed bycalling the arguments

Use the perspectiveTransform () method to correct theyellow sticky board Use the ldquofor-cyclerdquo to traverse the fouredge vertexes of the two intersecting lines in the segmentedimage by using GrabCut Then compare the coordinates ofthe four vertexeswith themidpoint of the yellow sticky boardFor example in the coordinates (119909 119910) of the horizontal axisthe value of the vertical axis is less than the correspondingvalue of the midpoint then the point is the top left vertexAccording to the upper left upper right lower left and lowerright of the order of the four vertex coordinates in the variable

Journal of Sensors 5

(a) In greenhouse (b) Orchard

Figure 5 Practical application of aphid counting software

called startM the perspective transformation method can becorrected

Use single image difference method to extract aphidsThrough the Imgproc class cvtColor color image will beconverted to the output image grayMat gray image Setthe parameters of nuclear value Size (119908 ℎ) as Size (51 51)then use the ImgprocGaussianBlur method to completethe process of fuzzy background Use Coreabsdiff() fordifferential operation Use the ImgprocTHRESH OTSU forthreshold operation after difference background image Thedifferential images need to undergomorphological corrosionto remove the effects of the aphids Set the morphologicalaction as MORPH ERODE and set the shape of structureelement kernel1 as MORPH ELLIPSE with a new Size (5 5)by using getStructuringElement() Elimination of adhesionswill be completed

(iii) Image Counting Module The image counting modulefilters the contours based on the total pixel range in eachconnected domain and stores the count on the counter Theoutput value is the number of aphids

The counting process can be seen as a traversal of theldquofunnelrdquo then we should define two containers the first con-tainer is stored in all the contour data whether or notmeetingthe characteristics of the requirements and the second con-tainer is stored after the screening of the contour informationTraverse the contour type to ImgprocRETR CCOMP andoutput it as ImgprocCHAIN APPROX SIMPLE The ldquofor-cyclerdquo is the key of selecting Set 15 px to 18 px as the shape ofaphids image in the connected domain and set scallar (255255 255) to show aphids as white

3 Results and Discussions

Using the aphid counting software to count the images ingreenhouse and the images in orchards Figure 5(a) shows

50 13012011010090807060

50

60

70

80

90

100

110

120

130

140

GreenhouseOrchardLinear fit of greenhouse

Man

ual c

ount

s num

ber

APP counts number

Equation

Manual countsnumber

Manual countsnumber

Intercept

Slope

Value Standard error

104846 002468

183911minus229425

y = a + b lowast x

adj R2 099504

Figure 6 The comparison of accuracy between the manual countand the APP count

the counting results of the aphids in the greenhouse andFigure 5(b) shows the counting results of the aphids in theorchard

Based on the least squares method a linear regressionanalysis has been carried out by taking 10 sets of data fromTable 2 in the greenhouse to get the fitting curve 119909-axis isthe APP counts number and 119910-axis is the manual countsnumber As shown in Figure 6 the relationship of the fittingbetween the mobile APP count and the manual count is119910 = 104846119909 minus 229425 the fit degree 1198772 factor is up to

6 Journal of Sensors

Table 2 Error analysis of manual count and APP count

Image source Image number Number of manual countsmonth APP counts numbermonth Relative error Accuracy

Greenhouse

(1) 52 52 0 100(2) 80 79 125 9875(3) 62 61 161 9838(4) 84 82 238 9761(5) 86 87 116 9883(6) 55 53 37 9622(7) 54 54 0 100(8) 69 67 29 9701(9) 70 70 0 100(10) 121 116 413 9586

Orchard (11) 71 66 704 9295(12) 138 128 724 9275

099504 indicating that the aphid recognition and mobileAPP counting can be used to achieve functions of recognitionand counting Adding two sets of orchard data from Table 2into the coordinate system we can find that the two pointsare in the vicinity of the curve indicating that the method isbasically effective Because the orchard environment is morecomplex the accuracy rate of the method is slightly worsethan the greenhouse as shown in Table 2 the greenhouseaccuracy rate is up to 95 and orchard accuracy rate is upto 92 In general the aphids identification and countingmethod is highly reliable

4 Conclusion

In the past aphid identification focuses on the separation ofa single kind of aphids few on different kinds of pests Thecount number is less and the aphidsrsquo antennae foot andwings need to be extracted precisely because the operationcomplexity is high most of the application software thatimplements the aphid recognition and counting function isconcentrated on the PC side The traditional counting APPcollects the photos through the Internet to transfer data bythe PC processing and then the results return back to themobile App the process Overreliance on the PC side andthe Internet its real time performance is poor Collection ofaphids requires special equipment this professional equip-ment is not convenient and also very expensive The devicethat collects the aphids is not universal

This paper uses yellow sticky board in the naturalenvironment to attracts aphids and some other pests andcollects images in the real growth environment of plantsAphid counting software overcomes the complex naturalenvironment and the impact of light caused by image pro-cessing difficulties it does not rely on the PC side and thenetwork feedback it can quickly identify and count aphidswhich are the representative of the pest group it has verypractical value The accuracy of the aphid counting softwareis compared with the result of manual counting the accuracyrate of the aphid counting software is more than 95 inthe greenhouse environment the accuracy rate of the aphidcounting software is more than 92The operation is smooth

and convenient The method proposed in this paper canextract and correct the image of yellow sticky board eliminateinfluence of illumination on the image and count aphidsaccurately

Due to the limitations of the season and the study site theaphid counting software needs to design a memory storagemodule to achieve the same number of yellow sticky insectboards to make trend prediction function

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the new facilities of agriculturalmachinery research and development (17227206D)

References

[1] X Zhan-li L Xiao-xia Z Qing-wen et al ldquoCharacteristics ofaphid age identification of wheat long piperdquo Acta EntomologicaSinica vol 01 pp 81ndash87 2014

[2] R Cassani T H Falk F J Fraga P A Kanda and R AnghinahldquoTowards automated EEG-Based Alzheimerrsquos disease diagnosisusing relevance vector machinesrdquo in Proceedings of the 5thISSNIP - IEEE Biosignals and Biorobotics Conference (BRC rsquo14)pp 1ndash6 IEEE May 2014

[3] S Chakraborty and A C Newton ldquoClimate change plantdiseases and food security an overviewrdquo Plant Pathology vol60 no 1 pp 2ndash14 2011

[4] M Pal and G M Foody ldquoEvaluation of SVM RVM and SMLRfor accurate image classificationwith limited grounddatardquo IEEEJournal of Selected Topics in Applied Earth Observations andRemote Sensing vol 5 no 5 pp 1344ndash1355 2012

[5] H N Patel R K Jain and M V Joshi ldquoFruit detection usingimproved multiple features based algorithmrdquo InternationalJournal of Computer Applications vol 13 no 2 pp 1ndash5 2011

[6] J Luo D Wang Y Dong W Huang and J Wang ldquoDevelopingan aphid damage hyperspectral index for detecting aphid(Hemiptera Aphididae) damage levels in winter wheatrdquo inProceedings of the 2011 IEEE International Geoscience and

Journal of Sensors 7

Remote Sensing Symposium (IGARSS rsquo11) pp 1744ndash1747 IEEEJuly 2011

[7] C Yue-huaHU Xiao-guang andZ Chang-li ldquoStudy onwheatpest segmentation algorithm based on machine visionrdquo Journalof Agricultural Engineering vol 12 pp 187ndash191 2007

[8] Q Bai-jing W Tian-bo L Juan-juan et al ldquoImage recognitionand counting method of cucumber aphidsrdquo Journal of Agricul-tural Mechanization vol 08 pp 151ndash155 2010

[9] R Jingxiao Image-based pest automatic counting and recognitionsystem Zhejiang University 2014

[10] M Vincent et al ldquoTowards a Video Camera Network for EarlyPest Detection in Greenhousesrdquo 2008 httpwww-sopinriafrpulsarprojectsbioserrefileendurepdf

[11] P Tirelli N A Borghese F Pedersini G Galassi and ROberti ldquoAutomatic monitoring of pest insects traps by Zigbee-based wireless networking of image sensorsrdquo in Proceedings ofthe 2011 IEEE International Instrumentation and MeasurementTechnology Conference (I2MTC rsquo11) pp 1ndash5 IEEE May 2011

[12] J Wang L Ji A Liang and D Yuan ldquoThe identification of but-terfly families using content-based image retrievalrdquo BiosystemsEngineering vol 111 no 1 pp 24ndash32 2012

[13] H Ran Image Segmentation Algorithm Based on Visual Atten-tionMechanism and Its Application Beijing Jiaotong University2016

[14] D Qin W Yanjie and H Han Guangliang ldquoPerspective cor-rection based on improved Hough transform and perspectivetransformationrdquo Journal of Liquid Crystals and Display vol 04pp 552ndash556 2012

[15] J Faria T Martins M Ferreira and C Santos ldquoA computervision system for color gradingwoodboards using Fuzzy Logicrdquoin Proceedings of the 2008 IEEE International Symposium onIndustrial Electronics (ISIE rsquo08) pp 1082ndash1087 July 2008

[16] Z Jian-wei W Yong-mo and S Zu-ruo ldquoStudy on automaticcounting of aphids in wheat fieldrdquo Chinese Journal of Agricul-tural Engineering vol 09 pp 159ndash162 2006

[17] W Zhi-bin W Kai-yi Z Shui-fa and M Cui-xia ldquoClasscounting algorithm of whitefly based on K-means clusteringand elliptic fitting methodrdquo Journal of Agricultural Engineeringvol 01 pp 105ndash112 2014

[18] B Kui J Chao L Lei and W Cheng ldquoNon-nondestructivemeasurement of wheat morphological characteristics basedon morphological image processingrdquo Journal of AgriculturalEngineering vol 12 pp 212ndash216 2010

[19] N Goncalves V Carvalho M Belsley R M Vasconcelos FO Soares and J Machado ldquoYarn features extraction usingimage processing and computer visionmdasha studywith cotton andpolyester yarnsrdquoMeasurement vol 68 pp 1ndash15 2015

[20] WHuaxu ldquoDevelopment and design of software framework forandroid platform image processing softwarerdquo Software vol 02pp 46-47 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal of

Volume 201

Submit your manuscripts athttpswwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 201

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 5: Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

Journal of Sensors 5

(a) In greenhouse (b) Orchard

Figure 5 Practical application of aphid counting software

called startM the perspective transformation method can becorrected

Use single image difference method to extract aphidsThrough the Imgproc class cvtColor color image will beconverted to the output image grayMat gray image Setthe parameters of nuclear value Size (119908 ℎ) as Size (51 51)then use the ImgprocGaussianBlur method to completethe process of fuzzy background Use Coreabsdiff() fordifferential operation Use the ImgprocTHRESH OTSU forthreshold operation after difference background image Thedifferential images need to undergomorphological corrosionto remove the effects of the aphids Set the morphologicalaction as MORPH ERODE and set the shape of structureelement kernel1 as MORPH ELLIPSE with a new Size (5 5)by using getStructuringElement() Elimination of adhesionswill be completed

(iii) Image Counting Module The image counting modulefilters the contours based on the total pixel range in eachconnected domain and stores the count on the counter Theoutput value is the number of aphids

The counting process can be seen as a traversal of theldquofunnelrdquo then we should define two containers the first con-tainer is stored in all the contour data whether or notmeetingthe characteristics of the requirements and the second con-tainer is stored after the screening of the contour informationTraverse the contour type to ImgprocRETR CCOMP andoutput it as ImgprocCHAIN APPROX SIMPLE The ldquofor-cyclerdquo is the key of selecting Set 15 px to 18 px as the shape ofaphids image in the connected domain and set scallar (255255 255) to show aphids as white

3 Results and Discussions

Using the aphid counting software to count the images ingreenhouse and the images in orchards Figure 5(a) shows

50 13012011010090807060

50

60

70

80

90

100

110

120

130

140

GreenhouseOrchardLinear fit of greenhouse

Man

ual c

ount

s num

ber

APP counts number

Equation

Manual countsnumber

Manual countsnumber

Intercept

Slope

Value Standard error

104846 002468

183911minus229425

y = a + b lowast x

adj R2 099504

Figure 6 The comparison of accuracy between the manual countand the APP count

the counting results of the aphids in the greenhouse andFigure 5(b) shows the counting results of the aphids in theorchard

Based on the least squares method a linear regressionanalysis has been carried out by taking 10 sets of data fromTable 2 in the greenhouse to get the fitting curve 119909-axis isthe APP counts number and 119910-axis is the manual countsnumber As shown in Figure 6 the relationship of the fittingbetween the mobile APP count and the manual count is119910 = 104846119909 minus 229425 the fit degree 1198772 factor is up to

6 Journal of Sensors

Table 2 Error analysis of manual count and APP count

Image source Image number Number of manual countsmonth APP counts numbermonth Relative error Accuracy

Greenhouse

(1) 52 52 0 100(2) 80 79 125 9875(3) 62 61 161 9838(4) 84 82 238 9761(5) 86 87 116 9883(6) 55 53 37 9622(7) 54 54 0 100(8) 69 67 29 9701(9) 70 70 0 100(10) 121 116 413 9586

Orchard (11) 71 66 704 9295(12) 138 128 724 9275

099504 indicating that the aphid recognition and mobileAPP counting can be used to achieve functions of recognitionand counting Adding two sets of orchard data from Table 2into the coordinate system we can find that the two pointsare in the vicinity of the curve indicating that the method isbasically effective Because the orchard environment is morecomplex the accuracy rate of the method is slightly worsethan the greenhouse as shown in Table 2 the greenhouseaccuracy rate is up to 95 and orchard accuracy rate is upto 92 In general the aphids identification and countingmethod is highly reliable

4 Conclusion

In the past aphid identification focuses on the separation ofa single kind of aphids few on different kinds of pests Thecount number is less and the aphidsrsquo antennae foot andwings need to be extracted precisely because the operationcomplexity is high most of the application software thatimplements the aphid recognition and counting function isconcentrated on the PC side The traditional counting APPcollects the photos through the Internet to transfer data bythe PC processing and then the results return back to themobile App the process Overreliance on the PC side andthe Internet its real time performance is poor Collection ofaphids requires special equipment this professional equip-ment is not convenient and also very expensive The devicethat collects the aphids is not universal

This paper uses yellow sticky board in the naturalenvironment to attracts aphids and some other pests andcollects images in the real growth environment of plantsAphid counting software overcomes the complex naturalenvironment and the impact of light caused by image pro-cessing difficulties it does not rely on the PC side and thenetwork feedback it can quickly identify and count aphidswhich are the representative of the pest group it has verypractical value The accuracy of the aphid counting softwareis compared with the result of manual counting the accuracyrate of the aphid counting software is more than 95 inthe greenhouse environment the accuracy rate of the aphidcounting software is more than 92The operation is smooth

and convenient The method proposed in this paper canextract and correct the image of yellow sticky board eliminateinfluence of illumination on the image and count aphidsaccurately

Due to the limitations of the season and the study site theaphid counting software needs to design a memory storagemodule to achieve the same number of yellow sticky insectboards to make trend prediction function

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the new facilities of agriculturalmachinery research and development (17227206D)

References

[1] X Zhan-li L Xiao-xia Z Qing-wen et al ldquoCharacteristics ofaphid age identification of wheat long piperdquo Acta EntomologicaSinica vol 01 pp 81ndash87 2014

[2] R Cassani T H Falk F J Fraga P A Kanda and R AnghinahldquoTowards automated EEG-Based Alzheimerrsquos disease diagnosisusing relevance vector machinesrdquo in Proceedings of the 5thISSNIP - IEEE Biosignals and Biorobotics Conference (BRC rsquo14)pp 1ndash6 IEEE May 2014

[3] S Chakraborty and A C Newton ldquoClimate change plantdiseases and food security an overviewrdquo Plant Pathology vol60 no 1 pp 2ndash14 2011

[4] M Pal and G M Foody ldquoEvaluation of SVM RVM and SMLRfor accurate image classificationwith limited grounddatardquo IEEEJournal of Selected Topics in Applied Earth Observations andRemote Sensing vol 5 no 5 pp 1344ndash1355 2012

[5] H N Patel R K Jain and M V Joshi ldquoFruit detection usingimproved multiple features based algorithmrdquo InternationalJournal of Computer Applications vol 13 no 2 pp 1ndash5 2011

[6] J Luo D Wang Y Dong W Huang and J Wang ldquoDevelopingan aphid damage hyperspectral index for detecting aphid(Hemiptera Aphididae) damage levels in winter wheatrdquo inProceedings of the 2011 IEEE International Geoscience and

Journal of Sensors 7

Remote Sensing Symposium (IGARSS rsquo11) pp 1744ndash1747 IEEEJuly 2011

[7] C Yue-huaHU Xiao-guang andZ Chang-li ldquoStudy onwheatpest segmentation algorithm based on machine visionrdquo Journalof Agricultural Engineering vol 12 pp 187ndash191 2007

[8] Q Bai-jing W Tian-bo L Juan-juan et al ldquoImage recognitionand counting method of cucumber aphidsrdquo Journal of Agricul-tural Mechanization vol 08 pp 151ndash155 2010

[9] R Jingxiao Image-based pest automatic counting and recognitionsystem Zhejiang University 2014

[10] M Vincent et al ldquoTowards a Video Camera Network for EarlyPest Detection in Greenhousesrdquo 2008 httpwww-sopinriafrpulsarprojectsbioserrefileendurepdf

[11] P Tirelli N A Borghese F Pedersini G Galassi and ROberti ldquoAutomatic monitoring of pest insects traps by Zigbee-based wireless networking of image sensorsrdquo in Proceedings ofthe 2011 IEEE International Instrumentation and MeasurementTechnology Conference (I2MTC rsquo11) pp 1ndash5 IEEE May 2011

[12] J Wang L Ji A Liang and D Yuan ldquoThe identification of but-terfly families using content-based image retrievalrdquo BiosystemsEngineering vol 111 no 1 pp 24ndash32 2012

[13] H Ran Image Segmentation Algorithm Based on Visual Atten-tionMechanism and Its Application Beijing Jiaotong University2016

[14] D Qin W Yanjie and H Han Guangliang ldquoPerspective cor-rection based on improved Hough transform and perspectivetransformationrdquo Journal of Liquid Crystals and Display vol 04pp 552ndash556 2012

[15] J Faria T Martins M Ferreira and C Santos ldquoA computervision system for color gradingwoodboards using Fuzzy Logicrdquoin Proceedings of the 2008 IEEE International Symposium onIndustrial Electronics (ISIE rsquo08) pp 1082ndash1087 July 2008

[16] Z Jian-wei W Yong-mo and S Zu-ruo ldquoStudy on automaticcounting of aphids in wheat fieldrdquo Chinese Journal of Agricul-tural Engineering vol 09 pp 159ndash162 2006

[17] W Zhi-bin W Kai-yi Z Shui-fa and M Cui-xia ldquoClasscounting algorithm of whitefly based on K-means clusteringand elliptic fitting methodrdquo Journal of Agricultural Engineeringvol 01 pp 105ndash112 2014

[18] B Kui J Chao L Lei and W Cheng ldquoNon-nondestructivemeasurement of wheat morphological characteristics basedon morphological image processingrdquo Journal of AgriculturalEngineering vol 12 pp 212ndash216 2010

[19] N Goncalves V Carvalho M Belsley R M Vasconcelos FO Soares and J Machado ldquoYarn features extraction usingimage processing and computer visionmdasha studywith cotton andpolyester yarnsrdquoMeasurement vol 68 pp 1ndash15 2015

[20] WHuaxu ldquoDevelopment and design of software framework forandroid platform image processing softwarerdquo Software vol 02pp 46-47 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal of

Volume 201

Submit your manuscripts athttpswwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 201

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 6: Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

6 Journal of Sensors

Table 2 Error analysis of manual count and APP count

Image source Image number Number of manual countsmonth APP counts numbermonth Relative error Accuracy

Greenhouse

(1) 52 52 0 100(2) 80 79 125 9875(3) 62 61 161 9838(4) 84 82 238 9761(5) 86 87 116 9883(6) 55 53 37 9622(7) 54 54 0 100(8) 69 67 29 9701(9) 70 70 0 100(10) 121 116 413 9586

Orchard (11) 71 66 704 9295(12) 138 128 724 9275

099504 indicating that the aphid recognition and mobileAPP counting can be used to achieve functions of recognitionand counting Adding two sets of orchard data from Table 2into the coordinate system we can find that the two pointsare in the vicinity of the curve indicating that the method isbasically effective Because the orchard environment is morecomplex the accuracy rate of the method is slightly worsethan the greenhouse as shown in Table 2 the greenhouseaccuracy rate is up to 95 and orchard accuracy rate is upto 92 In general the aphids identification and countingmethod is highly reliable

4 Conclusion

In the past aphid identification focuses on the separation ofa single kind of aphids few on different kinds of pests Thecount number is less and the aphidsrsquo antennae foot andwings need to be extracted precisely because the operationcomplexity is high most of the application software thatimplements the aphid recognition and counting function isconcentrated on the PC side The traditional counting APPcollects the photos through the Internet to transfer data bythe PC processing and then the results return back to themobile App the process Overreliance on the PC side andthe Internet its real time performance is poor Collection ofaphids requires special equipment this professional equip-ment is not convenient and also very expensive The devicethat collects the aphids is not universal

This paper uses yellow sticky board in the naturalenvironment to attracts aphids and some other pests andcollects images in the real growth environment of plantsAphid counting software overcomes the complex naturalenvironment and the impact of light caused by image pro-cessing difficulties it does not rely on the PC side and thenetwork feedback it can quickly identify and count aphidswhich are the representative of the pest group it has verypractical value The accuracy of the aphid counting softwareis compared with the result of manual counting the accuracyrate of the aphid counting software is more than 95 inthe greenhouse environment the accuracy rate of the aphidcounting software is more than 92The operation is smooth

and convenient The method proposed in this paper canextract and correct the image of yellow sticky board eliminateinfluence of illumination on the image and count aphidsaccurately

Due to the limitations of the season and the study site theaphid counting software needs to design a memory storagemodule to achieve the same number of yellow sticky insectboards to make trend prediction function

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work is supported by the new facilities of agriculturalmachinery research and development (17227206D)

References

[1] X Zhan-li L Xiao-xia Z Qing-wen et al ldquoCharacteristics ofaphid age identification of wheat long piperdquo Acta EntomologicaSinica vol 01 pp 81ndash87 2014

[2] R Cassani T H Falk F J Fraga P A Kanda and R AnghinahldquoTowards automated EEG-Based Alzheimerrsquos disease diagnosisusing relevance vector machinesrdquo in Proceedings of the 5thISSNIP - IEEE Biosignals and Biorobotics Conference (BRC rsquo14)pp 1ndash6 IEEE May 2014

[3] S Chakraborty and A C Newton ldquoClimate change plantdiseases and food security an overviewrdquo Plant Pathology vol60 no 1 pp 2ndash14 2011

[4] M Pal and G M Foody ldquoEvaluation of SVM RVM and SMLRfor accurate image classificationwith limited grounddatardquo IEEEJournal of Selected Topics in Applied Earth Observations andRemote Sensing vol 5 no 5 pp 1344ndash1355 2012

[5] H N Patel R K Jain and M V Joshi ldquoFruit detection usingimproved multiple features based algorithmrdquo InternationalJournal of Computer Applications vol 13 no 2 pp 1ndash5 2011

[6] J Luo D Wang Y Dong W Huang and J Wang ldquoDevelopingan aphid damage hyperspectral index for detecting aphid(Hemiptera Aphididae) damage levels in winter wheatrdquo inProceedings of the 2011 IEEE International Geoscience and

Journal of Sensors 7

Remote Sensing Symposium (IGARSS rsquo11) pp 1744ndash1747 IEEEJuly 2011

[7] C Yue-huaHU Xiao-guang andZ Chang-li ldquoStudy onwheatpest segmentation algorithm based on machine visionrdquo Journalof Agricultural Engineering vol 12 pp 187ndash191 2007

[8] Q Bai-jing W Tian-bo L Juan-juan et al ldquoImage recognitionand counting method of cucumber aphidsrdquo Journal of Agricul-tural Mechanization vol 08 pp 151ndash155 2010

[9] R Jingxiao Image-based pest automatic counting and recognitionsystem Zhejiang University 2014

[10] M Vincent et al ldquoTowards a Video Camera Network for EarlyPest Detection in Greenhousesrdquo 2008 httpwww-sopinriafrpulsarprojectsbioserrefileendurepdf

[11] P Tirelli N A Borghese F Pedersini G Galassi and ROberti ldquoAutomatic monitoring of pest insects traps by Zigbee-based wireless networking of image sensorsrdquo in Proceedings ofthe 2011 IEEE International Instrumentation and MeasurementTechnology Conference (I2MTC rsquo11) pp 1ndash5 IEEE May 2011

[12] J Wang L Ji A Liang and D Yuan ldquoThe identification of but-terfly families using content-based image retrievalrdquo BiosystemsEngineering vol 111 no 1 pp 24ndash32 2012

[13] H Ran Image Segmentation Algorithm Based on Visual Atten-tionMechanism and Its Application Beijing Jiaotong University2016

[14] D Qin W Yanjie and H Han Guangliang ldquoPerspective cor-rection based on improved Hough transform and perspectivetransformationrdquo Journal of Liquid Crystals and Display vol 04pp 552ndash556 2012

[15] J Faria T Martins M Ferreira and C Santos ldquoA computervision system for color gradingwoodboards using Fuzzy Logicrdquoin Proceedings of the 2008 IEEE International Symposium onIndustrial Electronics (ISIE rsquo08) pp 1082ndash1087 July 2008

[16] Z Jian-wei W Yong-mo and S Zu-ruo ldquoStudy on automaticcounting of aphids in wheat fieldrdquo Chinese Journal of Agricul-tural Engineering vol 09 pp 159ndash162 2006

[17] W Zhi-bin W Kai-yi Z Shui-fa and M Cui-xia ldquoClasscounting algorithm of whitefly based on K-means clusteringand elliptic fitting methodrdquo Journal of Agricultural Engineeringvol 01 pp 105ndash112 2014

[18] B Kui J Chao L Lei and W Cheng ldquoNon-nondestructivemeasurement of wheat morphological characteristics basedon morphological image processingrdquo Journal of AgriculturalEngineering vol 12 pp 212ndash216 2010

[19] N Goncalves V Carvalho M Belsley R M Vasconcelos FO Soares and J Machado ldquoYarn features extraction usingimage processing and computer visionmdasha studywith cotton andpolyester yarnsrdquoMeasurement vol 68 pp 1ndash15 2015

[20] WHuaxu ldquoDevelopment and design of software framework forandroid platform image processing softwarerdquo Software vol 02pp 46-47 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal of

Volume 201

Submit your manuscripts athttpswwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 201

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 7: Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

Journal of Sensors 7

Remote Sensing Symposium (IGARSS rsquo11) pp 1744ndash1747 IEEEJuly 2011

[7] C Yue-huaHU Xiao-guang andZ Chang-li ldquoStudy onwheatpest segmentation algorithm based on machine visionrdquo Journalof Agricultural Engineering vol 12 pp 187ndash191 2007

[8] Q Bai-jing W Tian-bo L Juan-juan et al ldquoImage recognitionand counting method of cucumber aphidsrdquo Journal of Agricul-tural Mechanization vol 08 pp 151ndash155 2010

[9] R Jingxiao Image-based pest automatic counting and recognitionsystem Zhejiang University 2014

[10] M Vincent et al ldquoTowards a Video Camera Network for EarlyPest Detection in Greenhousesrdquo 2008 httpwww-sopinriafrpulsarprojectsbioserrefileendurepdf

[11] P Tirelli N A Borghese F Pedersini G Galassi and ROberti ldquoAutomatic monitoring of pest insects traps by Zigbee-based wireless networking of image sensorsrdquo in Proceedings ofthe 2011 IEEE International Instrumentation and MeasurementTechnology Conference (I2MTC rsquo11) pp 1ndash5 IEEE May 2011

[12] J Wang L Ji A Liang and D Yuan ldquoThe identification of but-terfly families using content-based image retrievalrdquo BiosystemsEngineering vol 111 no 1 pp 24ndash32 2012

[13] H Ran Image Segmentation Algorithm Based on Visual Atten-tionMechanism and Its Application Beijing Jiaotong University2016

[14] D Qin W Yanjie and H Han Guangliang ldquoPerspective cor-rection based on improved Hough transform and perspectivetransformationrdquo Journal of Liquid Crystals and Display vol 04pp 552ndash556 2012

[15] J Faria T Martins M Ferreira and C Santos ldquoA computervision system for color gradingwoodboards using Fuzzy Logicrdquoin Proceedings of the 2008 IEEE International Symposium onIndustrial Electronics (ISIE rsquo08) pp 1082ndash1087 July 2008

[16] Z Jian-wei W Yong-mo and S Zu-ruo ldquoStudy on automaticcounting of aphids in wheat fieldrdquo Chinese Journal of Agricul-tural Engineering vol 09 pp 159ndash162 2006

[17] W Zhi-bin W Kai-yi Z Shui-fa and M Cui-xia ldquoClasscounting algorithm of whitefly based on K-means clusteringand elliptic fitting methodrdquo Journal of Agricultural Engineeringvol 01 pp 105ndash112 2014

[18] B Kui J Chao L Lei and W Cheng ldquoNon-nondestructivemeasurement of wheat morphological characteristics basedon morphological image processingrdquo Journal of AgriculturalEngineering vol 12 pp 212ndash216 2010

[19] N Goncalves V Carvalho M Belsley R M Vasconcelos FO Soares and J Machado ldquoYarn features extraction usingimage processing and computer visionmdasha studywith cotton andpolyester yarnsrdquoMeasurement vol 68 pp 1ndash15 2015

[20] WHuaxu ldquoDevelopment and design of software framework forandroid platform image processing softwarerdquo Software vol 02pp 46-47 2014

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal of

Volume 201

Submit your manuscripts athttpswwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 201

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of

Page 8: Aphid Identification and Counting Based on Smartphone and …downloads.hindawi.com/journals/js/2017/3964376.pdf · 2019. 7. 30. · ResearchArticle Aphid Identification and Counting

RoboticsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Active and Passive Electronic Components

Control Scienceand Engineering

Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

International Journal of

RotatingMachinery

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporation httpwwwhindawicom

Journal of

Volume 201

Submit your manuscripts athttpswwwhindawicom

VLSI Design

Hindawi Publishing Corporationhttpwwwhindawicom Volume 201

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Shock and Vibration

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Civil EngineeringAdvances in

Acoustics and VibrationAdvances in

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Electrical and Computer Engineering

Journal of

Advances inOptoElectronics

Hindawi Publishing Corporation httpwwwhindawicom

Volume 2014

The Scientific World JournalHindawi Publishing Corporation httpwwwhindawicom Volume 2014

SensorsJournal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Modelling amp Simulation in EngineeringHindawi Publishing Corporation httpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Chemical EngineeringInternational Journal of Antennas and

Propagation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

Navigation and Observation

International Journal of

Hindawi Publishing Corporationhttpwwwhindawicom Volume 2014

DistributedSensor Networks

International Journal of