Monday, December 7, 2009

Curve Spread

A paper by Dr. Soriano, Ms. Araullo, and Dr. Saloma on front-view biometrics published in Pattern Recognition Letters uses features from the silhouette of the object. In this activity, we will learn the technique used to extract the curve spread of an object.

I used an image of a key because it has different contour types. It has straight, concave, and convex edges. This image is not yet an application of this method, just an aid to help me program the algorithm.

First, the image of the key is thresholded so that the region of interest, which is the key, is well separated from the background. Morphological cleaning operations were performed to remove floating pixels and close holes in the object. Now that we have a cleaned image, the edge pixels are taken. The command edge in Matlab returns an array the size of the original image, with the edge pixels highlighted.


Now we have a one-pixel thick outline of the original image. What we want next is to get the coordinates of these pixels. Initially, I used Matlab to program this activity but I encountered a problem. I tried to use regionprops then PixelList to get the coordinates of the edge pixels but the coordinates it returns are arrange per column. What we need here is a list of pixels arranged as it was followed. The command follow in Scilab does exactly this.

Now that we have a list of pixels, we convert it to Freeman chain code by starting at an arbitrary pixel then following the line in a certain direction. For the image I used, I followed the contour in a clockwise direction. In making a Freeman chain code to store the relative directions of one pixel with respect to a previous pixel, we assign a number based on the following:



For example, we start at the certain pixel, and following the contour clockwise the next pixel happens to be in the upper left corner of the current pixel, the next pixel will be labeled '3'. If after that pixel labeled '3', the next pixel is directly below, this next pixel will be labeled '6', and so on.

Now we have the Freeman code chain for the contour of our image. To get its curvature information, we take the first order discrete difference of this array, or the difference of the current pixel and the previous pixel. Then for each pixel, we sum the values of the previous, current, and next pixel. This would produce an array of zeros, positive and negative numbers, which now gives us clues to the curvature of the portions it represents.

RESULTS
Let us look at the result of the curvature information for a portion of the key:


Straight segments are represented by consecutive zeros, concave regions are represented by positive numbers, and convex regions are represented by negative numbers.

One must be careful in using the follow command in Scilab. The outline of the object must be closed, otherwise the inner and outer edge of the outline will be followed, doubling the length of the coordinate list.

I give myself 10 points for successfully using the Freeman vector code in identifying the curvatures in the image.

0 comments:

Post a Comment