-
Notifications
You must be signed in to change notification settings - Fork 0
/
blending.h
74 lines (63 loc) · 2.21 KB
/
blending.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* --------------------------------------------------------------------------
* File: blending.h
* Created: 2015-10-30
* --------------------------------------------------------------------------
*
*
*
* ------------------------------------------------------------------------*/
#ifndef __blending__h
#define __blending__h
#include "Image.h"
#include "matrix.h"
#include "filtering.h"
#include "homography.h"
#include "panorama.h"
#include "basicImageManipulation.h"
#include <iostream>
#include <cmath>
using namespace std;
// encodes which type of blending to use
enum class BlendType {
BLEND_NONE,
BLEND_LINEAR,
BLEND_2LAYER
};
// linear blending
Image blendingweight(int imwidth, int imheight);
void applyhomographyBlend(const Image &source,
const Image &weight,
Image &out,
const Matrix &H,
bool bilinear = false);
Image stitchLinearBlending(const Image &im1,
const Image &im2,
const Image &we1,
const Image &we2,
const Matrix &H);
//all
vector<Image> scaledecomp(const Image &im, float sigma = 2.0);
Image stitchBlending(const Image &im1,
const Image &im2,
const Matrix &H,
BlendType blend);
Image autostitch(const Image &im1,
const Image &im2,
BlendType blend,
float blurDescriptor = 0.5,
float radiusDescriptor = 4);
// mini planets
Image pano2planet(const Image &pano, int newImSize, bool clamp=true);
// stitch N images
vector<Matrix> sequenceHs(const vector<Image> &ims,
float blurDescriptor = 0.5,
float radiusDescriptor = 4);
BoundingBox bboxN(const vector<Matrix> &Hs, const vector<Image> &ims);
Image autostitchN(const vector<Image> &ims,
int refIndex,
float blurDescriptor = 0.5,
float radiusDescriptor = 4);
// helpful functions
Image copychannels(const Image &im, int nChannels);
vector<Matrix> stackHomographies(const vector<Matrix> &Hs, int refIndex);
#endif