Quantification of Root-Knot Nematode Infestation in Tomato Using Digital Image Analysis

Tomato is the most popular vegetable globally. However, in certain conditions, the vegetable is susceptible to plant parasites such as the root-knot nematode (RKN; Meloidogyne spp.). A proper detection method is required to identify RKN and eliminate related diseases. The traditional manual quantification of RKN using a microscope is a time-consuming and laborious task. This study aims to develop a semi-automated method to discern and quantify RKN based on size using an image analysis method. The length of RKN was assessed using three novel approaches: contour arc (CA), thin structure (TS), and skeleton graph (SG) methods. These lengths were compared with the manual measurement of RKN length. The study showed that the RKN length obtained by manual measurement was highly correlated to the length based on this method, with R2 of 0.898, 0.875, and 0.898 for the CA, TS, and SG methods, respectively. These approaches were further tested to detect RKN on 517 images. The manual and automated counting comparison revealed a coefficient of determination R2 = 0.857, 0.835 and 0.828 for CA, TS, and SG methods, respectively. The one-way ANOVA test on counting revealed F-statistic = 4.440 and p-value = 0.004. The ratio of length to width was investigated further at different ranges. The optimal result was found to occur at ratio range between 10–35. The CA, TS, and SG methods attained the highest R2 of 0.965, 0.958, and 0.973, respectively. This study found that the SG method is most suitable for detecting and counting RKN. This method can be applied to detect RKN or other nematodes on severely infected crops and root vegetables, including sweet potato and ginger. The study significantly helps in quantifying pests for rapid farm management and thus minimise crop and vegetable losses.


Introduction
The tomato (Lycopersicon esculentum) is one of the most widely cultivated vegetables, commonly used to prepare delicious foods worldwide. Unfortunately, tomato production is affected by the one of the most common plant-parasitic nematodes, called root-knot nematodes (RKN; Meloidogyne spp.) [1]. The damage caused by RKN on crops is estimated to be $80-$110 billion per year [2,3]. RKN is the most common plant-parasitic nematode [4]. RKN cause significant yield and economic losses in tomato production and other agricultural crops and vegetables [5]. RKN causes the formation of galls in the roots (Figure 1a). It is a worm-like micro-fauna (Figure 1b). RKN cause damage to plant roots and obstruct water and nutrient intake from the soil. Hence, RKN infestation can be mistaken for nutrient deficiency based on above-ground symptoms displayed by the plant. RKN damage can be confirmed with the presence of galls in the roots. Thus, ascertaining the quantity of RKN is crucial in the estimation of level of damage and extent of yield losses. The assessment of RKN population can be done on plants and soil whenever diagnosis is deemed important. However, sampling before the harvest period is good practice for the control of future The assessment of RKN population can be done on plants and soil whenever diagnosis is deemed important. However, sampling before the harvest period is good practice for the control of future nematode infestations [1,6]. The assessment of RKN should be chosen at an appropriate time so that control measures can be applied. RKN must be accurately identified so that they can be quantified. However, the identification of nematodes is challenging because they have limited distinct features and require expertise. Traditionally, morphological characteristics were used to identify RKN, but the morphology of the RKN changes in each stage of the life cycle. The life cycle duration of RKN depends on environmental factors such as host plant and temperature [7]. The life cycle starts with an egg which then develops as a one-cell zygote. This zygote develops to first-stage juvenile (J1) [8]. Then, J1 grow into a second-stage juvenile (J2) after their first molt. J2 subsequently hatches from the egg, depending upon the temperature and moisture of the soil [9]. The J2 moves through the soil in search of roots of the host plant [10]. Once it establishes a feeding site in the host plant, J2 grows into third stage juvenile (J3), fourth stage juvenile (J4), and then reproductive adults after three or more molts, under favourable conditions. The J3 and J4 do not feed due to a lack of functional stylet [9]. The J4 matures into an adult male or female after one more molt [11]. Males are vermiform and do not feed, unlike J2 and adult females. Male growth occurs when conditions are unsuitable for female development [9]. Females are less active, and continue feeding and develop into a round pear shape [11]. The J2 can be extracted from infected root or egg masses for morphological identification. J2 have discernible characteristics such as body length, width, stylet length, tail shape, and dorsal gland orifice (DGO) [8]. The length of J2 ranges from 350 to 450 micrometres (μm) and stylet 23 to26 μm [8]. De Man presented morphometric parameters (De Man Formulae) to describe RKN characteristics such as overall body length, the ratio of body length to greater body diameter, percentage of vulva from anterior, and ratio of body length to tail length [12,13]. The length of J2 and ratio of body length to maximum width can be used to discern J2. This study implements RKN detection method based on J2 from roots and measurements of J2.
Computer vision and image analysis techniques are applied in agriculture and the food industry for precision farming, weed detection and control, agricultural pattern analysis [14], and automated inspection of agricultural products [15]. Monitoring of crop health and disease control, automatic crop harvesting, classification, and quality testing of agricultural products, and monitoring of farmland are the major applications of computer vision technology in agricultural automation [16]. Further, computer vision has been used in the detection and quantification of nematodes. Mazurkiewicz [17] proposed RKN must be accurately identified so that they can be quantified. However, the identification of nematodes is challenging because they have limited distinct features and require expertise. Traditionally, morphological characteristics were used to identify RKN, but the morphology of the RKN changes in each stage of the life cycle. The life cycle duration of RKN depends on environmental factors such as host plant and temperature [7]. The life cycle starts with an egg which then develops as a one-cell zygote. This zygote develops to first-stage juvenile (J1) [8]. Then, J1 grow into a second-stage juvenile (J2) after their first molt. J2 subsequently hatches from the egg, depending upon the temperature and moisture of the soil [9]. The J2 moves through the soil in search of roots of the host plant [10]. Once it establishes a feeding site in the host plant, J2 grows into third stage juvenile (J3), fourth stage juvenile (J4), and then reproductive adults after three or more molts, under favourable conditions. The J3 and J4 do not feed due to a lack of functional stylet [9]. The J4 matures into an adult male or female after one more molt [11]. Males are vermiform and do not feed, unlike J2 and adult females. Male growth occurs when conditions are unsuitable for female development [9]. Females are less active, and continue feeding and develop into a round pear shape [11]. The J2 can be extracted from infected root or egg masses for morphological identification. J2 have discernible characteristics such as body length, width, stylet length, tail shape, and dorsal gland orifice (DGO) [8]. The length of J2 ranges from 350 to 450 micrometres (µm) and stylet 23 to 26 µm [8]. De Man presented morphometric parameters (De Man Formulae) to describe RKN characteristics such as overall body length, the ratio of body length to greater body diameter, percentage of vulva from anterior, and ratio of body length to tail length [12,13]. The length of J2 and ratio of body length to maximum width can be used to discern J2. This study implements RKN detection method based on J2 from roots and measurements of J2.
Computer vision and image analysis techniques are applied in agriculture and the food industry for precision farming, weed detection and control, agricultural pattern analysis [14], and automated inspection of agricultural products [15]. Monitoring of crop health and disease control, automatic crop harvesting, classification, and quality testing of agricultural products, and monitoring of farmland are the major applications of computer vision technology in agricultural automation [16]. Further, computer vision has been used in the detection and quantification of nematodes. Mazurkiewicz [17] proposed a semi-automated image analysis method to investigate the biomass of nematodes in marine sediment using Leica M205C and pictures were taken at 10× to 160× magnification. This semi-automated method computes the length, width, and biomass of nematodes. The length and width are estimated in terms of perimeter and area, while biomass is estimated based on the volume of cylinder and volume of rectangular cuboid. This method was found to be time and cost effective compared to the manual method. Moore [18] developed the WormSizer application to compute the shape and size of Caenorhabditis elegans using Zeiss Discovery stereomicroscope with 4x objective lens. WormSizer estimated length, average width, width at the middle, and volume. The application was able to detect size and growth rate differences in terms of morphological phenotypes. Identification of dead and live Heterorhabditis bacteriophora nematodes was explored using computer vision [19]. The authors of [20] presented automated Wormscan to measure the size, mortality, and fecundity rate of C. elegans. This method used a sequence of scanned image differences to detect the movement of C. elegans rather than recognizing objects. Wählby [21] developed WormToolbox on Cell Profiler to measure morphological phenotypes of C. elegans. Brown [22] presented high throughput automated fluorescence-based imaging system to detect and count soybean cyst nematodes (SCN; Heterodera glycines). This technique analyses scanned images of a SCN sample in a petri dish to count eggs. It also counts SCN females on the roots.
Similarly, cereal cyst nematodes (Heterodera avenae) and substrate particles were identified and discriminated against using image analysis [23]. This method used a scanner to acquire nematode images and different morphometric and textual features to characterize and discriminate nematodes and substrate particles. Another image analysis method explored the obstruction on RKN movement due to attached spores of Pasteuria penetrans; however, detection and quantification were not determined [24]. Some of the studies focused on detecting nematodes eggs. The author of [25] investigated photoluminescence technology to identify the nematodes genus and species. They found that species of nematode eggs can be discriminated in terms of emission spectrum. An advanced machine learning model was implemented to discern eggs of SCN [26]. The author in [27] presented a citrus fruits and leaves dataset for detecting disease and classification using a machine learning approach. Machine learning was also used to detect guava plant disease from a DSLR camera sensor [28]. This framework investigated colour histogram (HSV and RGB) and LBP features to enhance the accuracy of detecting guava fruit disease. After extracting the feature, the Delta E algorithm was used to segment the image. There are many image segmentation techniques used to discriminate foreground and background particles in an image [29]. The foreground may contain a region of interest and unnecessary particles in the background. Thresholding segmentation is used to segment image in terms of foreground objects and the background [30]. Netto [31] implemented otsu, ridler, and triangle methods to evaluate the effect of vegetation indices (VI) (ExG, ExGR, and NDI). Hakim [32] used adaptive local thresholding to binarise the image on WorMachine, otsu thresholding [19,21], and auto threshold implemented to detect and count entomopathogenic nematodes [33]. Triangle thresholding algorithms are used to phenotype crop root systems and estimate root length using ImageJ software [34]. Patil & Bodhe [35] measured fungi-caused disease in sugarcane leaf by implementing a triangle threshold and achieved an accuracy of 98.60%. The proposed method also implemented triangular thresholding to binarise images and separate nematodes and dust particles in the background.
Related studies on nematodes with image analysis methods are summarized in Table 1. Most of the studies have been done on C. elegans nematodes; however, the detection and quantification of RKN using the microscopic image analysis approach has not been explored. This study aims to develop a method to detect and count RKN using image analysis techniques to help farmers prototype their biological characteristics for management purposes.
To explore the achievable quality of digital image analysis for the assessment of RKN infestation in tomato, we implemented three novel approaches for automated morphometric measurement, and the optimum range of ratio determined for RKN detection. These methods are based on CA, TS, and SG. We applied these routines to microscope slides with living RKN and to static microscope pictures of RKN. We used three criteria to judge the quality of the routines: misidentifications, correlation with manual counts, and root mean square error in the morphometric results. These three methods assess size of RKN.

Materials and Methods
The detection of RKN started with sample preparation and collection. Then, the samples were processed. The images of the samples were acquired using appropriate settings. Finally, image processing techniques were applied to discern RKN. The detailed procedures are presented in the subsections below.

Soil Sample Preparation and Collection of Roots
Initially, tomato seeds were germinated indoors on a tray containing sand. The soil sample was prepared using a potting mix and sand (ratio of 1:1). The sand was used to avoid ingress of unwanted organisms and to create conditions suitable for sterilization. After four weeks, 70 tomato seedlings were transferred into white 600 mL plastic containers and placed in the greenhouse. The greenhouse was located at 24 • 54 5 S, 152 • 18 45 E (Central Queensland University Science Laboratory, Bundaberg Campus, Queensland, Australia, and the temperature was 14 ± 3 • C with 12 h light/12 h dark. The plants were inoculated with eggs of RKN (Meloidogyne incognita) five weeks after they were transplanted into the plastic containers. A few plant roots were inspected five weeks after the inoculation for the presence of root galls. The plant roots that had developed galls were deemed ready for nematode extraction Extraction of nematodes from roots: After collecting the samples, plant stems were cut off and roots were separated. The roots were washed using tap water to remove sand and soil particles. Later, these roots were cut into smaller pieces (1 cm or less) and put into a 0.5% bleach solution (NaOCL) in a container for 5 min. Then, a modified version of Hussey [36] was used to extract RKN from root pieces. The roots were placed on a 135 µm-aperture sieve and stacked on a 25 µm-aperture sieve. The roots were washed with water and the residue was collected in a 25 µm aperture. The sieve with the residue was placed in water for 24 h. On the next day, the J2 sample in the water was used for image acquisition. The eggs of RKN were collected using 150 µm aperture. The residue was collected in the 25 µm aperture sieve and decanted on another 25 micron mini sieve and placed in a container. The sample floated for 24 h so that RKN could migrate down into the water from the sieve whereas soil particles remained on the sieve [37]. Then, the sample filtered from the mini sieve was used to observe RKN on the next day. This sample was termed as J2 from infected roots (JIR) because some of juveniles were found in the egg collection. Some eggs took a longer time to hatch. Juveniles hatched from eggs were retrieved on daily basis. Juveniles hatched from eggs after the egg collection process were termed as J2 from egg mass (JEM). Two samples were prepared for the size assessment: a sample of fresh JIR and another sample of the fresh JEM.

Image Acquisition
The images of the samples were captured to automate the RKN assessment. Five ml of the sample was placed in a 55 mm diameter petri dish, which was then mounted on the microscope stage. Many automated detection mechanisms have been implemented using a digital camera mounted on a microscope [17,18]. This study employed BX53 microscope with 4× objective lens and mounted digital camera. Images were captured on high contrast, ISO 200 sensitivity settings, with manual focus, and saved at 1600 × 1200 size. The head and tail of RKN were found to be transparent and colourless; hence, an appropriate acquisition setting was required to attain flawless segmentation. This study used a differential interference contrast (DIC) optical illumination technique because high contrast and high spatial resolution can capture the clear edges of RKN [38]. A total of 110 images of JIR and JEM were captured. Further, 570 images of JIR were acquired for investigation.

Image Processing
The images were processed and analysed to detect RKN in the image. First, images were pre-processed to separate noise, and then we applied segmentation. Subsequently, images were purified by removing dust particles before undertaking morphological operation. Ultimately, morphometric measurement of RKN was carried out to calculate size. All these steps were implemented using a new algorithm (Appendix A Table A2).

Image Pre-Processing
This study used python programming language to process captured images. The images were preprocessed using a Gaussian filter to remove noise. A Gaussian filter is a linear filter that passes lower frequencies and removes normal distribution noise [39].
The one-dimensional Gaussian filter can be expressed as [40]: where σ is variance of Gaussian filter.
As the input images were in RGB format (Figure 2a), it was necessary to convert them to gray to reduce colour complexity from three layers to single a layer. This reduced computational burden and avoided irrelevant information [41]. The image segmentation techniques were used to discriminate RKN from background soil particles in the image. Thresholding segmentation separates objects from the background [30]. This study implemented triangular thresholding based on the histogram, computed as the line between histogram peak and extreme point of the histogram. The threshold is the point at the longest distance between histogram and the line [42]. The image of RKN segmented using of triangle thresholding (Figure 2b). The segmentation technique can be defined as shown in Equation (2) [43]. where T is threshold value, (x, y) coordinate point of the threshold value p (x, y) and f (x, y) is the point of gray-level image pixel. The threshold of image g (x, y) can be defined as shown in Equation (3).
histogram peak and extreme point of the histogram. The threshold is the point at the longest distance between histogram and the line [42]. The image of RKN segmented using of triangle thresholding (Figure 2b). The segmentation technique can be defined as shown in Equation (2) [43].
, , , where T is threshold value, (x, y) coordinate point of the threshold value p (x, y) and f (x, y) is the point of gray-level image pixel. The threshold of image g (x, y) can be defined as shown in Equation (3).

Image Purification
After segmentation of the images, the small soil particles were removed based on their size to reduce unnecessary computation. The particles having area less than the RKN minimum area were eliminated (Figure 3a). The morphological closing operation was performed on the image to restore missing edges. This closing operation was based on a morphological non-linear filter [44]. The closing operation smoothed contours of the image and filled in the thin gulf and small holes. It eliminated missing edges and then filled the holes [45] to obtain complete structures (Figure 3b). Subsequently, the contour of each object in the image was determined. The length, width, and the ratio of length to width were calculated as described in Section 2.3.3. The RKN was detected based on the ratio of length to width, and area. Its value range was specified from the automated measurement.
After segmentation of the images, the small soil particles were removed based on their size to reduce unnecessary computation. The particles having area less than the RKN minimum area were eliminated (Figure 3a). The morphological closing operation was performed on the image to restore missing edges. This closing operation was based on a morphological non-linear filter [44]. The closing operation smoothed contours of the image and filled in the thin gulf and small holes. It eliminated missing edges and then filled the holes [45] to obtain complete structures (Figure 3b). Subsequently, the contour of each object in the image was determined. The length, width, and the ratio of length to width were calculated as described in Section 2.3.3. The RKN was detected based on the ratio of length to width, and area. Its value range was specified from the automated measurement.

Morphometric Measurement
The length of RKN in the images was computed using three approaches: CA, TS, and SG. In the first approach, the contour of each RKN was detected (Figure 3a). Then, the perimeters of these contours were divided into two halves to obtain the length of RKN. In

Morphometric Measurement
The length of RKN in the images was computed using three approaches: CA, TS, and SG. In the first approach, the contour of each RKN was detected (Figure 3a). Then, the perimeters of these contours were divided into two halves to obtain the length of RKN. In the second approach, the contour of RKN was converted to a thin structure to remove pixels from the edges until no more pixels could be eliminated without losing structure [46], and half of the thin structure perimeter was computed as length (Figure 3b). In the third method, the RKN in the image was transformed into a skeleton graph using the NetworkX Python package. Skeletons or thin structures are single-pixel representations of the object in the image (Appendix A). The end points of skeleton graphs were detected and the path length of each pair of end points was calculated based on the weight of the graph (Figure 3c). The path with the longest length was used to find the length of RKN. This method excludes unnecessary branches of the skeleton while computing the length of RKN.
The width of RKN was obtained using the medial axis average width. The medial axis of an object is defined as the collection of the point at the centre that has more than one closest point in the boundary or set of centres of the maximum inscribed disk [47]. Medial axis transform is a set of centre and radius pair of disks and is widely used in engineering and computer science. Medial axis transform can be applied to estimate the width of objects since it computes the distance to the boundary from all points of the medial axis. In this study, the width of RKN was estimated using medial axis distance at the middle of the RKN body length. To find the middle point of each RKN body, all the end points of skeleton graphs were detected. Then, the path length of each pair of end points was calculated using NetworkX Python package. Finally, the middle point of the longest path was computed, and the corresponding medial axis distance was used as width at the middle section of the RKN (Figure 4a,b).
of the object in the image (Appendix A). The end points of skeleton graphs were detected and the path length of each pair of end points was calculated based on the weight of the graph (Figure 3c). The path with the longest length was used to find the length of RKN. This method excludes unnecessary branches of the skeleton while computing the length of RKN.
The width of RKN was obtained using the medial axis average width. The medial axis of an object is defined as the collection of the point at the centre that has more than one closest point in the boundary or set of centres of the maximum inscribed disk [47]. Medial axis transform is a set of centre and radius pair of disks and is widely used in engineering and computer science. Medial axis transform can be applied to estimate the width of objects since it computes the distance to the boundary from all points of the medial axis. In this study, the width of RKN was estimated using medial axis distance at the middle of the RKN body length. To find the middle point of each RKN body, all the end points of skeleton graphs were detected. Then, the path length of each pair of end points was calculated using NetworkX Python package. Finally, the middle point of the longest path was computed, and the corresponding medial axis distance was used as width at the middle section of the RKN (Figure 4a,b).

Evaluation Criteria
The proposed method was evaluated using coefficient of determination (R 2 ), root mean square error (RMSE), and analysis of variance (one way-ANOVA). The RMSE was used to measure prediction error between manual and automated measurement and counting. The R 2 was used to estimate how good the automated measurement or counting fitted in the regression model. One way-ANOVA was used to measure the statistical significance of group means.

Measurement Evaluation
The size of RKN was manually measured using Cell Sens software [48]. The length of RKN was measured from the head to tail part (Length (1) in Figure 5). The width of RKN was measured at equal intervals at the middle part of RKN (Length (2), Length (3),

Evaluation Criteria
The proposed method was evaluated using coefficient of determination (R 2 ), root mean square error (RMSE), and analysis of variance (one way-ANOVA). The RMSE was used to measure prediction error between manual and automated measurement and counting. The R 2 was used to estimate how good the automated measurement or counting fitted in the regression model. One way-ANOVA was used to measure the statistical significance of group means.

Measurement Evaluation
The size of RKN was manually measured using Cell Sens software [48]. The length of RKN was measured from the head to tail part (Length (1) in Figure 5). The width of RKN was measured at equal intervals at the middle part of RKN (Length (2), Length (3), Length (4) in Figure 5) because the largest width is found in the middle of the body length ( Figure 5) [17]. The average of these widths was computed as the actual width. The ratio was calculated as Length/Width and area of RKN as taken as Length × Width. These measurements were manually entered into a Microsoft Excel worksheet and saved in the CSV file format. The data of manual measurement included length, width, ratio (length/width), and area (length × width). The distribution of these data from JIR and JEM samples was analysed using density plots to find the minimum and maximum ratio and area (Figures 6 and 7). The range of ratio and area used in the algorithm was fixed slightly larger than the maximum and minimum values of the ratio and area measurement. These parameters were used to find the automated measurement and to compare the results. urements were manually entered into a Microsoft Excel worksheet and saved in the CSV file format. The data of manual measurement included length, width, ratio (length/width), and area (length × width). The distribution of these data from JIR and JEM samples was analysed using density plots to find the minimum and maximum ratio and area ( Figures  6 and 7). The range of ratio and area used in the algorithm was fixed slightly larger than the maximum and minimum values of the ratio and area measurement. These parameters were used to find the automated measurement and to compare the results.  was calculated as Length/Width and area of RKN as taken as Length × Width. These measurements were manually entered into a Microsoft Excel worksheet and saved in the CSV file format. The data of manual measurement included length, width, ratio (length/width), and area (length × width). The distribution of these data from JIR and JEM samples was analysed using density plots to find the minimum and maximum ratio and area ( Figures  6 and 7). The range of ratio and area used in the algorithm was fixed slightly larger than the maximum and minimum values of the ratio and area measurement. These parameters were used to find the automated measurement and to compare the results.   For automated measurement, the routine computed area of contours using OpenCV which is based on the Green Theorem [49]. The ratio was calculated as the body length to middle width. The automated computation of JIR and JEM found that the area value ranged between 3000-7000 pixels and ratio value ranged between 19-30. The minimum For automated measurement, the routine computed area of contours using OpenCV which is based on the Green Theorem [49]. The ratio was calculated as the body length to middle width. The automated computation of JIR and JEM found that the area value ranged between 3000-7000 pixels and ratio value ranged between 19-30. The minimum and maximum area of RKN was set to 3000-7000 pixels. Initially, the minimum and maximum ratio was set to 19-30. The range of ratios was increased to enable further investigation. The algorithm was further tested with a ratio range between 15-35, 12-35, 10-35, 8-35, 6-35, and 4-35.

Coefficient of Determination (R 2 )
The coefficient of determination is a common statistical approach to measure how effectively predicted value captures variability among true values [50]. The coefficient of determination is used to assess the goodness of regression model fit on observed data [51]. R 2 provides more facts compared to other evaluation metrics [52]. R 2 and RMSE are used for evaluating photon counting [53].
where SS Regression the sum of square due to regression that is the sum of square of difference between measurement and prediction. SS total is total sum of square that is the sum of squares of the difference between measurement and their mean.

Root Mean Square Error (RMSE)
RMSE is defined as the squared root of mean square error. It is appropriate for measuring performance when errors are expected to be normally distributed [54]. RMSE measures accuracy by comparing prediction error of the models [55]. RMSE is used for counting crowds. It measures variation of residuals and is easily interpretable as a unit is the same as the dependent variable. RMSE is defined as where N is total number of samples, y i is predicted value, and y i is actual value

One-Way Analysis of Variance (ANOVA)
Analysis of variance is the assessment of means difference between two or more groups for statistical analysis. The null hypothesis states all group means are equal [56]. Rejecting the null hypothesis concludes that all group means are not equal [57]. To test the null hypothesis, we compare p-value with a significance level (α = 0.05); if p-value is less than or equal to the significance level then the difference between means is statistically significance. If the p-value is greater than the significance level, there is no statistical significance among group means. The null hypothesis (H1) and the alternative hypothesis (H2) is defined as follows [56]: Hypothesis 1 (H1). All means are equal, µ1 = µ2 = µ3.

Results
The result of image analysis was evaluated using R 2 , RMSE, and one way-ANOVA. The result was profound in RKN detection in both samples, the manual and automated length compared based on CA, TS, and SG of JIR (Figure 8). The CA and SG method attained the highest R 2 = 0.898 (Table 2), whereas the TS method achieved R 2 = 0.875. Similar results were found from JEM ( Figure 9). The SG-based computation achieved R 2 = 0.924. The CA-based computation attained R 2 = 0.881 while TS-based computation attained R 2 = 0.823. The RMSE of CA, TS, and SG was found to be 13.803, 22.426, and 23.832 in the JEM sample and 14.237, 23.975, and 24.501, respectively, in the JIR sample. The width and ratio calculated by the automated method were found to have an insignificant correlation to the manual width and the ratio of length to width. The ratio from manual and automated measurement was also compared using R 2 and RMSE ( Table 3). The manual width and automated width comparison measurements in both samples were found to be insignificant. The width computation revealed R 2 = 0.09 with RMSE = 1.15 from JIR and R 2 = 0.06 with RMSE = 2.482 JEM.  measurement was also compared using R 2 and RMSE ( Table 3). The manual width and automated width comparison measurements in both samples were found to be insignificant. The width computation revealed R 2 = 0.09 with RMSE = 1.15 from JIR and R 2 = 0.06 with RMSE = 2.482 JEM.  Further, the three methods were used to detect RKN from JEM sample in 517 images consisting of 1953 RKN. The R 2 assessed to compare manual and automated counting of CA, TS, SG methods were 0.857, 0.835, and 0.828, respectively ( Table 4). The RMSE of CA, TS, and SG methods were 0.481, 0.520, and 0.533, respectively. The CA, TS and SG computation methods showed three, two and three misidentifications, respectively. On the other hand, CA method missed 97 RKN. Similarly, TS could not detect 110 RKN, and SG method missed 114 RKN. The one way-ANOVA test performed on count from CA, TS, and SG method found F-statistic = 4.440 and p-value = 0.004. In addition, three methods were investigated with ratio variation from 19-30,15-35, 12-35, 10-35, 8-35, 6-35, and 4-35 (Table 4). The ratio between 10-35 was found to have the lowest number of misidentified and missed RKN. The SG method misidentified seven RKN and ten RKN were not detected, whereas the TS method did not identify sixteen RKN and eight RKN were missed. Similarly, the CA method did not detect eight RKN and misidentified thirteen RKN.  Further, the three methods were used to detect RKN from JEM sample in 517 images consisting of 1953 RKN. The R 2 assessed to compare manual and automated counting of CA, TS, SG methods were 0.857, 0.835, and 0.828, respectively ( Table 4). The RMSE of CA,

Discussion
The manual measurement and counting of nematodes is a common and relatively simple, labour-intensive, and time-consuming process. The manual approach took around 2-3 min to measure the RKN precisely because the head and tail parts of RKN are transparent. On the other hand, the automated method used to count RKN in the images showed the proposed model is a good fit for data with high R 2 . The optimal range of ratio was observed at 10-35 for the detection and counting of RKN. Automated counting and measurement approaches are time-efficient and accurate. This study assessed RKN size of JIR and JEM extracted from tomato plant roots and built a novel algorithm to detect RKN with three distinct approaches to calculate length.
In this study, image analysis techniques were applied to automate the RKN measurement and quantification process. Root-knot nematodes in each image were analysed using computer vision methods. There is no other approach in the literature that has used this method to detect RKN or even other nematodes. The length of RKN is computed as the perimeter of CA, TS, and SG. The SG method was estimated using the NetworkX Python package. The SG method showed the highest correlation in both samples, whereas the TS method achieved the lowest correlation, slightly. The images of JEM had more soil particles than those obtained from JIR because egg collection also includes soil particles. The results observed from JEM also had similar outcomes as JIR. The comparison of RMSE also revealed negligible differences between JIR and JEM. The correlation of skeleton graph-based computation increased to R 2 = 0.924. The CA method correlation was slightly reduced to R 2 = 0.881. Similarly, the TS method decreased to R 2 = 0.823. The decline of correlation in the CA and TS methods is because of the deformation of RKN shape. This shape deformation normally originated from the attachment of small soil particles or microorganisms (fungus) to the RKN body. This changed the original contour, and thus the skeleton structure of the RKN. Hence, inappropriate branches were created in the skeleton structure, which then attached additional endpoints in the graph. The thinning operation reduced the sizes of soil particles and matched RKN size, resulting in a slight reduction in correlation with JEM. The SG method showed the highest correlation in terms of R 2 in both samples. This method is more robust even in dirty images. The method excludes irrelevant branches of the skeleton while computing the length of the skeleton graph. This finding confirmed that the SG method effectively represents the complex structure of the object and preserves the topologic and geometric properties of RKN more accurately [58]. There was a high correlation between the length of RKN measured by the manual method and that obtained using the machine method. The Naïve Bayes classifier and Linear Discriminant Analysis attained 96.1% and 93.5% accuracy, whereas the SG method achieved 97.3% [23]. Similarly, the detection rate was 87% in [19], whereas the proposed method outperformed it. The fluorescence-based imaging system revealed R 2 = 0.95, whereas the proposed CA, TS, and SF methods achieved better results than this method [21]. In addition, around 92% of RKN measurement of satisfied length specification written in the taxonomic literature of root-knot incognita. A similar result was found with automated measurement of root-knot incognita. Few root-knot nematodes have slightly higher length than the specification. This might be influenced by duration of time chosen to extract nematodes and the environment provided by the host plant.
On the other hand, a negligible correlation between the manual and automated measurements in the computation of the width and ratio was noted. The correlation was slightly higher than width because the length is proportional to the ratio. It still had negligible correlation. A similar trivial correlation of the width was observed in the assessment of biomass of nematodes [17]. This situation also occurred while studying the automated method to analyse MRI images [59]. In addition to these, width inconsistency may be because cross-sectional values are more susceptible to errors than longitudinal values.
The algorithm was further tested on 517 images which showed an excellent correlation with manual counting. The CA method had the highest correlation between manual and automated counting with R 2 = 0.857 and RMSE = 0.481; however, three false RKN detected and 97 RKN unrecognized. The TS method discerned two dust particles and 110 RKN missed. Similarly, the SG method missed 114 RKN and three were misidentified. The one-way ANOVA test found F-statistic = 4.440 and p-value = 0.004, which is less than significance level. Thus, the difference between the means of these counting methods is statistically significant. These RKN were disregarded because of self-tangled or overlapped structure due to which length of RKN varies. Thus, the value of the ratio was changed to include these self-tangled RKN.
The algorithm achieved the highest R 2 and a smaller number of false detections and missed RKN with a ratio range between 10 to 35. These results found that the SG method had the highest correlation and lowest prediction errors as compared to other methods. The SG method showed good performance in highly cluttered images. The skeleton algorithm has been extensively used in shape recognition and analysis, path and motion tracking, character recognition, and medical imaging applications such as stenosis detection, tracking and analysis of the anatomic structure, and object morphology characterization [60]. The Skan Python Library builds skeleton-sized or thinned object graphs and provides branch information from skeleton images [61]. The lengths RKN are computed as the largest length in the skeleton graph network. However, this study implemented a skeleton graph structure to measure length. The thin structure of contour is used to convert graph structure to avoid unnecessary branches. This supported the achievement of the accurate length of the skeleton graph structure. The limitation of the proposed study is that it is based on the measurement of RKN size.
Prior measurement of RKN (manual or automated) is necessary to find the value of morphological parameters. The suspension required to keep in the mini sieve for 24 h, to separate RKN and dust particles. Further, the proposed method could not detect multiple overlapped RKN.
This method is particularly based on the study of M. incognita. Other common RKN species found in Queensland, Australia and infesting tomatoes are M. incognita, M. javanica, M. arenaria, and M. hapla [1]. The algorithm developed in this study detects nematodes in terms of length to width ratio. As the J2 length of these common species is almost similar, the algorithm detects these common species with similar length to width ratios. The approach and specifications used in this study are based on the J2 stage of the RKN. This is the most infectious stage of the RKN [62,63].

Conclusions
The proposed method estimates RKN size and enumerates it based on length and width. The length of RKN is computed using three methods. The contour arc (CA), thin structure (TS), and skeleton graph (SG) methods were implemented to automate the measurement of RKN. The skeleton graph structure was the most accurate in detecting RKN. This method can be used for the assessment of the nematode population for rapid management. This study may be used to model and detect the irregular and complex structure of objects. The algorithm can be implemented to count microorganisms with irregular shapes. In addition, the optimal range of ratio was found at 10-35 for detecting RKN in an image. The presented technique can be very useful in discerning and quantifying other nematodes and automating image labeling tasks for machine learning with quality images. Although the method proposed in this study was able to detect and count RKN, it could not detect nematodes attached to large soil particles. Thus, roots must be cleaned properly during sample processing. Future work may investigate effective ways to remove soil particles. Further, different segmentation techniques can be applied to improve object detection.
A perspective study could be on overlapped structure of RKN and use spectral technology to detect RKN and similar microorganisms.

Data Availability Statement:
The data used in this study can be accessible from corresponding author (CA) upon reasonable request. The data are not publicly available due to privacy.

Acknowledgments:
The authors wish to acknowledge the Research Training Programme (RTP) scholarship funded by the Australian government, and the support and resources provided by Central Queensland University, Australia. The authors also wish to thank Kirsty Owen for reviewing an earlier version of this manuscript.

Conflicts of Interest:
The authors declare no conflict of interest.