-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpanorama.h
80 lines (65 loc) · 1.91 KB
/
panorama.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
75
76
77
78
79
80
/*
Description: Header File containing structs for pixel RGBA information, other variables used as well as function declarations.
Name: Nitin Madhok
Date: December 4, 2013
Email: nmadhok@clemson.edu
*/
#include <cstdio>
#include <cstring>
#include "Transformation.h"
struct pixel {
unsigned char red;
unsigned char green;
unsigned char blue;
unsigned char alpha;
};
Vector3d point1_image1(0,0,1);
Vector3d point2_image1(0,0,1);
Vector3d point3_image1(0,0,1);
Vector3d point4_image1(0,0,1);
Vector3d point1_image2(0,0,1);
Vector3d point2_image2(0,0,1);
Vector3d point3_image2(0,0,1);
Vector3d point4_image2(0,0,1);
Vector h(8);
Vector b(8);
Matrix A(8,8);
Matrix invA(8,8);
Matrix3x3 M;
Matrix3x3 invM;
// Variables to store the image width, image height and number of channels
int xres1, yres1, channels1;
int xres2, yres2, channels2;
int xresWarped, yresWarped;
int min_x, min_y, max_x, max_y;
int numberOfArguments = 0;
int counter1 = 4, counter2 = 4;
// Variables to store the output file name and input filenames
string outfilename;
string infilename1;
string infilename2;
const char *filename1;
const char *filename2;
// To store the image data read using OpenImageIO
unsigned char *pixels1;
unsigned char *pixels2;
// Create double pointers of type pixel. Will be used as pixmaps to store image rgba information
pixel **pixmap1;
pixel **pixmap2;
pixel **pixmapWarped;
// Create pointers of type pixel. Will be used to store rgba data in a contiguous block
pixel *data1;
pixel *data2;
pixel *dataWarped;
int maximum(int, int, int, int, int, int, int, int);
int minimum(int, int, int, int, int, int, int, int);
void display1();
void display2();
void display3();
void drawSquare(int, int, int);
void writeImage();
void keyboard(unsigned char, int, int);
void handleMouseClick1(int, int, int, int);
void handleMouseClick2(int, int, int, int);
void CreateGLWindow();
void computeHomographyMatrix();