-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathperspectiveTransform.hpp
40 lines (30 loc) · 1.04 KB
/
perspectiveTransform.hpp
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
#ifndef __perspectiveTransform__
#define __perspectiveTransform__
#include <stdlib.h>
#include <math.h>
#ifndef __perspectiveTransform
#define __extern extern
#else
#define __extern
#endif
#ifndef cimg_version
#define cimg_use_tiff
#define cimg_display 0
#include <CImg.h>
using namespace cimg_library;
#endif
typedef struct ptPoint {
float x;
float y;
} ptPoint;
// public
__extern double *getPerspectiveTransform(ptPoint *P);
__extern void perspectiveTransformImage(CImg<unsigned char> *src,CImg<unsigned char> *dst,ptPoint *map,double *H);
__extern void perspectiveTransform(CImg<unsigned char> *img,ptPoint *I,double *H);
__extern void inversePerspectiveTransform(CImg<unsigned char> *img,ptPoint *I,double *H);
__extern void inversePerspectiveTransformImage(CImg<unsigned char> *src,CImg<unsigned char> *dst,ptPoint *map,double *H,bool transparentPixelsOnly);
// private
__extern void projective_mapping(double *u, double *v, double *H);
__extern void inverse_projective_mapping(double *x, double *y, double *H);
#undef __extern
#endif