[chronojump] kneeAngle: show counter until startAt frame
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] kneeAngle: show counter until startAt frame
- Date: Sat, 27 Mar 2010 18:32:46 +0000 (UTC)
commit 16ad067e8495655643f13d3dfeda275cf6411d8e
Author: Xavier de Blas <xaviblas gmail com>
Date: Sun Mar 28 02:31:51 2010 +0800
kneeAngle: show counter until startAt frame
src/angle/kneeAngle.cpp | 18 +++++++++++++++---
src/angle/kneeAngleFunctions.cpp | 3 ++-
2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/src/angle/kneeAngle.cpp b/src/angle/kneeAngle.cpp
index 2351b78..4f2cdc3 100644
--- a/src/angle/kneeAngle.cpp
+++ b/src/angle/kneeAngle.cpp
@@ -229,8 +229,7 @@ int main(int argc,char **argv)
imageGuiResult(gui, "Starting... please wait.", font);
- cvShowImage("gui", gui);
-
+// cvShowImage("gui", gui);
cvWaitKey(100); //to allow gui image be shown
int kneeMinWidth = 0;
@@ -288,6 +287,9 @@ int main(int argc,char **argv)
double avgKneeBackDistance = 0;
int framesDetected = 0;
int framesCount = 0;
+ //show a counting message every n frames:
+ int framesCountShowMessage = 0;
+ int framesCountShowMessageAt = 50;
//to advance fast and really fast
bool forward = false;
@@ -425,6 +427,15 @@ int main(int argc,char **argv)
if(!frame)
break;
if(startAt > framesCount) {
+ //show a counting message every framesCountShowMessageAt, and continue
+ framesCountShowMessage ++;
+ if(framesCountShowMessage >= framesCountShowMessageAt) {
+ eraseGuiResult(gui, true);
+ sprintf(label, "frame: %d...", framesCount);
+ imageGuiResult(gui, label, font);
+ cvWaitKey(50); //to allow gui image be shown
+ framesCountShowMessage = 0;
+ }
continue;
}
if(forward || fastForward) {
@@ -877,7 +888,7 @@ int main(int argc,char **argv)
*/
cvShowImage("toClick", frame_copy);
- cvShowImage("threshold",output);
+ //cvShowImage("threshold",output);
//exit if we are going up and soon jumping.
//toe will be lost
@@ -896,6 +907,7 @@ int main(int argc,char **argv)
askForMaxFlexion = false;
}
}
+ cvShowImage("threshold",output);
}
diff --git a/src/angle/kneeAngleFunctions.cpp b/src/angle/kneeAngleFunctions.cpp
index 5f4811f..f4b9b49 100644
--- a/src/angle/kneeAngleFunctions.cpp
+++ b/src/angle/kneeAngleFunctions.cpp
@@ -1159,6 +1159,7 @@ int calculateBrightness(IplImage* img)
//true means find the black pants.
//false means find the points
+//TODO: in the future put values of min or max regarding on statistics of analyzed jumps
int calculateThresholdStart(IplImage * gray, bool pantsOrPoints)
{
int brightness = calculateBrightness(gray);
@@ -1196,7 +1197,7 @@ int calculateThresholdStart(IplImage * gray, bool pantsOrPoints)
int thresMin = 10;
if(!pantsOrPoints) { //threshold for points
thresMax = 190;
- thresMin = 70;
+ thresMin = 85;
}
if(brightness >= briMax)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]