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
62a5a70c
Commit
62a5a70c
authored
May 06, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
switched to Input/Output Array in bilateralFilter & blendLinear
parent
de56163f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
21 deletions
+31
-21
gpuimgproc.hpp
modules/gpuimgproc/include/opencv2/gpuimgproc.hpp
+3
-3
bilateral_filter.cpp
modules/gpuimgproc/src/bilateral_filter.cpp
+11
-8
blend.cpp
modules/gpuimgproc/src/blend.cpp
+17
-10
No files found.
modules/gpuimgproc/include/opencv2/gpuimgproc.hpp
View file @
62a5a70c
...
...
@@ -446,15 +446,15 @@ inline void matchTemplate(InputArray image, InputArray templ, OutputArray result
////////////////////////// Bilateral Filter ///////////////////////////
//! Performa bilateral filtering of passsed image
CV_EXPORTS
void
bilateralFilter
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
kernel_size
,
float
sigma_color
,
float
sigma_spatial
,
CV_EXPORTS
void
bilateralFilter
(
InputArray
src
,
OutputArray
dst
,
int
kernel_size
,
float
sigma_color
,
float
sigma_spatial
,
int
borderMode
=
BORDER_DEFAULT
,
Stream
&
stream
=
Stream
::
Null
());
///////////////////////////// Blending ////////////////////////////////
//! performs linear blending of two images
//! to avoid accuracy errors sum of weigths shouldn't be very close to zero
CV_EXPORTS
void
blendLinear
(
const
GpuMat
&
img1
,
const
GpuMat
&
img2
,
const
GpuMat
&
weights1
,
const
GpuMat
&
weights2
,
GpuMat
&
result
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
blendLinear
(
InputArray
img1
,
InputArray
img2
,
InputArray
weights1
,
InputArray
weights2
,
OutputArray
result
,
Stream
&
stream
=
Stream
::
Null
());
}}
// namespace cv { namespace gpu {
...
...
modules/gpuimgproc/src/bilateral_filter.cpp
View file @
62a5a70c
...
...
@@ -47,7 +47,7 @@ using namespace cv::gpu;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
void
cv
::
gpu
::
bilateralFilter
(
const
GpuMat
&
,
GpuMat
&
,
int
,
float
,
float
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
bilateralFilter
(
InputArray
,
OutputArray
,
int
,
float
,
float
,
int
,
Stream
&
)
{
throw_no_cuda
();
}
#else
...
...
@@ -60,7 +60,7 @@ namespace cv { namespace gpu { namespace cudev
}
}}}
void
cv
::
gpu
::
bilateralFilter
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
kernel_size
,
float
sigma_color
,
float
sigma_spatial
,
int
borderMode
,
Stream
&
s
)
void
cv
::
gpu
::
bilateralFilter
(
InputArray
_src
,
OutputArray
_dst
,
int
kernel_size
,
float
sigma_color
,
float
sigma_spatial
,
int
borderMode
,
Stream
&
stream
)
{
using
cv
::
gpu
::
cudev
::
imgproc
::
bilateral_filter_gpu
;
...
...
@@ -79,18 +79,21 @@ void cv::gpu::bilateralFilter(const GpuMat& src, GpuMat& dst, int kernel_size, f
sigma_color
=
(
sigma_color
<=
0
)
?
1
:
sigma_color
;
sigma_spatial
=
(
sigma_spatial
<=
0
)
?
1
:
sigma_spatial
;
int
radius
=
(
kernel_size
<=
0
)
?
cvRound
(
sigma_spatial
*
1.5
)
:
kernel_size
/
2
;
kernel_size
=
std
::
max
(
radius
,
1
)
*
2
+
1
;
CV_Assert
(
src
.
depth
()
<=
CV_32F
&&
src
.
channels
()
<=
4
);
GpuMat
src
=
_src
.
getGpuMat
();
CV_Assert
(
src
.
depth
()
<=
CV_32F
&&
src
.
channels
()
<=
4
);
CV_Assert
(
borderMode
==
BORDER_REFLECT101
||
borderMode
==
BORDER_REPLICATE
||
borderMode
==
BORDER_CONSTANT
||
borderMode
==
BORDER_REFLECT
||
borderMode
==
BORDER_WRAP
);
const
func_t
func
=
funcs
[
src
.
depth
()][
src
.
channels
()
-
1
];
CV_Assert
(
func
!=
0
);
CV_Assert
(
func
!=
0
);
CV_Assert
(
borderMode
==
BORDER_REFLECT101
||
borderMode
==
BORDER_REPLICATE
||
borderMode
==
BORDER_CONSTANT
||
borderMode
==
BORDER_REFLECT
||
borderMode
==
BORDER_WRAP
);
_dst
.
create
(
src
.
size
(),
src
.
type
());
GpuMat
dst
=
_dst
.
getGpuMat
();
dst
.
create
(
src
.
size
(),
src
.
type
());
func
(
src
,
dst
,
kernel_size
,
sigma_spatial
,
sigma_color
,
borderMode
,
StreamAccessor
::
getStream
(
s
));
func
(
src
,
dst
,
kernel_size
,
sigma_spatial
,
sigma_color
,
borderMode
,
StreamAccessor
::
getStream
(
stream
));
}
#endif
modules/gpuimgproc/src/blend.cpp
View file @
62a5a70c
...
...
@@ -47,7 +47,7 @@ using namespace cv::gpu;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
void
cv
::
gpu
::
blendLinear
(
const
GpuMat
&
,
const
GpuMat
&
,
const
GpuMat
&
,
const
GpuMat
&
,
GpuMat
&
,
Stream
&
)
{
throw_no_cuda
();
}
void
cv
::
gpu
::
blendLinear
(
InputArray
,
InputArray
,
InputArray
,
InputArray
,
OutputArray
,
Stream
&
)
{
throw_no_cuda
();
}
#else
...
...
@@ -67,21 +67,28 @@ namespace cv { namespace gpu { namespace cudev
using
namespace
::
cv
::
gpu
::
cudev
::
blend
;
void
cv
::
gpu
::
blendLinear
(
const
GpuMat
&
img1
,
const
GpuMat
&
img2
,
const
GpuMat
&
weights1
,
const
GpuMat
&
weights2
,
GpuMat
&
result
,
Stream
&
stream
)
void
cv
::
gpu
::
blendLinear
(
InputArray
_img1
,
InputArray
_img2
,
InputArray
_weights1
,
InputArray
_
weights2
,
OutputArray
_
result
,
Stream
&
stream
)
{
CV_Assert
(
img1
.
size
()
==
img2
.
size
());
CV_Assert
(
img1
.
type
()
==
img2
.
type
());
CV_Assert
(
weights1
.
size
()
==
img1
.
size
());
CV_Assert
(
weights2
.
size
()
==
img2
.
size
());
CV_Assert
(
weights1
.
type
()
==
CV_32F
);
CV_Assert
(
weights2
.
type
()
==
CV_32F
);
GpuMat
img1
=
_img1
.
getGpuMat
();
GpuMat
img2
=
_img2
.
getGpuMat
();
GpuMat
weights1
=
_weights1
.
getGpuMat
();
GpuMat
weights2
=
_weights2
.
getGpuMat
();
CV_Assert
(
img1
.
size
()
==
img2
.
size
()
);
CV_Assert
(
img1
.
type
()
==
img2
.
type
()
);
CV_Assert
(
weights1
.
size
()
==
img1
.
size
()
);
CV_Assert
(
weights2
.
size
()
==
img2
.
size
()
);
CV_Assert
(
weights1
.
type
()
==
CV_32FC1
);
CV_Assert
(
weights2
.
type
()
==
CV_32FC1
);
const
Size
size
=
img1
.
size
();
const
int
depth
=
img1
.
depth
();
const
int
cn
=
img1
.
channels
();
result
.
create
(
size
,
CV_MAKE_TYPE
(
depth
,
cn
));
_result
.
create
(
size
,
CV_MAKE_TYPE
(
depth
,
cn
));
GpuMat
result
=
_result
.
getGpuMat
();
switch
(
depth
)
{
...
...
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