summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lange <klange@harmony.(none)>2010-01-23 16:20:32 -0600
committerKevin Lange <klange@harmony.(none)>2010-01-23 16:20:32 -0600
commita11551b48943ab975eb1f5cb9b41d25b20e0185e (patch)
tree84c8217c7d56e209039a2324a4b9a581c3101763
parent81046b1d3d9bc33af9bb4e6c56091c8b8a2754fa (diff)
downloadheadtracking-a11551b48943ab975eb1f5cb9b41d25b20e0185e.tar.gz
headtracking-a11551b48943ab975eb1f5cb9b41d25b20e0185e.tar.bz2
Updates? UPDATES!
-rw-r--r--facedetect.c9
-rw-r--r--headtracking.c9
2 files changed, 10 insertions, 8 deletions
diff --git a/facedetect.c b/facedetect.c
index 8ef363e..f1c6620 100644
--- a/facedetect.c
+++ b/facedetect.c
@@ -323,8 +323,7 @@ int detect(double scale, int uX, int uY, int *x1, int *y1, int *x2, int *y2, int
cvEqualizeHist(small_img, small_img);
cvClearMemStorage(storage);
CvSeq* faces = cvHaarDetectObjects( small_img, cascade, storage,
- 1.1, 2, 0
- |CV_HAAR_FIND_BIGGEST_OBJECT
+ 1.1, 2, 0 | CV_HAAR_FIND_BIGGEST_OBJECT
,
cvSize(30, 30) );
for( i = 0; i < (faces ? faces->total : 0); i++ ) {
@@ -518,8 +517,10 @@ int detect(double scale, int uX, int uY, int *x1, int *y1, int *x2, int *y2, int
*x2 = resx2 * uX / frame_copy->width;
*y2 = *y1;
lar = (*x1 + *x2) / 2;
- *x1 = lar - resw;
- *x2 = lar + resw;
+ //*x1 = lar - resw;
+ //*x2 = lar + resw;
+ *x1 = lar - 3;
+ *x2 = lar + 3;
}
return(retour);
}
diff --git a/headtracking.c b/headtracking.c
index 4d3a1f3..758a336 100644
--- a/headtracking.c
+++ b/headtracking.c
@@ -289,9 +289,10 @@ static Bool WTPaintWindow(CompWindow *w, const WindowPaintAttrib *attrib,
// XXX: Note that positions should be float values from 0-1024
// and 0-720 (width, height, respectively).
static void WTLeeTrackPosition (CompScreen *s, float x1, float y1,
- float x2, float y2, float radPerPix) {
+ float x2, float y2) {
HEADTRACKING_SCREEN (s);
+ float radPerPix = (PI / 3.0f) / 1024.0f;
// Where is the middle of the head?
float dx = x1 - x2, dy = y1 - y2;
float pointDist = (float)sqrt(dx * dx + dy * dy);
@@ -325,15 +326,15 @@ static Bool WTPaintOutput(CompScreen *s, const ScreenPaintAttrib *sAttrib,
WIIMOTE_DISPLAY (s->display);
if (ad->cWiimote[0].ir[0].valid && ad->cWiimote[0].ir[1].valid) {
WTLeeTrackPosition (s, (float)ad->cWiimote[0].ir[0].x, (float)ad->cWiimote[0].ir[0].y,
- (float)ad->cWiimote[0].ir[1].x, (float)ad->cWiimote[0].ir[1].y,
- (PI / 3.0f) / 1024.0f);
+ (float)ad->cWiimote[0].ir[1].x, (float)ad->cWiimote[0].ir[1].y);
}
}
#endif
if (headtrackingGetEnableCamtracking (s)) {
int x1, y1, x2, y2;
if (headtrack(&x1, &y1, &x2, &y2, headtrackingGetWebcamLissage(s), headtrackingGetWebcamSmooth(s), 0, headtrackingGetScale(s))) {
- WTLeeTrackPosition(s, (float)x1, (float)y1, (float)x2, (float)y2, (float)headtrackingGetDepthAdjust (s) / 10000.0);
+ WTLeeTrackPosition(s, (float)x1, (float)y1, (float)x2, (float)y2);
+ wts->head.z = (float)headtrackingGetDepthAdjust (s) / 100.0;
}
}