summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_tracker_pt
diff options
context:
space:
mode:
Diffstat (limited to 'ftnoir_tracker_pt')
-rw-r--r--ftnoir_tracker_pt/camera.h53
-rw-r--r--ftnoir_tracker_pt/point_extractor.h26
-rw-r--r--ftnoir_tracker_pt/trans_calib.h22
3 files changed, 51 insertions, 50 deletions
diff --git a/ftnoir_tracker_pt/camera.h b/ftnoir_tracker_pt/camera.h
index 86cafd42..2bca88a1 100644
--- a/ftnoir_tracker_pt/camera.h
+++ b/ftnoir_tracker_pt/camera.h
@@ -25,11 +25,11 @@ void get_camera_device_names(std::vector<std::string>& device_names);
// ----------------------------------------------------------------------------
struct CamInfo
{
- CamInfo() : res_x(0), res_y(0), fps(0) {}
+ CamInfo() : res_x(0), res_y(0), fps(0) {}
- int res_x;
- int res_y;
- int fps;
+ int res_x;
+ int res_y;
+ int fps;
};
// ----------------------------------------------------------------------------
@@ -65,7 +65,7 @@ protected:
virtual void _set_device_index() = 0;
virtual void _set_fps() = 0;
virtual void _set_res() = 0;
-
+private:
float dt_valid;
float dt_mean;
int desired_index;
@@ -82,18 +82,19 @@ inline Camera::~Camera() {}
class CVCamera : public Camera
{
public:
- CVCamera() : cap(NULL) {}
- ~CVCamera() { stop(); }
+ CVCamera() : cap(NULL) {}
+ ~CVCamera() { stop(); }
- void start() override;
- void stop() override;
+ void start() override;
+ void stop() override;
protected:
- bool _get_frame(cv::Mat* frame) override;
- void _set_fps() override;
- void _set_res() override;
+ bool _get_frame(cv::Mat* frame) override;
+ void _set_fps() override;
+ void _set_res() override;
void _set_device_index() override;
+private:
cv::VideoCapture* cap;
};
#else
@@ -102,21 +103,21 @@ protected:
class VICamera : public Camera
{
public:
- VICamera();
- ~VICamera() { stop(); }
+ VICamera();
+ ~VICamera() { stop(); }
- virtual void start();
- virtual void 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;
+ 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
@@ -128,12 +129,12 @@ enum RotationType
};
// ----------------------------------------------------------------------------
-class FrameRotation
+class FrameRotation
{
public:
RotationType rotation;
- cv::Mat rotate_frame(cv::Mat frame);
+ cv::Mat rotate_frame(cv::Mat frame);
};
#endif //CAMERA_H
diff --git a/ftnoir_tracker_pt/point_extractor.h b/ftnoir_tracker_pt/point_extractor.h
index 21d548af..3ef82900 100644
--- a/ftnoir_tracker_pt/point_extractor.h
+++ b/ftnoir_tracker_pt/point_extractor.h
@@ -15,21 +15,21 @@
// Extracts points from an opencv image
class PointExtractor
{
-public:
- // extracts points from frame and draws some processing info into frame, if draw_output is set
- // dt: time since last call in seconds
- // WARNING: returned reference is valid as long as object
- const std::vector<cv::Vec2f>& extract_points(cv::Mat &frame);
- const std::vector<cv::Vec2f>& get_points() { return points; }
- PointExtractor();
+public:
+ // extracts points from frame and draws some processing info into frame, if draw_output is set
+ // dt: time since last call in seconds
+ // WARNING: returned reference is valid as long as object
+ const std::vector<cv::Vec2f>& extract_points(cv::Mat &frame);
+ const std::vector<cv::Vec2f>& get_points() { return points; }
+ PointExtractor();
- int threshold_val;
- int threshold_secondary_val;
- int min_size, max_size;
+ int threshold_val;
+ int threshold_secondary_val;
+ int min_size, max_size;
-protected:
- std::vector<cv::Vec2f> points;
- cv::Mat frame_last;
+private:
+ std::vector<cv::Vec2f> points;
+ cv::Mat frame_last;
};
#endif //POINTEXTRACTOR_H
diff --git a/ftnoir_tracker_pt/trans_calib.h b/ftnoir_tracker_pt/trans_calib.h
index 609c9af1..5c321b2c 100644
--- a/ftnoir_tracker_pt/trans_calib.h
+++ b/ftnoir_tracker_pt/trans_calib.h
@@ -20,20 +20,20 @@
class TranslationCalibrator
{
public:
- TranslationCalibrator();
+ TranslationCalibrator();
- // reset the calibration process
- void reset();
+ // reset the calibration process
+ void reset();
- // update the current estimate
- void update(const cv::Matx33f& R_CM_k, const cv::Vec3f& t_CM_k);
+ // update the current estimate
+ void update(const cv::Matx33f& R_CM_k, const cv::Vec3f& t_CM_k);
- // get the current estimate for t_MH
- cv::Vec3f get_estimate();
+ // get the current estimate for t_MH
+ cv::Vec3f get_estimate();
-protected:
- cv::Matx66f P; // normalized precision matrix = inverse covariance
- cv::Vec6f y; // P*(-t_MH, t_CH)
+private:
+ cv::Matx66f P; // normalized precision matrix = inverse covariance
+ cv::Vec6f y; // P*(-t_MH, t_CH)
};
-#endif //TRANSCALIB_H \ No newline at end of file
+#endif //TRANSCALIB_H