43#ifndef OPENCV_STITCHING_UTIL_HPP
44#define OPENCV_STITCHING_UTIL_HPP
47#include "opencv2/core.hpp"
58 DisjointSets(
int elem_count = 0) { createOneElemSets(elem_count); }
60 void createOneElemSets(
int elem_count);
61 int findSetByElem(
int elem);
62 int mergeSets(
int set1,
int set2);
64 std::vector<int> parent;
65 std::vector<int> size;
68 std::vector<int> rank_;
74 GraphEdge(
int from,
int to,
float weight);
75 bool operator <(
const GraphEdge& other)
const {
return weight < other.weight; }
76 bool operator >(
const GraphEdge& other)
const {
return weight > other.weight; }
82inline GraphEdge::GraphEdge(
int _from,
int _to,
float _weight) : from(_from), to(_to), weight(_weight) {}
88 Graph(
int num_vertices = 0) { create(num_vertices); }
89 void create(
int num_vertices) { edges_.assign(num_vertices, std::list<GraphEdge>()); }
90 int numVertices()
const {
return static_cast<int>(edges_.size()); }
91 void addEdge(
int from,
int to,
float weight);
92 template <
typename B> B forEach(B body)
const;
93 template <
typename B> B walkBreadthFirst(
int from, B body)
const;
96 std::vector< std::list<GraphEdge> > edges_;
104CV_EXPORTS_W
Rect resultRoi(
const std::vector<Point> &corners,
const std::vector<UMat> &images);
105CV_EXPORTS_W
Rect resultRoi(
const std::vector<Point> &corners,
const std::vector<Size> &sizes);
106CV_EXPORTS_W
Rect resultRoiIntersection(
const std::vector<Point> &corners,
const std::vector<Size> &sizes);
107CV_EXPORTS_W
Point resultTl(
const std::vector<Point> &corners);
110CV_EXPORTS_W
void selectRandomSubset(
int count,
int size, std::vector<int> &subset);
112CV_EXPORTS_W
int& stitchingLogLevel();
119#include "util_inl.hpp"
Template class for 2D rectangles
Definition: core/types.hpp:421
Template class for specifying the size of an image or rectangle.
Definition: core/types.hpp:316
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75