I have just finished the first version (v0) of EggArrange. This compares two photographs, that may not necessarily match in scale or position. We would like to test the arrangement hypothesis (Polačiková et al. 2013), however taking standardize photographs in the field is a challenge. Even if you calibrate images based on a size standard, the objects you wish to compare may not actually match in size. One reason for this is if the size standard is located at the edge of the image where subtle distortions occur. A recent distance transformation technique (written for MatLab) was published in Methods in Ecology and Evolution (Taylor et al. 2013). This technique searches for the minimum difference between two images, displacing the image and stretching until the best match is created. We are initially just interested in the silhouette of the eggs before and after treatment, so our task is relatively simple. However, we don't want to stretch our images, just resize them and move them until they provide the best match, because these are the issues that arose from differences in the photographs (different location of eggs in the frame and distance from nest), and through pre-processing such as calibrating the image to the size standard in both images. Moreover, MatLab provides a substantial finantial barrier for most researchers, therefore I rewrote custom codes that run similar analyses using Linux bash coding and ImageMagick (that is how it is spelled). Here's an example of it in action:
This examines the absolute error (visualized in red pixels) and presents those differences as a percentage of black pixels (eggs) in the first image. The codes can be easily adapted for automation and other types of comparisons.
Here, comparisons are first made between image 1 and image 2 scaled to 15% larger to 15% smaller (1 percent increments). Then the best match is chosen as the new image 2, then image 2 is shifted 30% to the right to 30% to the left, and the best comparison is chosen, then the same is applied to the y axis. These three steps are repeated to optimize the comparison (some rescaling may be necessary).
Generally this works well, but finding the minimum difference produces incorrect comparisons (i.e., a if image 1 has only one egg, the whole clutch in image 2 may be scaled to fit inside that egg - hypothetically speaking). Therefore, along with the dissimilarity (%) the program produces the comparison image. Users are encouraged to check these carefully, and report them with publications as necessary.
Please view my research website to obtain the codes. The pre-release version is password protected, so please contact me to discuss its use.
References:
Polačiková, L., F. Takasu, B. G. Stokke, A. Moksnes, E. Røskaft, P. Cassey, M. E. Hauber, and T. Grim. 2013. Egg arrangement in avian clutches covaries with the rejection of foreign eggs. Animal cognition 16:819–828.
Taylor, C. H., F. Gilbert, and T. Reader. 2013. Distance transform : a tool for the study of animal colour patterns. Methods in Ecology and Evolution 4:771–781.
This examines the absolute error (visualized in red pixels) and presents those differences as a percentage of black pixels (eggs) in the first image. The codes can be easily adapted for automation and other types of comparisons.
Here, comparisons are first made between image 1 and image 2 scaled to 15% larger to 15% smaller (1 percent increments). Then the best match is chosen as the new image 2, then image 2 is shifted 30% to the right to 30% to the left, and the best comparison is chosen, then the same is applied to the y axis. These three steps are repeated to optimize the comparison (some rescaling may be necessary).
Generally this works well, but finding the minimum difference produces incorrect comparisons (i.e., a if image 1 has only one egg, the whole clutch in image 2 may be scaled to fit inside that egg - hypothetically speaking). Therefore, along with the dissimilarity (%) the program produces the comparison image. Users are encouraged to check these carefully, and report them with publications as necessary.
Please view my research website to obtain the codes. The pre-release version is password protected, so please contact me to discuss its use.
References:
Polačiková, L., F. Takasu, B. G. Stokke, A. Moksnes, E. Røskaft, P. Cassey, M. E. Hauber, and T. Grim. 2013. Egg arrangement in avian clutches covaries with the rejection of foreign eggs. Animal cognition 16:819–828.
Taylor, C. H., F. Gilbert, and T. Reader. 2013. Distance transform : a tool for the study of animal colour patterns. Methods in Ecology and Evolution 4:771–781.
