diff --git a/KinectHelper.cpp b/KinectHelper.cpp index b150e5f..8cf51fc 100644 --- a/KinectHelper.cpp +++ b/KinectHelper.cpp @@ -95,3 +95,29 @@ CvPoint operator+(CvPoint a, CvPoint b) return ret; } +std::ostream& operator<<(std::ostream& s, const cv::Mat& mat) +{ + s << "[Channels: " << mat.channels() << "][Size: W:" << mat.size().width << ";H: " << mat.size().height << "][Rows: " << mat.rows << "][Cols: " << mat.cols << "]"; + return s; +} + +std::ostream& operator<<(std::ostream& s, const CvPoint& point) +{ + s << "[" << point.x << ":" << point.y << "]"; + return s; +} + +bool leftOf(const std::pair& point, const std::pair& of) +{ + return point.second->centroid.x < of.second->centroid.x; +} + +bool rightOf(const std::pair& point, const std::pair& of) +{ + return point.second->centroid.x > of.second->centroid.x; +} + +bool smallestIndex(const std::pair& a, const std::pair& b) +{ + return a.first < b.first; +}