-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathMyBlender.h
41 lines (32 loc) · 1.1 KB
/
MyBlender.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <opencv2/opencv.hpp>
#include <opencv2/gpu/gpu.hpp>
#include <opencv2/stitching/detail/blenders.hpp>
#include <opencv2/stitching/detail/util.hpp>
namespace cv {
namespace gpu {
namespace device {
void cudaFeed(const gpu::GpuMat &image, const gpu::GpuMat &mask, gpu::GpuMat &dst, int dx, int dy); // cuda version feed
void cudaFeed(const Mat &img, const Mat &mask, gpu::GpuMat &dst, int dx, int dy); // cuda version feed
void cudaFeed(const Mat &img, const Mat &mask, Mat &dst, int dx, int dy); // Jetson TK1 version feed
} // namespace device
} // namespace gpu
namespace detail {
class MyBlender : public Blender
{
public:
MyBlender(int try_gpu = false);
void prepare(const vector<Point> &corners, const vector<Size> &sizes)
{
prepare(resultRoi(corners, sizes));
}
void prepare(Rect dst_roi);
void feed(const Mat &img, const Mat &mask, Point tl);
void feed(const gpu::GpuMat &img, const gpu::GpuMat &mask, Point tl);
void blend(Mat &dst, Mat &dst_mask);
protected:
bool use_gpu;
gpu::GpuMat gpuDst_;
};
} // namespace detail
} // namespace cv