From 9d05e5dcadd5b6f425dbd21d5a0aded19d1425e5 Mon Sep 17 00:00:00 2001 From: Kenneth Keiter Date: Thu, 13 Dec 2012 14:19:16 -0800 Subject: [PATCH] Improves performance with image capture ever so slightly. --- main.cpp | 1 - markers.cpp | 2 +- markers.h | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 2ba1c79d02..4361bf3708 100644 --- a/main.cpp +++ b/main.cpp @@ -944,7 +944,6 @@ void motionFunc( int x, int y) void *poll_marker_capture(void *threadarg){ while(1){ marker_capturer.tick(); - usleep(1000 * MARKER_CAPTURE_INTERVAL); } } diff --git a/markers.cpp b/markers.cpp index 2ee4134f4b..d58befe44d 100644 --- a/markers.cpp +++ b/markers.cpp @@ -50,7 +50,7 @@ void MarkerCapture::acquire_color(CvScalar color){ /* Fetch a frame (if available) and process it, calling appropriate callbacks when data becomes available. */ void MarkerCapture::tick(){ - IplImage *thresh_frame; + IplImage *thresh_frame = NULL; CBlobResult blobs; // Acquire the lock, update the current frame. diff --git a/markers.h b/markers.h index eef2ad7c0a..9de2e5a157 100644 --- a/markers.h +++ b/markers.h @@ -50,12 +50,12 @@ public: MarkerCapture(int source_index); ~MarkerCapture(); + int init_capture(); + void tick(); void end_capture(); - void tick(); void acquire_color(CvScalar color); - void frame_updated(void (*callback)(MarkerCapture* inst, IplImage* image, IplImage* thresh_image)); void position_updated(void (*callback)(MarkerCapture* inst, MarkerPositionEstimate position)); void glDrawIplImage(IplImage *img, int x, int, GLfloat xZoom, GLfloat yZoom);