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
c26b0053
Commit
c26b0053
authored
Sep 05, 2011
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimized gpu::remap (use texture memory if possible), added stream support to gpu::remap
parent
b2d5839a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+2
-1
imgproc.cu
modules/gpu/src/cuda/imgproc.cu
+0
-0
imgproc.cpp
modules/gpu/src/imgproc.cpp
+8
-5
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
c26b0053
...
...
@@ -599,7 +599,8 @@ namespace cv
//! DST[x,y] = SRC[xmap[x,y],ymap[x,y]] with bilinear interpolation.
//! supports CV_32FC1 map type
CV_EXPORTS
void
remap
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
GpuMat
&
xmap
,
const
GpuMat
&
ymap
,
int
interpolation
,
int
borderMode
=
BORDER_CONSTANT
,
const
Scalar
&
borderValue
=
Scalar
());
int
interpolation
,
int
borderMode
=
BORDER_CONSTANT
,
const
Scalar
&
borderValue
=
Scalar
(),
Stream
&
stream
=
Stream
::
Null
());
//! Does mean shift filtering on GPU.
CV_EXPORTS
void
meanShiftFiltering
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
sp
,
int
sr
,
...
...
modules/gpu/src/cuda/imgproc.cu
View file @
c26b0053
This diff is collapsed.
Click to expand it.
modules/gpu/src/imgproc.cpp
View file @
c26b0053
...
...
@@ -47,7 +47,7 @@ using namespace cv::gpu;
#if !defined (HAVE_CUDA)
void
cv
::
gpu
::
remap
(
const
GpuMat
&
,
GpuMat
&
,
const
GpuMat
&
,
const
GpuMat
&
,
int
,
int
,
const
Scalar
&
){
throw_nogpu
();
}
void
cv
::
gpu
::
remap
(
const
GpuMat
&
,
GpuMat
&
,
const
GpuMat
&
,
const
GpuMat
&
,
int
,
int
,
const
Scalar
&
,
Stream
&
){
throw_nogpu
();
}
void
cv
::
gpu
::
meanShiftFiltering
(
const
GpuMat
&
,
GpuMat
&
,
int
,
int
,
TermCriteria
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
meanShiftProc
(
const
GpuMat
&
,
GpuMat
&
,
GpuMat
&
,
int
,
int
,
TermCriteria
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
drawColorDisp
(
const
GpuMat
&
,
GpuMat
&
,
int
,
Stream
&
)
{
throw_nogpu
();
}
...
...
@@ -110,14 +110,14 @@ void cv::gpu::CannyBuf::release() { throw_nogpu(); }
namespace
cv
{
namespace
gpu
{
namespace
imgproc
{
template
<
typename
T
>
void
remap_gpu
(
const
DevMem2D
&
src
,
const
DevMem2Df
&
xmap
,
const
DevMem2Df
&
ymap
,
const
DevMem2D
&
dst
,
int
interpolation
,
int
borderMode
,
const
double
borderValue
[
4
]
);
int
interpolation
,
int
borderMode
,
const
float
*
borderValue
,
cudaStream_t
stream
);
}}}
void
cv
::
gpu
::
remap
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
GpuMat
&
xmap
,
const
GpuMat
&
ymap
,
int
interpolation
,
int
borderMode
,
const
Scalar
&
borderValue
)
void
cv
::
gpu
::
remap
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
const
GpuMat
&
xmap
,
const
GpuMat
&
ymap
,
int
interpolation
,
int
borderMode
,
const
Scalar
&
borderValue
,
Stream
&
stream
)
{
using
namespace
cv
::
gpu
::
imgproc
;
typedef
void
(
*
caller_t
)(
const
DevMem2D
&
src
,
const
DevMem2Df
&
xmap
,
const
DevMem2Df
&
ymap
,
const
DevMem2D
&
dst
,
int
interpolation
,
int
borderMode
,
const
double
borderValue
[
4
]);
;
typedef
void
(
*
caller_t
)(
const
DevMem2D
&
src
,
const
DevMem2Df
&
xmap
,
const
DevMem2Df
&
ymap
,
const
DevMem2D
&
dst
,
int
interpolation
,
int
borderMode
,
const
float
*
borderValue
,
cudaStream_t
stream
)
;
static
const
caller_t
callers
[
6
][
4
]
=
{
{
remap_gpu
<
uchar
>
,
remap_gpu
<
uchar2
>
,
remap_gpu
<
uchar3
>
,
remap_gpu
<
uchar4
>
},
...
...
@@ -138,8 +138,11 @@ void cv::gpu::remap(const GpuMat& src, GpuMat& dst, const GpuMat& xmap, const Gp
CV_Assert
(
tryConvertToGpuBorderType
(
borderMode
,
gpuBorderType
));
dst
.
create
(
xmap
.
size
(),
src
.
type
());
Scalar_
<
float
>
borderValueFloat
;
borderValueFloat
=
borderValue
;
callers
[
src
.
depth
()][
src
.
channels
()
-
1
](
src
,
xmap
,
ymap
,
dst
,
interpolation
,
gpuBorderType
,
borderValue
.
val
);
callers
[
src
.
depth
()][
src
.
channels
()
-
1
](
src
,
xmap
,
ymap
,
dst
,
interpolation
,
gpuBorderType
,
borderValue
Float
.
val
,
StreamAccessor
::
getStream
(
stream
)
);
}
////////////////////////////////////////////////////////////////////////
...
...
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