Fixed some bugs in videostab module and refactored it
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
#include "opencv2/video/video.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
|
||||
// some aux. functions
|
||||
|
||||
inline float sqr(float x) { return x * x; }
|
||||
|
||||
inline float intensity(const cv::Point3_<uchar> &bgr)
|
||||
@@ -62,25 +64,5 @@ inline float intensity(const cv::Point3_<uchar> &bgr)
|
||||
return 0.3f*bgr.x + 0.59f*bgr.y + 0.11f*bgr.z;
|
||||
}
|
||||
|
||||
template <typename T> inline T& at(int index, T *items, int size)
|
||||
{
|
||||
return items[cv::borderInterpolate(index, size, cv::BORDER_WRAP)];
|
||||
}
|
||||
|
||||
template <typename T> inline const T& at(int index, const T *items, int size)
|
||||
{
|
||||
return items[cv::borderInterpolate(index, size, cv::BORDER_WRAP)];
|
||||
}
|
||||
|
||||
template <typename T> inline T& at(int index, std::vector<T> &items)
|
||||
{
|
||||
return at(index, &items[0], items.size());
|
||||
}
|
||||
|
||||
template <typename T> inline const T& at(int index, const std::vector<T> &items)
|
||||
{
|
||||
return items[cv::borderInterpolate(index, items.size(), cv::BORDER_WRAP)];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user