## 2 Methods
### The Feature Extraction
The pixels that show a value greater that N3 in the edge image are treated as most probable foreground pixels. The set  
Figure 3: The saliency map generation from an input image (**A**), the color map (**B**), intensity map (**C**), and the orientation map (**D**) are combined to obtain the saliency map (**E**). Figure 2: The flow diagram illustrating the background-foreground extraction and feature extraction methods. of pixels that possesses values more than N5 in the edge image are treated as the most probable background pixels. The pixels that have values ranging between N4 to N5 are treated as moderate probable foreground pixels. By trial and error, we fixed the N3, N4 and N5 as 255 \(\times\) 0.8, 255 \(\times\) 0.5 and 255 \(\times\) 0.2 respectively. After completing the foreground estimation of images by applying thresholds in saliency map and edge images, the graph cut algorithm is trained. The images obtained from the saliency map and edge images are used as the training images for the graph cut algorithm for identifying the mosquito region Figure 4.  
Once the mosquito region is extracted from the image using graph cut, the next step in the image segmentation process is decimation of each image to trunk and leg regions. We made an assumption in this work that all the insects of the same species appear similar in size in all the images. The leg-trunk decimation of the mosquito images can be done based on the morphological difference between the legs and the body of the mosquito. The species that belong to the hexapod class typically possess thinner and more elongated limb appendages than the thorax region. Hence, we decided upon the width of mosquito region as the criterion for decimation. Since the mosquito region is complex and irregularly structured, it is difficult to estimate the dimensions. Hence, for the width estimation, we extracted the contours of the mosquito region using geometric methods. Once the contour is defined, we assumed line segments that starts from each and every pixel on the contour and ends on another pixel on the contour by bisecting the mosquito region. Each line segment emanating from a single pixel will have a 45-degree difference in the slope. The lengths of assumed line segments give the thickness of the mosquito region measured along eight directions from all pixels in its contour. The mosquito region that shows a thickness above 40 pixels per unit or above is considered as the trunk region and the remaining portion is considered as the leg region (Figure 5). The final task in the image segmentation process is building smooth and complete leg and trunk regions which helps to extract the length-to-width ratios from the leg and trunk regions. To fill the leg and trunk regions in the contour images, we perform several erosion and dilation processes. To develop a filled and smooth trunk region, a total of six erosions and 10 dilations are done. Similarly, for the leg region, 12 erosions and dilations have been executed. After the process of image segmentation, the ratios of the trunk width to the leg length of segmented regions have to be estimated. For the trunk-width and leg-length estimation, we adopt different methodologies. In the case of the leg-length estimation, we transform the leg region image to a sparse image consisting of end point, branch point and passing point. The shortest distance between the endpoints gives the length of the leg region. We use [PERSON]'s algorithm [PERSON] (1986) to obtain the shortest  
Figure 4: The edge image (**A**); the training image (**B**) (the green region represents the most probable foreground pixels and red region represents the moderate probable foreground region); the training image (**C**) after thresholding the saliency map; and the segmented region (**D**). distance between the end points. For finding out the width of the trunk region, we determine the centroid of the trunk region first.