AntCounter is a software tool for counting ants in field or laboratory conditions. It is based on videos of leaf cutting ants (LCA) on the foraging trail. They can be recorded with any domestic digital camera and at low resolution video quality. The software works detecting the movement of the objects in the video. AntCounter is based on the "HP computer vision” technology, and has been written in Python 2.7 employing the OpenCV 3.1.0 library. AntCounter runs on windows environment or any other operating system that supports Python 2.7
To install AntCounter follow the next steps:
Step 1: Download and install Anaconda2-2.4.0-windows-x86 for Windows 32 bits / 321M /, select all users and leave all settings as default.
for more information and support go to the official page http://www.python.org/ and http://continuum.io/.
Step 2 : Download OpenCV-2.4.13.5-vc14.exe from opencv-.2.4.13.5-vc14.exe (269 MB) . Double click in OpenCV.exe. It will ask for an extraction folder. Exctract to C:\. It will extract all files to C:\opencv\ . Wait until everything is extracted.
Step 3 : Download opencv_python-2.4.13-cp27-cp27m-win32.whl C:\
Goto your Start Menu. Start > All Programs > Accessories > Command Prompt
or search Command Prompt (cmd.exe) and open it.
Type into the Command Prompt window:
cd c:\
and hit enter, and type:
pip install opencv_python-2.4.13.5-cp27-cp27m-win32.whl
and hit enter
Step 4 :Download and save AntCounter V.3.0.
Step 5 : Right click in AntCounter V.3.0, Open, click in Browse..., choose C:\anaconda\python.exe
You can Download a test video from here AntCounter sample video.
In the next videos you can see a couple of samples of AntCounter in action
For optimum software performance the user needs to obtain first a high contrast between the ants and the background. We recommend setup a matte white tile of 30 x 30 cm on the foraging trail (Fig. 1) twelve hours before starting the video recording. This gives time to the ants to be used to the tile as part of the trail. An overly reflective background produces stray light and limits the signal to noise ratio of the system. A slippery surface is actively avoided by the ants and they would not include it as part of the foraging trail. The second part of this step is to set up the video camera. To avoid distortion of the image by perspective it must be set up in a tripod, and perpendicular to the tile; the frame size should be 20 x 15 cm (Fig. 1). During the recording time do not allow gloss or shadow movement over the tile.
Figure. 1. Correct camera setup to acquire the video for AntCounter.
Once the program has been installed and you have video recordings, you can start using the program. The first image that will appear on the screen is a box asking: How much time of your video do you want to analyze? Set up the minutes and seconds accordingly (Fig. 2).
Figure 2. View of graphic user interface showing the default configuration
AntCounter distinguishes individual ants by comparing subsequent frames and looking for differences in pixel color. Changes in color inside a five pixel radius are attributed to a moving ant. Once an individual ant is detected its walking direction is determined as the direction, up or down in the picture frame, when the ant first cross the middle section (green line in Fig. 3). AntCounter shows the total number of ants detected in each direction in real time. For convention Down refers to the number of ants going away of the nest, and Up to the number of ants coming into the nest.
Figure 3. Screen display of AntCounter analyzing a video frame.
When the video has been processed according to the specifications that were given, AntCounter displays a new window showing a graph with the cumulative number of ants as a response to time (Fig. 4). Then, another window opens up and displays the total number of ants: number of ants going Up, number of ants going Down, the adjusted number of ants going Up, the adjusted number of ants going Down, and the name of video input file (Fig. 5). Finally, the program saves the output of the analysis within the AntCounter folder in a tab delimited text file, with the same name of the input video file, stores the cumulative number of ants passing in each direction.
Figure 4. Output graph generated by AntCounter after the end of the video.
Figure 5. Summary output window displayed after the video is analyzed
Santiago Bustamante Sanint
santiagobus@gmail.com