diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-06-13 07:28:56 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-06-13 07:36:06 +0200 |
commit | 19d0b68047ded81ba329cb7b11961b54f8c77c16 (patch) | |
tree | 67222e2368ebe19f29389941239f73904ba1ccb4 | |
parent | 611a36b3835e8cd5eb7c8f92b2503cbc11c92ff7 (diff) |
ewma: style only
fixup
-rw-r--r-- | ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp | 41 | ||||
-rw-r--r-- | ftnoir_filter_ewma2/ftnoir_filter_ewma2.h | 8 | ||||
-rw-r--r-- | ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp | 2 |
3 files changed, 3 insertions, 48 deletions
diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp index 60c3a2e6..c134e7ee 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.cpp @@ -29,7 +29,6 @@ #include "facetracknoir/global-settings.h" #include <algorithm> #include <QMutexLocker> -//#define LOG_OUTPUT /////////////////////////////////////////////////////////////////////////////// // @@ -69,8 +68,8 @@ void FTNoIR_Filter::FilterHeadPoseData(const double *target_camera_position, for (int i=0;i<6;i++) { new_camera_position[i] = target_camera_position[i]; current_camera_position[i] = target_camera_position[i]; - delta[i] = 0.0f; - noise[i] = 0.0f; + delta[i] = 0.0; + noise[i] = 0.0; } first_run=false; return; @@ -91,48 +90,12 @@ void FTNoIR_Filter::FilterHeadPoseData(const double *target_camera_position, alpha = 1.0/(s.kMinSmoothing+(1.0-pow(norm_noise,s.kSmoothingScaleCurve/20.0))*(s.kMaxSmoothing-s.kMinSmoothing)); new_camera_position[i] = alpha*target_camera_position[i] + (1.0-alpha)*current_camera_position[i]; } - -#ifdef LOG_OUTPUT - // Use this for some debug-output to file... - QFile data(QCoreApplication::applicationDirPath() + "\\EWMA_output.txt"); - if (data.open(QFile::WriteOnly | QFile::Append)) { - QTextStream out(&data); - out << "current:\t" << current_camera_position[0] - << "\t" << current_camera_position[1] - << "\t" << current_camera_position[2] - << "\t" << current_camera_position[3] - << "\t" << current_camera_position[4] - << "\t" << current_camera_position[5] << '\n'; - out << "target:\t" << target_camera_position[0] - << "\t" << target_camera_position[1] - << "\t" << target_camera_position[2] - << "\t" << target_camera_position[3] - << "\t" << target_camera_position[4] - << "\t" << target_camera_position[5] << '\n'; - out << "output:\t" << new_camera_position[0] - << "\t" << new_camera_position[1] - << "\t" << new_camera_position[2] - << "\t" << new_camera_position[3] - << "\t" << new_camera_position[4] - << "\t" << new_camera_position[5] << '\n'; - } -#endif - // Update the current camera position to the new position. for (int i = 0; i < 6; i++) { current_camera_position[i] = new_camera_position[i]; } } -//////////////////////////////////////////////////////////////////////////////// -// Factory function that creates instances if the Filter object. - -// Export both decorated and undecorated names. -// GetFilter - Undecorated name, which can be easily used with GetProcAddress -// Win32 API function. -// _GetFilter@0 - Common name decoration for __stdcall functions in C language. -//#pragma comment(linker, "/export:GetFilter=_GetFilter@0") - extern "C" FTNOIR_FILTER_BASE_EXPORT IFilter* CALLING_CONVENTION GetConstructor() { return new FTNoIR_Filter; diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h index 33c4ac33..b9df308f 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2.h @@ -64,11 +64,6 @@ private: settings s; }; -//******************************************************************************************************* -// FaceTrackNoIR Filter Settings-dialog. -//******************************************************************************************************* - -// Widget that has controls for FTNoIR protocol filter-settings. class FilterControls: public QWidget, public IFilterDialog { Q_OBJECT @@ -88,9 +83,6 @@ private slots: void doCancel(); }; -//******************************************************************************************************* -// FaceTrackNoIR Filter DLL. Functions used to get general info on the Filter -//******************************************************************************************************* class FTNoIR_FilterDll : public Metadata { public: diff --git a/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp b/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp index 395d1058..e3399a19 100644 --- a/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp +++ b/ftnoir_filter_ewma2/ftnoir_filter_ewma2_dialog.cpp @@ -23,7 +23,7 @@ * * ********************************************************************************/ #include "ftnoir_filter_ewma2.h" -#include "math.h" +#include <cmath> #include <QDebug> #include "facetracknoir/global-settings.h" #include "ui_ftnoir_ewma_filtercontrols.h" |