1. Load the First Frame from the video
2. Select the checkBox of the corresponding finger ID to track
3. Click on the finger tip (of that ID) in the frame to get (X,Y) of that pixel
4. Put that (X,Y) value in InputBox //just to track that you got nothing weird
Repeat step 2-4 for as many as fingers to track.
If done click on the "start tracking"
//Get the color of
Color R = GetR (X,Y)
Color G = GetG (X,Y)
Color B = GetB (X,Y)
Track Centers (int X, int Y, Color R, Color G,Color B, int frameNo):
//Use threshold with added noise
//We can adjust the range of the considering area instead of 10
Look inside the rectangle (x-10,y-10) , (x+10,y+10)
for (i : x-10 to x+10)
for (j: y-10 to y+10)
if (R-20>getR(i,j)
add (i,j) to
if (pixels not found in candidate_pixels )
track the whole frame from (0,0) to (dimention(x),dimention(y))
Find_center (
center_x = avg(x)
center_y = avg(y)
return (center_x,center_y)
//or get the R,G,B of (X,Y) pixels for the center and call Track_Center for next Frame
No comments:
Post a Comment