Jul 26, 2011

Algorithm for Handedness Detection of Fiddler Crabs

Members of the genus Uca are generally known as Fiddler crabs for the overgrown claw of the males. The following algorithm detects a male fiddler crabs handedness from a photograph. The algorithm was implemented using Matlab R2009a.





Assumptions :
The photo was taken from front, close enough for the specimen to occupy significant portion of the frame.

Input :
Photograph in RGB format.

Procedure :
  • convertRGB image to Lab format
  • subtract background from l to correct non-uniform lighting, enhance the resulting image
  • apply threshold
  • perform morphological opening, remove blobs with area less than 200pixel
  • dilate
  • erode
  • mark the maximum area blob, find its centroid (C1)
  • find the maximum hole in maximum area blob, find hole's centroid (C2)
  • if C1 has X coordinate less than C2 then it's a right handed crab, otherwise its left handed


Test results :
The following two photos of a fiddler crab I shot near the mangrove area at Rezu Khal, Cox's Bazar was used to test the algorithm. The results are correct as can be seen from the images.

Future work :
To test the algorithm with photos taken at wide range of conditions as well as of many other species.

No comments:

Post a Comment