top of page

Peak image generation:

So far, we have had the figure with perfect hand size and perfect hand shape. The next step is to apply edge function we introduced before to make it a figure with color only black and white(Figure 4). So we want to generate a figure with peaks corresponding to the number of figures. Our idea of making such figure is to calculate the distance between each pixel on the hand edge and the reference point. Then, we hope that peaks will appear on the points of the terminals of the finger. However, to do the calculating stuff, we need to build a mapping relationship between the matrix and Cartesian coordinate. Our algorithm is quite simple in this part: we find out the elements whose value is 1 (black spot in an edged figure), and record is position in the matrix. Then, we convert the position of row and column using X and Y value, so it seems that the figure is carried to the coordinate without changing its shape as shown in Figure 5. By the way, you can see that the reference point is set at origin for convenience. So when doing converting stuff, we have to subtract each X value and Y value by the position of the reference point.

i.e.

   

    

 

Also, the figure rotates 90 degree because we let row to relate Y axis and column to relate X axis.

Figure 4: Edged figure

Figure 5: Hand in Cartesian coordinate

However, due to limited number of pixels we have, it is very possible that there are more than one points lying on the same X value. To avoid it, we again convert this diagram into polar coordinate to achieve one to one mapping, and then calculate the distance (Figure 6). Note that in our final figure, the X axis stands for the angle (θin rad) between the point and the reference point, and Y axis stands for the distance square (D^2) between the point and the reference point.

Figure 6: Relation of distance and position polar coordinate

bottom of page