49 #include <pcl/pcl_exports.h>
52 #include <opencv2/core/core.hpp>
53 #include <opencv2/gpu/gpu.hpp>
71 int merge(
int set1,
int set2);
80 void operator =(
const DjSets&);
103 void addEdge(
int from,
int to,
const T& val=T());
113 void operator =(
const Graph&);
157 while (set !=
parent[set])
159 while (elem !=
parent[elem])
173 for (
int i = 0; i < n; ++i)
198 template <
typename T>
207 template <
typename T>
210 edges[nume] =
Edge(to, start[from], val);
216 inline int pix(
int y,
int x,
int ncols)
218 return y * ncols + x;
228 inline int dist2(
const cv::Vec4b& lhs,
const cv::Vec4b& rhs)
230 return sqr(lhs[0] - rhs[0]) +
sqr(lhs[1] - rhs[1]) +
sqr(lhs[2] - rhs[2]);
234 inline int dist2(
const cv::Vec2s& lhs,
const cv::Vec2s& rhs)
236 return sqr(lhs[0] - rhs[0]) +
sqr(lhs[1] - rhs[1]);
std::vector< int > parent
int merge(int set1, int set2)
Graph(int numv, int nume_max)
void addEdge(int from, int to, const T &val=T())
std::vector< Edge > edges
int pix(int y, int x, int ncols)
int dist2(const cv::Vec4b &lhs, const cv::Vec4b &rhs)
PCL_EXPORTS void meanShiftSegmentation(const cv::gpu::GpuMat &src, cv::Mat &dst, int sp, int sr, int minsize, detail::DjSets &comps, cv::TermCriteria criteria=cv::TermCriteria(cv::TermCriteria::MAX_ITER+cv::TermCriteria::EPS, 5, 1))
GraphEdge(int to, int next, const T &val)
bool operator<(const SegmLink &other) const
SegmLink(int from, int to, const SegmLinkVal &val)
SegmLinkVal(int dr, int dsp)
bool operator<(const SegmLinkVal &other) const