From: Alex Schmidt Date: Wed, 9 Oct 2013 10:01:02 +0000 (+0200) Subject: fixed tracking screen mouse-callback. X-Git-Url: http://git.treefish.org/~alex/stickletrack.git/commitdiff_plain/7d30f3a8657e24e100a6264e54c0927475570d2d?ds=inline;hp=ab5ee4c78e1fa591a4d8d9af812f83a9e81ef6d7 fixed tracking screen mouse-callback. --- diff --git a/stickletrack.cpp b/stickletrack.cpp index da812df..e872ebd 100755 --- a/stickletrack.cpp +++ b/stickletrack.cpp @@ -397,9 +397,7 @@ int process(VideoCapture& capture) { openTanjaLog(); masking_init(); - tracking_init(); - - cvSetMouseCallback("contours_picture", mouseTracking, 0); + tracking_init(&mouseTracking); capture.set(CV_CAP_PROP_POS_FRAMES, 0); diff --git a/tracking.cpp b/tracking.cpp index 88c9512..9a185df 100644 --- a/tracking.cpp +++ b/tracking.cpp @@ -65,7 +65,7 @@ bool tracking_isEnabled () { return enablecontours; } -void tracking_init() { +void tracking_init( void (*mouseTracking)(int, int, int, int, void*) ) { namedWindow("stickletrack_tracking_prefs", CV_WINDOW_KEEPRATIO); namedWindow("stickletrack_tracking_screen", CV_WINDOW_KEEPRATIO); @@ -82,6 +82,8 @@ void tracking_init() { createTrackbar("max speed", "stickletrack_tracking_prefs", &Prefs.contours_maxspeed, 100, &trackbarCallbackUpdateNormPrefs, 0); createTrackbar("max rotation speed", "stickletrack_tracking_prefs", &Prefs.contours_maxrot, 100, &trackbarCallbackUpdateNormPrefs, 0); + cvSetMouseCallback("stickletrack_tracking_screen", mouseTracking, 0); + mContours = Mat::zeros(Props.height, Props.width, CV_8UC3); } diff --git a/tracking.h b/tracking.h index 7911da0..b8c522c 100644 --- a/tracking.h +++ b/tracking.h @@ -19,7 +19,7 @@ struct tag { Point2f head, tail; }; -void tracking_init(); +void tracking_init( void (*mouseTracking)(int, int, int, int, void*) ); void tracking_locateTags(vector& tags, Mat combinedmask_contour); Mat& tracking_getFrame(); int tracking_showFrame();