43
#ifndef OPENCV_STITCHING_BLENDERS_HPP
 
44
#define OPENCV_STITCHING_BLENDERS_HPP
 
47
#  warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.
 
50
#include "opencv2/core.hpp"
 
51
#include "opencv2/core/cuda.hpp"
 
68
enum
{ NO, FEATHER, MULTI_BAND };
 
69
CV_WRAP
static
Ptr<Blender>
createDefault(
int
type,
bool
try_gpu =
false);
 
76
CV_WRAP
virtual
void
prepare(
const
std::vector<Point> &corners,
const
std::vector<Size> &sizes);
 
78
CV_WRAP
virtual
void
prepare(
Rect
dst_roi);
 
85
CV_WRAP
virtual
void
feed(InputArray img, InputArray mask,
Point
tl);
 
105
CV_WRAP
float
sharpness()
const
{
return
sharpness_; }
 
106
CV_WRAP
void
setSharpness(
float
val) { sharpness_ = val; }
 
108
CV_WRAP
void
prepare(
Rect
dst_roi) CV_OVERRIDE;
 
109
CV_WRAP
void
feed(InputArray img, InputArray mask,
Point
tl) CV_OVERRIDE;
 
114
CV_WRAP
Rect
createWeightMaps(
const
std::vector<UMat> &masks,
const
std::vector<Point> &corners,
 
115
CV_IN_OUT std::vector<UMat> &weight_maps);
 
120
UMat
dst_weight_map_;
 
123
inline
FeatherBlender::FeatherBlender(
float
_sharpness) { setSharpness(_sharpness); }
 
130
CV_WRAP
MultiBandBlender(
int
try_gpu =
false,
int
num_bands = 5,
int
weight_type = CV_32F);
 
132
CV_WRAP
int
numBands()
const
{
return
actual_num_bands_; }
 
133
CV_WRAP
void
setNumBands(
int
val) { actual_num_bands_ = val; }
 
135
CV_WRAP
void
prepare(
Rect
dst_roi) CV_OVERRIDE;
 
136
CV_WRAP
void
feed(InputArray img, InputArray mask,
Point
tl) CV_OVERRIDE;
 
140
int
actual_num_bands_, num_bands_;
 
141
std::vector<UMat> dst_pyr_laplace_;
 
142
std::vector<UMat> dst_band_weights_;
 
146
#if defined(HAVE_OPENCV_CUDAARITHM) && defined(HAVE_OPENCV_CUDAWARPING)
 
147
std::vector<cuda::GpuMat> gpu_dst_pyr_laplace_;
 
148
std::vector<cuda::GpuMat> gpu_dst_band_weights_;
 
149
std::vector<Point> gpu_tl_points_;
 
150
std::vector<cuda::GpuMat> gpu_imgs_with_border_;
 
151
std::vector<std::vector<cuda::GpuMat> > gpu_weight_pyr_gauss_vec_;
 
152
std::vector<std::vector<cuda::GpuMat> > gpu_src_pyr_laplace_vec_;
 
153
std::vector<std::vector<cuda::GpuMat> > gpu_ups_;
 
160
bool
gpu_initialized_;
 
168
void
CV_EXPORTS_W normalizeUsingWeightMap(InputArray weight, CV_IN_OUT
InputOutputArray
src);
 
170
void
CV_EXPORTS_W createWeightMap(InputArray mask,
float
sharpness, CV_IN_OUT
InputOutputArray
weight);
 
172
void
CV_EXPORTS_W createLaplacePyr(InputArray img,
int
num_levels, CV_IN_OUT std::vector<UMat>& pyr);
 
173
void
CV_EXPORTS_W createLaplacePyrGpu(InputArray img,
int
num_levels, CV_IN_OUT std::vector<UMat>& pyr);
 
176
void
CV_EXPORTS_W restoreImageFromLaplacePyr(CV_IN_OUT std::vector<UMat>& pyr);
 
177
void
CV_EXPORTS_W restoreImageFromLaplacePyrGpu(CV_IN_OUT std::vector<UMat>& pyr);
 
Template class for 2D rectangles
Definition:
core/types.hpp:421
 
Base storage class for GPU memory with reference counting.
Definition:
core/cuda.hpp:106
 
Base class for all blenders.
Definition:
blenders.hpp:64
 
Simple blender which mixes images at its borders.
Definition:
blenders.hpp:101
 
Blender which uses multi-band blending algorithm (see ).
Definition:
blenders.hpp:128
 
"black box" representation of the file storage associated with a file on disk.
Definition:
aruco.hpp:75
 
Definition:
cvstd_wrapper.hpp:74