43 #ifndef __OPENCV_STITCHING_UTIL_HPP__
44 #define __OPENCV_STITCHING_UTIL_HPP__
56 #include <android/log.h>
57 #define LOG_STITCHING_MSG(msg) \
59 std::stringstream _os; \
61 __android_log_print(ANDROID_LOG_DEBUG, "STITCHING", "%s", _os.str().c_str()); \
65 #define LOG_STITCHING_MSG(msg) for(;;) { std::cout << msg; std::cout.flush(); break; }
68 #define LOG_STITCHING_MSG(msg)
71 #define LOG_(_level, _msg) \
74 if ((_level) >= ::cv::detail::stitchingLogLevel()) \
76 LOG_STITCHING_MSG(_msg); \
82 #define LOG(msg) LOG_(1, msg)
83 #define LOG_CHAT(msg) LOG_(0, msg)
85 #define LOGLN(msg) LOG(msg << std::endl)
86 #define LOGLN_CHAT(msg) LOG_CHAT(msg << std::endl)
104 void createOneElemSets(
int elem_count);
105 int findSetByElem(
int elem);
106 int mergeSets(
int set1,
int set2);
112 std::vector<int> rank_;
118 GraphEdge(
int from,
int to,
float weight);
132 Graph(
int num_vertices = 0) { create(num_vertices); }
133 void create(
int num_vertices) { edges_.assign(num_vertices, std::list<GraphEdge>()); }
134 int numVertices()
const {
return static_cast<int>(edges_.size()); }
135 void addEdge(
int from,
int to,
float weight);
136 template <
typename B>
B forEach(
B body)
const;
137 template <
typename B>
B walkBreadthFirst(
int from,
B body)
const;
140 std::vector< std::list<GraphEdge> > edges_;
162 #endif // __OPENCV_STITCHING_UTIL_HPP__
GraphEdge(int from, int to, float weight)
Definition: util.hpp:126
const int * sizes
Definition: core_c.h:212
IplImage CvRect * roi
Definition: legacy.hpp:234
CV_EXPORTS Rect resultRoi(const std::vector< Point > &corners, const std::vector< Mat > &images)
const void * elem
Definition: core_c.h:1075
CV_EXPORTS MatExpr operator>(const Mat &a, const Mat &b)
CV_EXPORTS bool overlapRoi(Point tl1, Point tl2, Size sz1, Size sz2, Rect &roi)
The 2D size class.
Definition: core.hpp:81
CV_EXPORTS int & stitchingLogLevel()
void create(int num_vertices)
Definition: util.hpp:133
CV_EXPORTS Point resultTl(const std::vector< Point > &corners)
DisjointSets(int elem_count=0)
Definition: util.hpp:102
int numVertices() const
Definition: util.hpp:134
GLuint GLuint GLsizei count
Definition: core_c.h:973
Graph(int num_vertices=0)
Definition: util.hpp:132
std::vector< int > size
Definition: util.hpp:109
CV_EXPORTS MatExpr operator<(const Mat &a, const Mat &b)
CvSize CvPoint2D32f * corners
Definition: calib3d.hpp:215
template 2D point class.
Definition: core.hpp:82
CV_EXPORTS void selectRandomSubset(int count, int size, std::vector< int > &subset)
int to
Definition: util.hpp:122
const CvMat * B
Definition: calib3d.hpp:161
std::vector< int > parent
Definition: util.hpp:108
float weight
Definition: util.hpp:123
GLsizeiptr size
Definition: core_c.h:939