DEVELOPMENT OF A MACHINE VISION SYSTEM FOR WEED DETECTION DURING BOTH OF OFF-SEASON AND IN-SEASON IN BROADACRE NO-TILLAGE CROPPING LANDS

More than half of the Australian cropping land is no-tillage and weed control within continuous no-tillage agricultural cropping area is becoming more and more difficult. A major problem is that the heavy herbicide usage causes some of more prolific weeds becoming more resistant to the regular herbicides and therefore more powerful and more expensive options are being pursued. To overcome such problems with aiming at the reduction of herbicide usage, this proposed research focuses on developing a machine vision system which can detect and mapping weeds or do spot spray. The weed detection methods described in this study include three aspects which are image acquisition, a new green plant detection algorithm using hybrid spectral indices and a new inter-row weed detection method taking the advantage of the location of the crop rows. The developed method could detect the weeds both during the non-growing summer period and also within the growing season until the canopy of the crop has closed. The design of the methods focuses on overcoming the challenges of the complex no-tillage background, the faster image acquisition speed and quicker processing time for real-time spot spray. The experiment results show that the proposed method are more suitable for the weed detection in the no-tillage background than the existing methods and could be used as a powerful tool for the weed control.


INTRODUCTION
Weeds are among the most significant and costly environmental threats in the agriculture industry worldwide.Weeds compete with crop plants for moisture, nutrients and sunlight and weed can have a detrimental impact on crop yields and quality if uncontrolled (Chris, 2012;Abdulahi et al., 2012;Khan et al., 2007;Wiatrak and Chen, 2011).Because of the heavy dose herbicide usage, a major problem is that some of more prolific weeds are becoming resistant to the regular herbicides that are used therefore more powerful and more expensive application have to be used (GRDC, 2012).Heavy herbicide usage damages the soil, threatens our food safety and also causes negative effects on the farm economy (Sharif and Mollick, 2013).
One of the best solutions for the problem is using Machine Vision System (MVS) to detect weeds and realize Site-Specific Weed Management (SSWM) and selective spray which can reduce the herbicide usage and make the weed control more efficient (Cepl and Kasal, 2010;Gerhards, 2010;Liu et al., 2013;Rew and Cousens, 2001;Maryam and Mina, 2008).Weed detection are very challenging tasks especially in the no-tillage cropping lands where present the nature sunlight and complex background.On the other hand, the speed of the weed detection has to be taken into the consideration to meet the requirements of the weed control in the broadacre cropping lands.From Science Publications AJABS the literature review and experiment results, it is found that the existing weed detection methods have the limitation of working under certain conditions, slower speed, computationally expensive or some of these methods are not suitable for the weed detection in the no-tillage cropping lands.
This study introduces the weed detection methods of the MVS which can detect weeds during both of offseason period and in-season period.Through the experiment and the study of the previous work, it is found that the combination of using the visible image at 400 to 700 nm spectral band and the near infrared images at 750 to1000 nm spectral band can significantly improve the accuracy of the weed detection than just using one type of the images.Based on this fact, the mechanism of the image acquisition and the algorithm are designed.The JAI AD-130 machine vision camera, which can capture both of the visible image and the near infrared image simultaneously, is selected as the weed sensor.Without losing the accuracy, the mechanism of the image acquisition was designed to achieve the speed as fast as possible to meet the requirements of the weed detection in the broadacre cropping lands.To overcome the challenges of the no-tillage farming environment, a new green plant detection algorithm, which is called Hue-NIR-R method in this study, was developed.The Hue-NIR-R method uses the hybrid spectral indices to detect the green plants.The developed method is compared with other three methods which have been used in the previous researches and the result shows that the Hue-NIR-R method is most suitable for no-tillage farm land.Based on the green plant detection algorithm, a new inter-row weed detection algorithm was developed.This algorithm uses the combination of the crop row detection technology and morphological processing method to separate the weed from the crops.This algorithm was tested with the sample images taken in the wheat land at different growing stages and the type error was also estimated.The algorithm shows the faster computation speed than the Hough transformation method.
The remaining part of this study is organized as follows.The following section makes a review of the related technologies for the off-season and in-season weed detection.Section 3 conducts an image analysis to explain why use the hybrid spectral indices to detect the weed.Based on the analysis, the mechanism of the image acquisition is introduced in section 1 and the offseason weed detection method is described and discussed in section 1.As a continuous work, section 6 introduces and evaluates the in-season weed detection method.At last, section 1 makes the conclusion of this study.

LITERATURE REVIEW
There are two type of related image processing technologies are reviewed separately in this section.Section 2.1 reviews the green plant detection technologies and section 2.2 introduces the crop and weed discrimination.

The Green Plant Detection Methods
Image segmentation is the foundation of almost any image processing program.The general image segmentation approach is to find a certain index then convert the grey level image of the index to binary image using a proper threshold (Foong et al., 2013;Hafiz et al., 2011;Mustafa and Zhu, 2013).The colour indices used for green plant detection can be generally classified into three categories.The first category is the colour indices from RGB colour space or its normalized counterpart rgb.The second category is the colour indices from other colour space such as HSI, HSV or Lab.The third category is the indices using both of the visible light and near infrared information.
In RGB colour space, R, G and B represent the colour intensity of red light at 620 to 750 nm, green light at 495 to 570 nm and blue light at 450 to 495 nm spectral bandrespectively.In RGB colour space, colour and lightintensity information are mixed in the same channels therefor it has limitation for image processing.The normalized form rgb can reduce the effect by changes in lighting intensity therefore it is more widely used than RGB for image processing purpose.Many researches have been conducted to segment green plants from background using indices from RGB or rgb.Excess Green Index (EGI = 2g-r-b) was originally developed by Wobbecke et al. (1995) and has been widely cited and used in recent studies (Muangkasem et al., 2010).Normalized Difference Index (NDI = (g-r)/(g+r)) or called pseudo Normalized Difference Vegetation Index (pseudo NDVI) was firstly proposed by Woebbecke et al. (1992).This index was used by Perez et al. (2000) to separate plantsfrom soil and residue background and it showed an good result.In the recent study of Wiles (2011), the pseudo NDVI was used to develop a software for the fallow weed mapping and it achieved a successful accuracy of 64 to 100% with different sunlight and background conditions.
The second category of the colour indices for green plant detection is from other colour space such as HSI, HSV or Lab (Golzarian et al., 2012;Li et al., 2009).In which, H for hue, S for saturation, I for intensity, V for AJABS value, L for illumination, a for values from red to green and b for values from blue to yellow.Hue, saturation and intensity are general characteristics used to distinguish one colour from another and are related to the way in which human beings perceive colour (Gonzalez and Wood, 1992).Hue is one of the most commonly used indices for green plant image segmentation.One of the successful MVS using HIS colour space for green plant detection was developed by Tang (2002).He used genetic algorithm which are a parallel and global optimization method to search the values belong to green plants in hue, saturation and intensity of HSI colour space.Golzarian (2009) studied the features of different colour indices in notillage background and further improved the green plant image segmentation method in HSI colour space.The image segmentation result can be improved by removing the pixels with certain values of saturation.Golzarian et al. (2012) used geometric approach to evaluate all existing indices from RGB colour space and other colour space for segmentation of green plants in digital images.The result shows that the hue is the most effective colour index across the range of lighting and background conditions for separating plants and non-plants regions.
Intact green plants transform the incoming light by their chlorophyll pigments, which absorb most of the red as well as violet and blue light.Only a fraction of the greenand most of the near infrared light is reflected.The spectral reflectance of plants has a minimum in the visible wavelengths of about 650 nm and increases towards the invisible near infrared above 700 nm.The steep part of the curve is called the 'red edge' (Guyot et al., 1992).Plant characteristics such as chlorophyll content, water status, age and plant health levels can be derived from the position of the red edge (Shafri et al., 2006).Based on the red edge theory, some of the indices are developed to detect the green plants vitality or health conditions.One important index is the normalised difference vegetation index NDVI which is (IR-R)/(IR+R).Where IR represents infrared index and R represents red index.The values are normalised to [-1, 1], with values near one meaning a high amount of chlorophyll (Weis and Sokefeld, 2010).Another index IR-R, which is red grey level subtracte from the near infrared grey level, was used to successfully detect and map weeds using machine vision system (Gerhards and Christensen, 2003;Kodagoda and Zhang, 2010).
From the review it is found that the existing green plant detection methods have the limitation of working under certain conditions, slower speed, computationally expensive.Few of the studies are conducted to detect the weed in no-tillage environment and this is challenging issue for the application of MVS.The review also shows that the near infrared is very useful for the detection of green plants.

The Crop and Weed Discrimination Methods
The crop and weed discrimination and the weed classification are same questions in some research.The crop and weed discrimination methods can be classified into four main categories which are spectrum analysis (Mao et al., 2008;Tyystjarvi et al., 2011), morphological comparison (Perez et al., 2000;Rumpf et al., 2012;Tang 2002), texture and frequency analysis (Bossu et al., 2009;Sabeeniana and Palanisamyb, 2009;Tang, 2002) and the spacial location distinguishing (Jones et al., 2009).The first three methods are not only for crops and weeds discrimination, but also widely studied for weed classification.The last method takes the advantage of the spacial location of the crop rows to separate the crops from the weed.
However using the spectral, shape or texture features to distinguish the plant species has many limitations.Man plants present the similarity of these features, on the other hand, in the natural farming environment the sun light, wind and the insect bite could change these features.These methods have the limitations of identifying certain species which have clear differences in these features or detecting weeds in the image which has one dominant weed species (Golzarian, 2009;Golzarian and Frick, 2011).
The crops are usually planted along the rows which have constant distance between the rows and the seeding of the weeds usually appear between the crop rows.If the spatial location of the crop rows could be found, the crops and the weeds can be separated.This type of methods need to detect the crop row first then separate the crop from the weed.The crop row detection methods are widely used for autonomous farming machines.The centre line of the crop rows can be used as guidance for autonomous farming machineries.Hough Transform (HT) is a famous feature detection algorithm and was firstly proposed by Marchant (1995) to detect the crop centre lines.The experimental results showed the crop centre line could be detected effectively by the HT.However as indicated by Ji and Qi (2011), the HT algorithm operation was slower for the huge computation and it has seldom been applied in a real-time system.In order to improve the speed and effectively of HT, the algorithm with gradient-based Random Hough Transform (RHT) (Xu and Oja, 1993) was applied by Ji and Qi (2011) to detect the centre lines of crop rows.THor methods based on TH were widely used in the crop Science Publications AJABS row detection, meanwhile, many others methods were developed and each of them has the advantages and deficiencies (Guerrero et al., 2013;Jiang et al., 2010;Montalvo et al., 2012;Romeo et al., 2012).
In summary the review of the crop and weed discrimination technologies, compared with the methods of using the spectrum, shape or texture features of the plant, taking the advantage of the position feature to distinguish the crops and weeds is more feasible and not limited by certain species.Furthermore, the algorithm of locating the crops and weeds shows computation efficiency than the other methods.

IMAGE ANALYSIS
As a starting point of this research, some initial tests to detect the green plants were conducted.A bi-camera cold mirror image acquisition system was used as the weed detection sensor.The cold mirror system has been developed in the recent research by Li et al. (2011) to detect citrus fruit.The cold mirror system can capture visible light at 390 to 750 nm band and near infrared at 750 to 960 nm band simultaneously.Calibration of the cold mirror system has been done in the previous research project (Li et al., 2011).About 200 images were randomly selected from the data collected from 13 Feb 2013 to 01 Aug 2013 in different fields in South Australia.These images can present the different background and sunlight conditions and Fig. 1a shows one of the images.The foreground of the image is a green leaf and the background includes soil in brown colour, dry wheat residues in yellow colour and some other dry plants and leaves which are close to brown or yellow as shown in Fig. 1.
The sample image was manually processed by Photoshop 6.0 painting software to separate the green leaf, soil and dry crop residues into three different images as shown in Figure 1b-d.The background of the images was set to black which made the background values to zero in HSI colour space.The values of the hue, saturation and intensity of these three images can be plot into a 3D coordinate where the values of the green leaf, soil and dry crops residues are represented by green dots, blue dots and yellow dots respectively.Figure 2a shows the hue and intensity and (b) shows the hue and saturation.
These two Fig. 2a and b show that the values of hue of the green leaf is between 0.15 to 0.25 approximately and the value of hue of the soil is between 0.04 to 0.15 approximately therefore 0.15 is the threshold to separate soil from green plants.The values of hue of the dry crop residues cover the range from 0.05 to 0.25 which include the whole range of the values of hue of the green leaf therefore it is impossible to separate green leaf from dry crop residues.Through the testing of the 200 sample images, the value of hue of the green plant is between 0.1389 and 0.4444, while for most of the dry plant residues, the value of hue also appears in this range.In summary of the above analysis, the hue is a good index for separating green plant from soil while it is not robust for separating green plant from dry plants residues.
The CCD sensor's response to red and near infrared light can be observed in the grey level images of red and near infrared as shown in Fig. 3. Due to the 'red edge', the green plants reflect most of the near infrared and absorb most of the red there for the green plants have the higher grey level in near infrared images and have the lower grey level in the red images.The grey level of soil is slightly different in the red and near infrared images and in both of two images the grey level is lower.The dry plants residues have higher grey level in both of the red and near infrared images and their grey levels are very close.The features of grey level images of green plants, soil and dry plant residues are summarized as Table 1 Grey level features of near infrared and red images.
This table shows that the red grey level is subtracted from the near infrared grey level, which is index NIR-R, can highlight green plants while depress soil and dry plants.NIR-R is a good index for green plant segmentation especially for removing the dry pl nts residues.
Using the same method described as above, the histogram of the grey level of the index NIR-R for the green leave, dry plant residues and the soil can be plotted by different colour as shown in Fig. 4.This figure clearly shows that most the pixels of the dry plants have lower grey level between 0 to 50 while the pixels of the green plant has higher grey level between 150 to 250.There is a clear threshold between the grey level of the dry plants and the green leave therefore these two types of materials can be separated.For the pixels of the soil and the green plant, a threshold could be found in the index of NIR-R to separate the main parts of them.However, even the optimal threshold is found, there are always some pixels of the soil have the same values as the pixels of the green plants.These pixels of the soil became the noise on the background after image segmentation.Through the experiments with different background and lighting conditions, it is found that theresults are correspondence to the above analysis.In the segmented images, most of the noise is come from the pixels of the soils and if the size of the noise is bigger than certain value then it is hard to be removed by normal noise processing methods.

AJABS
In summary of the analysis, NIR-R index is robust for removing background of dry plants residues and NIR-R index is more suitable than hue for no-tillage cropping land, while NIR-R has limitation to remove background of soil.

THE MECHANISM OF THE IMAGE ACQUISITION
The JAI AD-130 machine vision camera was selected as the weed sensor.Compared with the cold mirror system, AD-130 by pass the complex system calibration and it is more accurate and robust for the in-field application.AD-130GE is a prism-based 2-CCD progressive area scan camera capable of simultaneously capturing visible and near-infrared light spectrums through the same optical path using two individual channels (Fig. 5).The first channel has a Bayer mosaic colour imager that captures visible light at 400 to 700 nm, while the second channel has a monochrome sensor for capturing near infrared light at 750 to 1000 nm.The images from the two channels are pairwise registered.The camera can capture images at the rate of 31 frames per second with the full resolution of 1296 (h)×966 (v).To cover the larger field of view, the wide angle lens LM4NC3, with the angle of view 64.5×49.2degree, was selected.The focal length is 4 mm and the iris range is 1.8 to 16.In natural outdoor lighting conditions, direct sunlight could cause plant leaves with glaring surfaces thus causing saturated pixels (Tang, 2002).A polarizing filter was used to reduce part of the glare.The AD-130GE camera and a notebook were connected to a Gigbit switch through the Ethernet cables.JAI SDK software combined with Matlab 2012b image acquisition tool box were used for dada collection (Fig. 6).
The camera was mounted on a frame which was fixed on a vehicle as shown in Fig. 6.
The height of the camera was place at 2.35m and lens was orthotropic to the ground.The field of field of view was 2965×2151 mm and the pixel resolution was 2.29×2.23 mm.The iris was adjusted manually and the exposure time was set to 2000 to 3000 us.The image acquisition speed was set to 5 and 10 frames/sec at different tests.The vehicle was driven at the speed of 5, 10 and 30 km h −1 to test the image quality.At 30 km h −1 the image quality decreases slightly with blur.The captured visible videos and near infrared videos were saved on hard disk in uncompressed AVI format for further processing.

Algorithm Design
Based on the literature review and analysis, this research developed a new method which is called Hue-NIR-Rmethod in this study.Hue-NIR-R method use the index hue to remove the background of soil and use index NIRR to remove the background of dry plants residues therefore this method is more suitable for notillage environment.The flow chart of the algorithm is shown in Fig. 7 and the five steps are explained below.
Step1: Acquire the original image in the RGB colour space and near infrared grey level image.
The original colour images captured by colour CCD cameras are in RGB colour space.The images are matrix with three layers in uint8 format.The first layer is R which is red grey level image, the second layer is G which is green grey level image and the third layer is B which is blue grey level image.In the no-tillage cropping land, the main components includes green plants, soil and other dry crop residues, the R and NIR can be presented as Equation (1 and 2): (2) where, the subscript 'green' represents the pixels of green plant or pixels with colours close to green plants, 'soil' represents the pixels of soil or pixels with colours close to soil and 'dry' represent the pixels of dry plant or pixels with colours close to dry plants.
Step2: The contrast adjustment of the red and near infrared grey level images.
In Matlab, the uint8 format images use 0 to 255 topresent 256 grey levels.The original grey level images may not use the full range of the grey levels therefore the images may not have the best contrast.Adjustment of the grey level to the range of 0 to 255 to increase the contrast makes the green plant darker in red grey level image and brighter in near infrared grey level image.This step is forthe preparation of the index NIR-R in step 5.
Step 3: Convert the image from RGB colour space to HSI space and use the index of hue to segment the soil from green plants and dry plant residues Hue, saturation and intensity in HSI colour space are converted from RGB colour space using the formula below (Zhang et al., 2012) Equation (3 to 6): According to the experiment of section 3, the value of hue of the green plant is between 0.1389 to 0.4444, if T 1 = 0.1389 and T 2 = 0.4444, then the grey level image of hue can be converted to the binary image according the Equation ( 7): Step4: Remove the pixels of soil in red and near infrared image.
Using the binary image generated in step 3 can remove the pixels of soil in red and near infrared grey level image.In red and near infrared grey level image, set the grey value of the pixels of soil to 0 according to the value of H, which is Equation ( 8 Step5: Use the index NIR-R to remove the pixels of dry plant residues Then the grey level of red R is subtracted from the grey level of near infrared NIR.This is grey level of index NIR-R Equation ( 12 In the image of NIR-R, the pixels of green leaf have higher grey levels while the background has lower grey levels.Otsu's method (Otsu, 1979) is applied again to automatically find the threshold and make the binary image of NIR-R Equation ( 13):

AJABS
After this step the foreground is green plant and all the other materials in the background are removed except some noise on the background.The noise can be easily removed by general image processing approaches and is not discussed in this study.

Experiment Result
The developed new algorithm for green plant detection is compared with other three methods which have been widely used in the existing researches, they are: (1) NDVI method using NDVI index.This method has been widely used for remote green plant sensing (Gonzoearth, 2011); (2) NIR-R method using the index NIR-R which is the intensity of red subtracted from the intensity of near infrared.This method was used by Gerhards and Christensen (2003) to successfully map the weeds; (3) Hue method using the index of Hue, which was used by Golzarian (2009) for no-tillage wheat crop monitoring.
Firstly, the algorithm is evaluated by the human's visual perception.The sample videos were taken using the cold mirror system in the test fields of South Australia between Oct 2012 to Feb 2013.200 frames were randomly chosen as sample images from the videos to presents different weeds, backgrounds and weather conditions.The images were processed by the four methods and one of the images and the processed result are shown as an example in Table 2.
In order to compare which method is more robust to remove the no-tillage background and keep useful information on the foreground, the noise is not processed in the binary images.The binary images are compared with the original images visually.In the binary images, the best results should keep the information of the weed and leave less noise to the foreground and background.
From the visual perception, it shows that in the binary images, the quality of the foreground is very close for the four types of methods, while the Hue-NIR-R method is outstanding with the quality of background compared with other three methods.The result shows that this method is less affected by sunny or cloudy weather and there are less noise on the background.
The new algorithm is also evaluated using the type error estimation.The error types used are defined as Type I error and Type II error and this error evaluation method has been used for citrus and crop detection (Golzarian, 2009;Li et al., 2012).Type I error is defined as the probability of the background pixels being classified as the weeds.Type II error is defined as the probability of the weeds being excluded as thebackground pixels.The total error is the weight sum bythe foreground and background respectively.Figure 8 shows an example image with Type I and Type II errors.If the pixels of the image is I, background is B, foreground (weeds) is F, the pixels of background being miss classified as weeds is BF and the pixels of weed being miss classified as background is FB, the type error can be express as Equation (14 to 16): The sample images were collected by AD-130 camera on 20 May, 2013 in Mallala and 01 Aug, 2013 in Roseworthy test field in South Australia and both of the days were sunny.Six sample images shown in Table 3 were randomly chosen from six videos which were taken under different sunlight and background conditions.The automatic segmented images are compared with the manually processed images template and the result is show in Fig. 9-11.The manually processed template is a weak tool for the evaluation of the error, however the primary error can still be quantified in the dominant type error.

AJABS
The Type I error of Hue-NIR-R method is less than 5% which outperforms the other methods.The Type II error of the Hue-NIR-R method is less or equals the other three methods.In the images with the uniform sunlight condition (image 1 to image 5), the total error of the Hue-NIR-R method is less than 10% which outperforms the other methods.For the image 6, all the methods have higher total error because part of the image has shadow.The partial shadow significantly decreases the image quality due to that the shadow area in the image lacks of proper exposure.Some specific algorithm could resolve the problem of the partial shadow (Golchin et al., 2013), however with the consideration of the computation time, using artificial illumination which can provide uniform light density in the field of view of the camera is more feasible.

AJABS
edge is left side edge and if the Q' (n)<0, the edge is right side edge.In order to find the location of each edge, theprocedure is separated into two steps.First step is to check if there are crop rows on the left side and right side of the image.On the left side, if the fist edge is right side edge (Q' (n)<0), there are crop row on the left side, the location of the crop is the first column to n, otherwise no crop row on the left side.On the right side, if the last edge is left side edge (Q' (n)>0), there are crop row on the right side, the location of the crop row is n to the last column of the image, otherwise there are no crop row on the right side.The second step is to find the location of the crop rows in the middle of the image.Each pair of the left edge and the right edge marks the location of the crop rows and the distance between the left and right edge is D. It may have some false edges exist due to the histogram of S is not smooth.The D between the false edges is much smaller than the true edges therefore they can be easily removed by applying a threshold T 2 .If D>T 2 , the edge is the true edge, otherwise the edge is false and they are removed.After this step, the false edges are removed as shown in Fig. 14d and the centre part of the crop rows are detected as show in Fig. 13c.Step 2: Connect each of the crop rows as one region.
This algorithm has an assumption that the weed inside the crops rows, weed leaves overlapped with the crops or very close to the crops are very few and can be ignored.Practically, through the observation in the natural farming fields, this assumption is valid.With this assumption, the purpose of this step is to connect each of the crops rows as one region and the morphological processing can be used in the further processing to separate the crop from the weeds.
In the binary image, one crop row could be composed of many isolated regions.By setting the value of the pixels of the central part of the crop rows to foregroud, these separate regions can be connected into one region.While in the natural no-tillage farming environment, some unexpected factors, such as strong sun light, insects or dry plants on the leaves, could case errors of the image segmentation.The errors could cause the intact leaves as shown in Fig. 15a present as 'broken leaves' as shown in Fig. 15b in the binary images.If the broken leaves of the crops are not connected to the centre part of the crop row, they will be classified as the weeds in the next step.In order to minimize these errors, image dilation is applied.Image dilation can expand the regions in certain direction and the gaps between the regions can be filled.
Step 3: Detect the weeds In the dilated images, each crop row is one region and the area of the region of the crop rows is much bigger than that of the weeds therefore the crops and weeds can be separated by their area.Use image labelling to label each region in the dilated binary image and the area of each region is calculated.If A represent the area of the regions and T 3 is the threshold to separate the weeds from others, the weed can be easily detected by the formula T 3 ≤A.During the image dilation, the regions are expanded therefore the size of the weeds in the dilated image is bigger than the original images.Image erosion is applied to shrink the dilated regions and the size of the weeds is recovered to the original image as close as possible.
Figure 16 shows the detected weeds.

Experiment Result
To evaluation of the algorithm of the inter-row weed detection, seven sample images were randomly chosen from the data collected in 01 Aug, 2013 in Roseworthy wheat test filed and the weather was sunny.The distance between the crop rows were approximate 30 cm and each image can cover nine crop rows.The sample images were chosen to represent two different wheat growing stages.The height of the wheats in the first three images was 8 to 10 cm and in other four images was10 to.The seeding of the weeds was sparse and the weeds were growing at their young stage with the size of 2 to 10 cm.The error should be evaluated using the same method described above.While due to the difficulty of making a standard template for checking the type error, the type error is redefined by the number of the automatically detected and manually counted weeds.
As shown in Fig. 17, if in a sample image: • M is the number of the manually counted weed, which can be considered as the true number of weeds in the image  4, the type error of inter-row weed detection is 0% to 29%.
Focus on the real-time spot spray in the future works, the processing time of the algorithm is one of the most important factors have to be considered.The processing time was tested by a laptop with 2.6 GHz CPU and 8 GB RAM under Matlab 2012a Table 5 Processing time of the algorithms (seconds) As shown in environment.The original images with the resolution of 966×1296 and the down-sampled images with the resolution of 483×648 were used to test the processing speed.The computation time of the green plant detection algorithm and the inter-row weed detection algorithm were recorded separately.Hough transform is a general approach of the crop row detection and computation time and accuracy of HT was compared with the proposed method.The proposed method is called inter-row weed detection (CS) in the first step of the proposed method is replaced by the HT algorithm to make a counterpart method Table 5 processing time of the algorithms (seconds).The new method and the counterpart method have the similar performance regarding the accuracy of the weed named as inter-row weed detection (HT) in detection, while the proposed method has quicker computation speed.

CONCLUSION
Focus on reducing the herbicide usage and improving the weed control efficiency in the broadacre no-tillage farming environment, this research developed a machine vision system which can detect the weeds both in the fallows during the off-season period and the in the interrow of the crops during the in-season period.The developed methods include three parts which are image acquisition, green plant detection and the inter-row weed detection.The mechanism of the image acquisition was designed to achieve higher speed to meet the requirements of the weed detection in the broadacre cropping lands.The field of view of the camera was set up as big as possible to cover bigger area in the fields.To overcome the complexity of the no-tillage background, a new green plant detection algorithm using hybrid spectral indices was designed.The experiment showed that this algorithm outperforms the existing methods in the no-tillage environments.Based on the green plant detection algorithm, an inter-row weed detection algorithm was developed.This algorithm was tested with the sample images of wheat at different growing stages and the type error was estimated.While this algorithm has the limitation to detect the weeds Science Publications AJABS growing inside the crop rows and this issue will be studied further.In the future work, more experiments need to be done to test and improve the accuracy of the developed methods.On the other hand, the processing speed has to be further improved to meet the requirements of the real-time spot spray.

Fig. 7 .
Fig. 7. Flow chart of the Hue-NIR-R method for green plant detection where, H, S and I are hue, saturation and intensity in HIS colour space.According to the experiment of section 3, the value of hue of the green plant is between 0.1389 to 0.4444, if T 1 = 0.1389 and T 2 = 0.4444, then the grey level image of hue can be converted to the binary image according the Equation (7): , the pixels of soil in the near infrared grey level image NIR and red grey level image R are set to 0 and the NIR and R is Equation (10 and 11):

Table 2 .
Comparison of the new method of Hue-NIR-weather, background including soil and dry wheat residues Table 3. Sample images for the evaluation of the image segmentation methods Image 1: Weather: Sunny Image 2: Weather: Sunny Image 3: Weather: Sunny background: Soil in brown, Background: Soil in brown and Background: Soil and gravels few dry weeds dark, few dry weeds Image 4: Weather: Sunny Image 5: Weather: Sunny Image 6: Weather: Sunny Background: Soil and dry straws Background: Soil in brawn and Background: Soil in brawn dark colour colour, part of the image have shadow

Fig. 15 .Fig. 16 .
Fig. 15.The 'broken leaves' in the binary image (a) In the colour image, the leaves is intact (b) The leaves is 'broken' in binary image • A is the automatically detected weeds and A include the correctly detected weeds C and the false weeds A-C.The false weeds A-C is the number of the nonweed materials being classified as the weeds • The missing weeds M-C is the number of weeds being excluded as other materials Then Equation (19 and 20):

Table 1 .
Grey level features of near infrared and red images T >NIR-R ≈ dry plants background is removed Science Publications

Table 5 .
Processing time of the algorithms (seconds)