diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-26 06:45:31 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-26 06:50:47 +0200 |
commit | 1b00f064f5f10692af63d786bb9d27ea1356d946 (patch) | |
tree | fe19301feda6f5d57fae58302cc6a82f054ada6a /ftnoir_tracker_pt/camera.h | |
parent | 24538cf3a3a91481851618791b11be81437563e4 (diff) |
pt: preventing crashing on camera manipulation
Diffstat (limited to 'ftnoir_tracker_pt/camera.h')
-rw-r--r-- | ftnoir_tracker_pt/camera.h | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/ftnoir_tracker_pt/camera.h b/ftnoir_tracker_pt/camera.h index 343446ac..e73d9dff 100644 --- a/ftnoir_tracker_pt/camera.h +++ b/ftnoir_tracker_pt/camera.h @@ -26,7 +26,7 @@ struct CamInfo class Camera { public: - Camera() : dt_valid(0), dt_mean(0), desired_index(0), active_index(-1), active(false) {} + Camera() : dt_valid(0), dt_mean(0), desired_index(0), active_index(-1) {} virtual ~Camera() = 0; // start/stop capturing @@ -43,7 +43,7 @@ public: bool get_frame(float dt, cv::Mat* frame); // WARNING: returned references are valid as long as object - CamInfo get_info(); + bool get_info(CamInfo &ret); CamInfo get_desired() const { return cam_desired; } protected: @@ -60,7 +60,6 @@ private: protected: int desired_index; int active_index; - bool active; CamInfo cam_info; CamInfo cam_desired; }; @@ -68,7 +67,6 @@ inline Camera::~Camera() {} // ---------------------------------------------------------------------------- // camera based on OpenCV's videoCapture -#ifdef OPENTRACK_API class CVCamera : public Camera { public: @@ -88,29 +86,6 @@ protected: private: cv::VideoCapture* cap; }; -#else -// ---------------------------------------------------------------------------- -// Camera based on the videoInput library -class VICamera : public Camera -{ -public: - VICamera(); - ~VICamera() { stop(); } - - virtual void start(); - virtual void stop(); - -protected: - virtual bool _get_frame(cv::Mat* frame); - virtual void _set_device_index(); - virtual void _set_fps(); - virtual void _set_res(); - - videoInput VI; - cv::Mat new_frame; - unsigned char* frame_buffer; -}; -#endif enum RotationType { |