[chronojump] kneeAngle allows to start at % of video



commit 14aa4ed3fd357a979c6e12b5bb29268f9f2d427f
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Mar 26 20:58:25 2010 +0800

    kneeAngle allows to start at % of video

 src/angle/kneeAngle.cpp |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/angle/kneeAngle.cpp b/src/angle/kneeAngle.cpp
index 512389b..3ab8498 100644
--- a/src/angle/kneeAngle.cpp
+++ b/src/angle/kneeAngle.cpp
@@ -171,19 +171,25 @@ int main(int argc,char **argv)
 		exit(0);
 	}
 	
+	int framesNumber = cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_COUNT);
+
 	if(argc == 3) {
-		startAt = atoi(argv[2]);
+		if(atof(argv[2])==.25) 			
+			startAt = framesNumber*.25;	//start at 25%
+		else if(atof(argv[2])==.5)		
+			startAt = framesNumber*.5;	//start at 50%
+		else if(atof(argv[2])==.75)		
+			startAt = framesNumber*.75;	//start at 75%
+		else 					
+			startAt = atoi(argv[2]);	//start at selected frame
 	}
-
-	/*
-	int framesNumber = cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_COUNT);
-	printf("--%d--\n", framesNumber);
-	*/
+	
+	printf("Number of frames: %d\t Start at:%d\n\n", framesNumber, startAt);
 
 	//3D
 	//printf("framesCount;hip.x;hip.y;knee.x;knee.y;toe.x;toe.y;angle seen;angle side;angle real\n");
 	//not 3D but record thresholds
-	printf("framesCount;hip.x;hip.y;knee.x;knee.y;toe.x;toe.y;angle current; threshold, th.hip; th.knee; th.toe\n");
+	//printf("framesCount;hip.x;hip.y;knee.x;knee.y;toe.x;toe.y;angle current; threshold, th.hip; th.knee; th.toe\n");
 
 	
 	/* initialization variables */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]