Dec 23, 2011

Sea Turtles on Malaysian Bank Notes

From the website of Central Bank of Malaysia
As ambassadors of the rich and colourful marine life found in our tropical waters, two of the most well-known species of sea turtles endemic to Malaysian waters are on the new RM20 banknote - the Hawksbill Turtle (Eretmochelys imbricata) and Leatherback Turtle (Dermochelys coriacea).

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.

Jul 23, 2011

JTP Turtle Talk (4)

Part 1
Part 2
Part 3

Meet Jo, a 5 year old green sea turtle that we take care of. Jo was born in our hatchery in 2006. When we went to release her in the sea with her other brothers and sisters, she was found running in circles on the sand because of a weak arm. That's when we realized that something is wrong with her and a close inspection also revealed that she has no eyes. She was born this way probably due to some kind of genetic or developmental anomaly from mistreatment of the egg while transfering from the original nest. A turtle without eyes will not survive in the ocean or on land. This is just natures way of making sure that only the fittest individuals survive. So by keeping her in our sanctuary we are not tampering with the natural course here.

JTP Turtle Talk (3)

Part 1
Part 2

The way we try to protect turtle eggs is by bringing them to an enclosed hatchery until the baby turtles hatch. This is not ideal, it is much better to leave the eggs in place where they were laid, but that is not possible here now. Still a hatchery should always be viewed as a temporary feature, not a solution. It is better to have the entire area protected and not need to take, or hide, the eggs.

Jul 22, 2011

JTP Turtle Talk (2)

Part 1

So what do we do at JTP ? We focus on sustaining the turtle population, habitat defence and raising awareness. This brings us to understand and work with the nature, people, economy and politics of this island. We are not hippies or treehuggers, we are working toward a specific goal here. We work toward not having to run a conservation effort like this because people will be conscious and protective of nature around them and wild life in the area including sea turtles.

JTP Turtle Talk (1)

Charlie doing the turtle talk

I volunteered in the Juara Turtle Project for a month in June 2011. Every morning and evening we would give a 45 minutes long 'Turtle Talk' to interested tourists, followed by a tour of the hatchery and a chance to meet Jo - the blind Gree turtle that JTP have been taking care of since 2006.

Jul 17, 2011

Map of Mentawak Beach

Juara Turtle Project is a sea turtle conservation effort at the Juara village of Tioman island in Malaysia. Currently they are monitoring three beaches on the east coast of Tioman. Depending on tide schedule, the conservationists at JTP take turns patrolling the Mentawak beach every night.

I surveyed the Mentawak beach while volunteering at JTP for a month. This map of Pasir Mentawak(Mentawak Beach) is based on the GIS data collected through out June 2011. High-tide line, low-tide line, vegetation line along with some important geographic features and landmarks are shown on this map. A Garmin Etrex GPS receiver was used for data collection. These low cost GPS receivers being sand and water resistant are ideal for the job IMHO. An open source graphics editor, Inkscape was used to plot the map. The image posted in this blog entry is a low resolution bitmap. Vector version in Scalable Vector Graphics (SVG) format or a PDF file is available upon request.

Jul 12, 2011

Plants can damage sea turtle eggs too

Any sea turtle conservationist in charge of a hatchery should watch out for animals that can dig. Dogs, crabs, lizards, rats, snakes etc. animals are natural threat to eggs in any sea turtle nest on the beach and they will gladly play the same role against secondary nests that have been set up in a hatchery. Although it sounds incredible, trees can also damage the eggs by growing roots around or into the eggs.

In a recent excavation of a secondary nest in Juara Turtle Project, some eggs were found damaged in this way. While some of the eggs were completely entangled with the roots growing all around, others were found damaged by the roots breaking the shell and growing into the egg.

May 18, 2011

C++ Function Templates

One of the seldom used features of the C++ programming language is type parametrization a.k.a. Template. This often overlooked feature actually enables a separate programming paradigm - Generic Programming. This allows functions and classes to operate on generic data types. Functions and classes can work on many different data types without being rewritten for each type. There are two kind of templates in C++, function templates and class templates.

Templates provide a way to reuse source code. Here they differ from inheritance and composition which provide ways to reuse object code. This also implies that using templates will cost more time in compilation. However, unless the template is a very complex one, the additional time in compiling is negligible.

A function template for finding maximum of two instances of the same type can be coded as following :

template <typename T>
T& max(T& x, T& y)
if(y < x)
return x;

return y;

This template function can be used for native data types as well as classes provided that the "<" operator has been overloaded for that class. The compiler will replace the T in template code with appropriate types during compilation.

If a template function is required to behave in a certain way for a certain data type, it can be specialized for those data types.

One important point about template functions is that, when working in multiple-file projects, the declaration and definition has to be in the same file.

May 16, 2011

Visualizing Genetic Algorithms 1

I've started working on a Genetic Algorithm visualizer tool. The primary goal is to visualize every individual (suboptimal solution) in every generation till termination of the algorithm. Each individual is assigned an unique ID which, along with the individual's parents' IDs can be seen on top left corner of each icon. The number at the bottom left corner is the fitness value of the individual. Apart from this, average fitness, best fitness of every generation are also plotted. Using C++ and OpenGL to build the visualizer tool.

In the picture above, I'm trying to breed a regular pentagon starting with initial population of 20 randomly generated pentagons. The fitness function used here is the standard deviation of distances of the vertices from a point inside the pentagon. Here we can see the 11 generation of pentagons on the same page. I will be posting more updates.

Mar 13, 2011

Stranded turtles on Teknaf beach

Some stranded turtles were spotted on Teknaf beach during my last expedition to the area on 3rd March 2011.

Mar 10, 2011

Fiddler Crab Handedness Detection

Fiddler Crab is the common name for the semi-terrestrial crabs of the genus Uca. The males have an oversized claw or cheliped. If the large fiddle claw is lost, males will develop one on the opposite side after their next molt.

I recently stumbled upon a solution for determining handedness of a male fiddler crab from its photograph.

The procedure assumes that the photo shows front side of the crab and the fiddle claw is horizontal or nearly horizontal in the photo. The basic idea is to find out the fiddle claw and the hole formed between two pincers of the claw. From determining the center of mass of these two regions on the 2D image, it can be detected whether the crab is left-handed or right-handed.

The photo was shot last year during an expedition near the mangrove area of Reju Khal in Cox's Bazar.

Mar 7, 2011

Generation of Mountain Ranges by Modifying a Controlled Terrain Generation Approach

A modification and extension of the parametrically controlled terrain generation approach produces mountain ranges of predefined shape with peaks at specified coordinates.

Like the original algorithm, the parameters can be tweaked to generate craters instead of peaks and other interesting geographical features.

The work was published in ICCIT 2008, Khulna bearing title Generation of Mountain Ranges by Modifying a Controlled Terrain Generation Approach

Automatic Species ID : Lepidochelys olivacea

The automatic species ID procedure I'm working on, follows these steps of image manipulation and decision making to detect Lepidochelys olivacea from a photo. For demonstration I'm using an image contributed by M.A. Hannan.

1. Convert RGB image to Lab color space
2. Enhance 'b' channel of the image

3. Complement 'b' channel of the image

4. Threshold complemented 'b' channel of the image with a predefined constant, 210 for this image

5. Dilate the resulting image

6. Fill the resulting image

7. Erode the resulting image

8. Mark the blob with maximum area

9. If area of the marked blob is not less than 30% of the image size then declare detection of LO

Feb 28, 2011

Automatic Species ID : Chelonia mydas

The automatic species ID procedure I'm working on goes through the following steps of image manipulation and decision making to detect Chelonia mydas from a photo. For demonstration I'm using an image contributed by Rachel Ruzgis to the image database of

1. Convert RGB image to Lab color space

2. Threshold 'a' channel of the image with a predefined constant, 100 for this image

3. Fill holes

4. Erode image
5. Mark the blob with maximum area

6. If area of the marked blob is not less than 20% of the image size then declare detection of CM

Jan 18, 2011

Gasteracantha hasseltii : Hasselt's Spiny Orb Weaver in Lawachhora

Gasteracantha hasseltii

This interesting yellow and black spider with three pairs of spines on its back is called Gasteracantha hasseltii or Hasselt's Spiny Orb Weaver. Found several specimens of this species in my last expedition to Lawachhora forest. It is typical of this spider to have elongated middle pair of spines unlike Gasteracantha arcuata in whose case it is the last pair that is elongated.

Gasteracantha hasseltii