Translator Disclaimer
1 May 2004 DrawWing, a program for numerical description of insect wings
Author Affiliations +

There is usually a pattern of veins on an insect wing. This pattern is species-specific and is used taxonomically. For example, the coordinates of some characteristic points on the wing are used to compare vein patterns. The characteristic points are often vein junctions or vein ends. A tool is presented that enables automatic identification of vein junctions. An image of an insect wing is used to determine the wing outline and veins. The vein skeleton is obtained using a thinning algorithm. Bezier splines are fitted to both the wing outline and the vein skeleton. The splines are saved in an encapsulated postscript file. Another output file in text format contains the coordinates of vein junctions. Both the program and its source code are available under GNU General Public License at []. The program presented in this paper automatically provides a numerical description of an insect wing. It converts an image of an insect wing to a list of coordinates of vein junctions, and a wing diagram that can be used as an illustration. Coordinates of the vein junctions extracted by the program from wing images were used successfully to discriminate between males of Dolichovespula sylvestris and Dolichovespula saxonica.


The wings of different species of insects vary in form; often they are membranous, with clearly visible pattern of veins on them. The wing shape and vein pattern is species-specific and is used taxonomically (Comstock, 1940) and also in studies of fluctuating asymmetry (Klingenberg et al., 2001). Before the shape of a wing can be analysed it should be quantified. This often involves choosing landmarks – vein junctions or vein ends. Usually a computer mouse is used to point the landmarks on a computer screen and a program provides the coordinates. Some programs, for example tpsDig [], can be used to obtain any type of landmark. Other programs are designed for particular species; for example, Beemorph [] can be used to obtain vein junctions from a honeybee wing. Pointing the landmarks is time-consuming and often associated with errors (Dedej and Nazzi, 1994) because the exact position of a landmark is ambiguous, particularly when veins are wide. Measurements of wing length and width have proved to be even less repeatable (Dedej and Nazzi, 1994). The problem of repeatability of measurements can be solved by automatic determination of landmarks.

Even if the shape of a wing is not quantified it is often desirable to present it in a drawing. Such drawings are used mainly to illustrate descriptions of species or scientific keys, but also can be found in other scientific papers and in textbooks. Those drawings are usually created using a camera lucida – a drawing attachment for a microscope allowing the object to be observed and pencil-drawn. The preparation of an illustration can be a prolonged process. Generation of drawings from a wing image could save time and in some cases improve the quality of the illustration. The aim of this paper is to present a computer program that automatically provides a numerical description of an insect wing. The description is not only a list of vein junction coordinates but also a wing diagram.

Materials and methods

Obtaining wing images

One male dragonfly (Aeshna juncea), 11 male tree wasps (Dolichovespula sylvestris) and 11 male of Saxon wasps (Dolichovespula saxonica) were used to test the program. The left forewing of each insect was dissected and wasp forewings, which are normally folded, were spread. The wings were placed on the glass of flatbed scanner (HP 7400c) under a microscope slide and illuminated using a photographic slide adaptor. They were scanned with resolution of 2400 dpi and saved in greyscale 8 bit per pixel BMP (Windows bitmap) format (Fig. 1, 2).


The image analysis was carried out with DrawWing software. It was written in C programming language using KDevelop 2.1. The program was run on a Pentium II Linux machine. The distribution package with source code can be downloaded from The program is distributed under GNU General Public License. Autotrace software [] was used, after some minor modifications, to fit the Bezier curves to the wing outlines and venation.

Image analysis

Discrimination of the wing outline and venation is based on two threshold values. Those values can be obtained automatically. Automatic calculation of the thresholds is based on local extrema of the image histogram. The threshold values obtained automatically can be sometimes inaccurate in which case the correct values can be provided as options. The program determines the outline of the wing first. The picture is converted to black and white using the outline threshold, and the object with the longest outline is assumed to be the wing. All pixels outside the wing outline are then changed to white and the venation outline is extracted using the venation threshold. The venation outline is converted to its skeleton by a thinning algorithm. To remove noise from the picture, all veins shorter than a specified value can be removed. On the wing outline, three characteristic points are chosen: apex, top and bottom. First the top and bottom points are determined. The tangents to the wing outline at those two points are parallel to each other and perpendicular to the line going through both points. Starting from the extreme left, pixels of the wing outline are examined in pairs until they meet the criterion. The distance between the top and bottom points is called the wing width. The wing apex is the pixel farthest to the left from the line going through the bottom and top points. The next step is fitting splines to the pixels positioned between the earlier-determined points. When one Bezier curve does not fit the pixels satisfactorily, the outline pixels are split and two Bezier curves are fitted. This subdivision continues until a satisfactory fit is achieved. In the case of the venation skeleton, splines are fitted to pixels lying between vein junctions. In this case as well, more then one spline can be fitted to one vein to obtain a satisfactory fit. The splines fitted to the wing outline and the venation skeleton comprise the wing diagram. In the diagram the width of veins is ignored and each vein is represented by one curve. The wing diagram is then scaled to make the wing width equal to 100. Finally the wing diagram is rotated to make the line segment determining the wing width vertical. The wing diagram is accompanied by a scale if the resolution of the input image was provided. There are two output files. One of them contains the wing diagram in encapsulated postscript format and the other contains the coordinates of the vein junctions in plain text format.

Statistical analysis

Coordinates of 17 vein junctions were extracted manually from the lists of coordinates generated by DrawWing. The coordinates were used to calculate the length of 23 veins. Curvature of the veins was neglected and only the distance between their endpoints was calculated. Stepwise discriminant function analysis was used to find criteria of classification of the wings. Only those veins were used in the analysis for which the F statistic, describing the contribution of the vein to species discrimination, was greater than one. The leave-one-out test was used to assess the reliability of the discrimination.


The wing diagrams generated by DrawWing from the forewing images of the dragonfly (A. juncea) and two species of wasps (D. sylvestris and D. saxonica) are shown in Figure 3, 4A, and 4B, respectively. Coordinates of the vein junctions extracted from the forewings of the two species of wasps usually clustered around different points (Fig. 5). Out of 23 vein lengths 11 differed significantly between the two wasp species (Table 1). Discriminant function analysis based on 12 vein lengths, which contributed most to the differences between the species (Table 1), allowed discrimination between D. sylvestris and D. saxonica. All 22 wasp individuals were classified correctly in the leave-one-out test. The length of vein 9–14 contributed most to the discrimination (Tab. 1). In D. sylvestris the vein 9–14 was markedly shorter than in D. saxonica.


The results presented here show clearly that DrawWing can generate useful wing diagrams from images of insect wings. Almost all veins from the dragonfly wing were extracted reliably. The only imperfection was conversion of the pterostigma into a combination of lines. At this stage DrawWing does not recognize large dark areas and converts them into lines. As a consequence inaccurate vein recognition can occur in species with dark pattern on wings (for example Pompilidae).

Apart from the wing diagram DrawWing also generates the list of coordinates of vein junctions. The list of coordinates was used successfully to discriminate between D. sylvestris and D. saxonica males. Males of different species from genera Vespula and Dolichovespula are difficult to distinguish and it is believed that they can be reliably identified only using their genitalia (Edwards, 1980). It is shown here that comparison of wing venation is another discrimination method at least in case of D. sylvestris and D. saxonica. The new method does not require any experience and can be used by non-specialists.

Several attempts have been made to build automatic insect identification systems based on image analysis (Batra, 1988, Yu et al., 1992; Roth et al., 1999; Weeks et al., 1999; Schroder et al., 2002). The systems differ in their level of automation. Some of them require pointing wing landmarks with a mouse (e.g. Schroder et al., 2002) others require intervention at various stages of largely automatic processes (e.g. Yu et al., 1992). Even the most automated insect identification program (Weeks et al. 1999) requires manual wing positioning and cropping. The wing positioning proved to be time consuming and was considered by Weeks et al., (1999) as the main limitation of their system. The problem of wing positioning was solved in DrawWing that produces consistent wing diagram independently of wing orientation.

In automatic insect identification systems, either all pixels are used in the analysis (Weeks et al., 1999) or only important features (landmarks) are analysed after their extraction from the image (Batra, 1988). A combination of these two approaches is also possible (Roth et al., 1999). Discrimination based on landmarks has 2 major advantages over discrimination based on all pixels. First, of all the interpretation and verification of results of the analysis based on landmarks is easier as their meaning is more intuitive than the intensity of image pixels. Moreover, analysis based on landmarks is much faster because number of the landmarks is many fold smaller than number of image pixels. This can be very important when large numbers of species are compared. DrawWing can extract landmarks from an insect wing automatically. This means it can become part of an automatic insect identification system discriminating large number of species. Currently DrawWing does not contain a database of wing diagrams and does not perform the classification automatically. However, it is free and easily accessible to a wide range of potential users, therefore, the database can be built faster than with commercially distributed software. Free software can be improved by multiple groups of developers, leading to rapid advances. To my knowledge DrawWing is the only computer program for automatic extraction of important features from insect wings that is freely distributed together with its source code.


I thank Krystyna Czekonska, Michael Jacobs and two anonymous reviewers for helpful comments on earlier versions of this paper.



S. W. T. Batra 1988. Automatic image analysis for rapid identification of Africanized honey bees. In: Needham GR, editors. Africanized honey bees and bee mites. Ellis Horwood Series in Entomology and Acarology. Halsted Press, New York. pp. 260–263. Google Scholar


J. H. Comstock 1940. An introduction to entomology. Comstock Publishing Company. Ithaca, New York. Google Scholar


S. Dedej and F. Nazzi . 1994. Two distances of forewing venation as estimates of wing size. Journal of Apicultural Research 33:59–61. Google Scholar


R. Edwards 1980. Social wasps: their biology and control. Rentokil, East Grinstead. Google Scholar


C. P. Klingenberg, A. V. Badyaev, S. M. Sowry, and N. J. Beckwith . 2001. Inferring developmental modularity from morphological integration: analysis of individual variation and asymmetry in bumblebee wings. American Naturalist 157:11–23. Google Scholar


V. Roth, A. Pogoda, V. Steinhage, and S. Schroder . 1999. Pattern recognition combining feature- and pixel-based classification within a real world application. DAGM-Symposium 21:120–129. Google Scholar


S. Schroder, D. Wittmann, W. Drescher, V. Roth, V. Steinhage, and A. B. Cremers . 2002. The new key to bees: Automated identification by image analysis of wings. In: Kevan P, Imperatriz Fonseca VL, editors. Pollinating bees – the Conservation Link Between Agriculture and Nature. Ministry of Environment: Brasilia. Google Scholar


P. J. D. Weeks, M. A. O'Neill, K. J. Gaston, and I. D. Gauld . 1999. Species-identification of wasps using principal component associative memories. Image and Vision Computing 17:861–866. Google Scholar


D. S. Yu, E. G. Kokko, J. R. Barron, G. B. Schaalje, and B. E. Gowen . 1992. Identification of Ichneumonid wasps using image analysis of wings. Systematic Entomology 17:389–395. Google Scholar

Figure 1.

Image of a dragonfly (Aeshna juncea) forewing used by DrawWing to generate a wing diagram.


Figure 2.

Images of forewings of Dolichovespula sylvestris (A) and Dolichovespula saxonica (B) used by DrawWing to generate wing diagrams.


Figure 3.

Diagram of a dragonfly (Aeshna juncea) forewing wing generated by DrawWing. The unit of both axes is 1/100 of the wing width.


Figure 4.

Wing diagrams of Dolichovespula sylvestris (A) and Dolichovespula saxonica (B) generated by DrawWing. The vein junctions were numbered consecutively. The unit of both axes is 1/100 of the wing width.


Figure 5.

Coordinates of vein junctions extracted from 11 forewing of Dolichovespula sylvestris (empty circles) and 11 forewings of Dolichovespula saxonica (closed circles). The coordinates system is the same as in wing diagrams (Fig. 4).


Table 1.

Veins lengths extracted from Dolichovespula sylvestris and Dolichovespula saxonica wings. Students t test was used to compare veins lengths between species. The veins were named according to junction numbers (Fig. 4) between which they were located. All individuals were classified accurately by discriminant function analysis based on 12 veins.

Adam Tofilski "DrawWing, a program for numerical description of insect wings," Journal of Insect Science 4(17), 1-5, (1 May 2004).
Received: 23 July 2003; Accepted: 1 April 2004; Published: 1 May 2004

Back to Top