Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
f17a6b47
Commit
f17a6b47
authored
Aug 04, 2019
by
Evgeny Latkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GAPI: use plain-C interface to math functions, sin/cos, etc.
- addresses #15163: C++11 definition issue by @neheb
parent
f18cbd03
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
+16
-13
core.hpp
modules/gapi/include/opencv2/gapi/core.hpp
+4
-2
saturate.hpp
modules/gapi/include/opencv2/gapi/own/saturate.hpp
+5
-5
gfluidcore.cpp
modules/gapi/src/backends/fluid/gfluidcore.cpp
+7
-6
No files found.
modules/gapi/include/opencv2/gapi/core.hpp
View file @
f17a6b47
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
#ifndef OPENCV_GAPI_CORE_HPP
#ifndef OPENCV_GAPI_CORE_HPP
#define OPENCV_GAPI_CORE_HPP
#define OPENCV_GAPI_CORE_HPP
#include <math.h>
#include <utility> // std::tuple
#include <utility> // std::tuple
#include <opencv2/imgproc.hpp>
#include <opencv2/imgproc.hpp>
...
@@ -392,8 +394,8 @@ namespace core {
...
@@ -392,8 +394,8 @@ namespace core {
{
{
GAPI_Assert
(
fx
!=
0.
&&
fy
!=
0.
);
GAPI_Assert
(
fx
!=
0.
&&
fy
!=
0.
);
return
in
.
withSize
return
in
.
withSize
(
Size
(
static_cast
<
int
>
(
std
::
round
(
in
.
size
.
width
*
fx
)),
(
Size
(
static_cast
<
int
>
(
round
(
in
.
size
.
width
*
fx
)),
static_cast
<
int
>
(
std
::
round
(
in
.
size
.
height
*
fy
))));
static_cast
<
int
>
(
round
(
in
.
size
.
height
*
fy
))));
}
}
}
}
};
};
...
...
modules/gapi/include/opencv2/gapi/own/saturate.hpp
View file @
f17a6b47
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#ifndef OPENCV_GAPI_OWN_SATURATE_HPP
#ifndef OPENCV_GAPI_OWN_SATURATE_HPP
#define OPENCV_GAPI_OWN_SATURATE_HPP
#define OPENCV_GAPI_OWN_SATURATE_HPP
#include <
cmat
h>
#include <
math.
h>
#include <limits>
#include <limits>
#include <type_traits>
#include <type_traits>
...
@@ -79,10 +79,10 @@ static inline DST saturate(SRC x, R round)
...
@@ -79,10 +79,10 @@ static inline DST saturate(SRC x, R round)
}
}
// explicit suffix 'd' for double type
// explicit suffix 'd' for double type
inline
double
ceild
(
double
x
)
{
return
std
::
ceil
(
x
);
}
inline
double
ceild
(
double
x
)
{
return
ceil
(
x
);
}
inline
double
floord
(
double
x
)
{
return
std
::
floor
(
x
);
}
inline
double
floord
(
double
x
)
{
return
floor
(
x
);
}
inline
double
roundd
(
double
x
)
{
return
std
::
round
(
x
);
}
inline
double
roundd
(
double
x
)
{
return
round
(
x
);
}
inline
double
rintd
(
double
x
)
{
return
std
::
rint
(
x
);
}
inline
double
rintd
(
double
x
)
{
return
rint
(
x
);
}
}
//namespace own
}
//namespace own
}
//namespace gapi
}
//namespace gapi
...
...
modules/gapi/src/backends/fluid/gfluidcore.cpp
View file @
f17a6b47
...
@@ -23,8 +23,9 @@
...
@@ -23,8 +23,9 @@
#include "gfluidbackend.hpp"
#include "gfluidbackend.hpp"
#include "gfluidutils.hpp"
#include "gfluidutils.hpp"
#include <math.h>
#include <cassert>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstdlib>
namespace
cv
{
namespace
cv
{
...
@@ -389,7 +390,7 @@ static void run_arithm_s1(uchar out[], const float in[], int width, const float
...
@@ -389,7 +390,7 @@ static void run_arithm_s1(uchar out[], const float in[], int width, const float
cv
::
util
::
suppress_unused_warning
(
v_op
);
cv
::
util
::
suppress_unused_warning
(
v_op
);
for
(;
w
<
width
;
w
++
)
for
(;
w
<
width
;
w
++
)
{
{
out
[
w
]
=
saturate
<
uchar
>
(
s_op
(
in
[
w
],
scalar
[
0
]),
std
::
roundf
);
out
[
w
]
=
saturate
<
uchar
>
(
s_op
(
in
[
w
],
scalar
[
0
]),
roundf
);
}
}
}
}
...
@@ -1920,8 +1921,8 @@ GAPI_FLUID_KERNEL(GFluidPolarToCart, cv::gapi::core::GPolarToCart, false)
...
@@ -1920,8 +1921,8 @@ GAPI_FLUID_KERNEL(GFluidPolarToCart, cv::gapi::core::GPolarToCart, false)
in2
[
l
]
*
static_cast
<
float
>
(
CV_PI
/
180
)
:
in2
[
l
]
*
static_cast
<
float
>
(
CV_PI
/
180
)
:
in2
[
l
];
in2
[
l
];
float
magnitude
=
in1
[
l
];
float
magnitude
=
in1
[
l
];
float
x
=
magnitude
*
std
::
cos
(
angle
);
float
x
=
magnitude
*
cosf
(
angle
);
float
y
=
magnitude
*
s
td
::
sin
(
angle
);
float
y
=
magnitude
*
s
inf
(
angle
);
out1
[
l
]
=
x
;
out1
[
l
]
=
x
;
out2
[
l
]
=
y
;
out2
[
l
]
=
y
;
}
}
...
@@ -1954,8 +1955,8 @@ GAPI_FLUID_KERNEL(GFluidCartToPolar, cv::gapi::core::GCartToPolar, false)
...
@@ -1954,8 +1955,8 @@ GAPI_FLUID_KERNEL(GFluidCartToPolar, cv::gapi::core::GCartToPolar, false)
{
{
float
x
=
in1
[
l
];
float
x
=
in1
[
l
];
float
y
=
in2
[
l
];
float
y
=
in2
[
l
];
float
magnitude
=
std
::
hypot
(
y
,
x
);
float
magnitude
=
hypotf
(
y
,
x
);
float
angle_rad
=
std
::
atan2
(
y
,
x
);
float
angle_rad
=
atan2f
(
y
,
x
);
float
angle
=
angleInDegrees
?
float
angle
=
angleInDegrees
?
angle_rad
*
static_cast
<
float
>
(
180
/
CV_PI
)
:
angle_rad
*
static_cast
<
float
>
(
180
/
CV_PI
)
:
angle_rad
;
angle_rad
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment