forked from hybridgroup/gocv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arithm.cpp
148 lines (129 loc) · 3.62 KB
/
arithm.cpp
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#include "../core.h"
#include "arithm.h"
#include <string.h>
void GpuAbs(GpuMat src, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::abs(*src, *dst);
return;
}
cv::cuda::abs(*src, *dst, *s);
}
void GpuAbsDiff(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::absdiff(*src1, *src2, *dst);
return;
}
cv::cuda::absdiff(*src1, *src2, *dst, *s);
}
void GpuAdd(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::add(*src1, *src2, *dst);
return;
}
cv::cuda::add(*src1, *src2, *dst, cv::noArray(), -1, *s);
}
void GpuBitwiseAnd(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::bitwise_and(*src1, *src2, *dst);
return;
}
cv::cuda::bitwise_and(*src1, *src2, *dst, cv::noArray(), *s);
}
void GpuBitwiseNot(GpuMat src, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::bitwise_not(*src, *dst);
return;
}
cv::cuda::bitwise_not(*src, *dst, cv::noArray(), *s);
}
void GpuBitwiseOr(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::bitwise_or(*src1, *src2, *dst);
return;
}
cv::cuda::bitwise_or(*src1, *src2, *dst, cv::noArray(), *s);
}
void GpuBitwiseXor(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::bitwise_xor(*src1, *src2, *dst);
return;
}
cv::cuda::bitwise_xor(*src1, *src2, *dst, cv::noArray(), *s);
}
void GpuDivide(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::divide(*src1, *src2, *dst);
return;
}
cv::cuda::divide(*src1, *src2, *dst, 1, -1, *s);
}
void GpuExp(GpuMat src, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::exp(*src, *dst);
return;
}
cv::cuda::exp(*src, *dst, *s);
}
void GpuLog(GpuMat src, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::log(*src, *dst);
return;
}
cv::cuda::log(*src, *dst, *s);
}
void GpuMax(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::max(*src1, *src2, *dst);
return;
}
cv::cuda::max(*src1, *src2, *dst, *s);
}
void GpuMin(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::min(*src1, *src2, *dst);
return;
}
cv::cuda::min(*src1, *src2, *dst, *s);
}
void GpuMultiply(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::multiply(*src1, *src2, *dst);
return;
}
cv::cuda::multiply(*src1, *src2, *dst, 1, -1, *s);
}
void GpuSqr(GpuMat src, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::sqr(*src, *dst);
return;
}
cv::cuda::sqr(*src, *dst, *s);
}
void GpuSqrt(GpuMat src, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::sqrt(*src, *dst);
return;
}
cv::cuda::sqrt(*src, *dst, *s);
}
void GpuSubtract(GpuMat src1, GpuMat src2, GpuMat dst, Stream s) {
if (s == NULL) {
cv::cuda::subtract(*src1, *src2, *dst);
return;
}
cv::cuda::subtract(*src1, *src2, *dst, cv::noArray(), -1, *s);
}
void GpuThreshold(GpuMat src, GpuMat dst, double thresh, double maxval, int typ, Stream s) {
if (s == NULL) {
cv::cuda::threshold(*src, *dst, thresh, maxval, typ);
return;
}
cv::cuda::threshold(*src, *dst, thresh, maxval, typ, *s);
}
void GpuFlip(GpuMat src, GpuMat dst, int flipCode, Stream s) {
if (s == NULL) {
cv::cuda::flip(*src, *dst, flipCode);
return;
}
cv::cuda::flip(*src, *dst, flipCode, *s);
}