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
489a1da0
Commit
489a1da0
authored
Apr 02, 2012
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixeg gpu::Laplacian
parent
b880bbcc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
15 deletions
+12
-15
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+3
-3
filtering.cpp
modules/gpu/src/filtering.cpp
+8
-8
test_filters.cpp
modules/gpu/test/test_filters.cpp
+1
-4
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
489a1da0
...
...
@@ -395,7 +395,7 @@ CV_EXPORTS void GaussianBlur(const GpuMat& src, GpuMat& dst, Size ksize, GpuMat&
//! applies Laplacian operator to the image
//! supports only ksize = 1 and ksize = 3
CV_EXPORTS
void
Laplacian
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
ksize
=
1
,
double
scale
=
1
,
Stream
&
stream
=
Stream
::
Null
());
CV_EXPORTS
void
Laplacian
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
ksize
=
1
,
double
scale
=
1
,
int
borderType
=
BORDER_DEFAULT
,
Stream
&
stream
=
Stream
::
Null
());
////////////////////////////// Arithmetics ///////////////////////////////////
...
...
@@ -1094,8 +1094,8 @@ public:
bool
use_local_init_data_cost
;
private
:
GpuMat
messages_buffers
;
GpuMat
messages_buffers
;
GpuMat
temp
;
GpuMat
out
;
};
...
...
modules/gpu/src/filtering.cpp
View file @
489a1da0
...
...
@@ -87,7 +87,7 @@ void cv::gpu::Scharr(const GpuMat&, GpuMat&, int, int, int, double, int, int) {
void
cv
::
gpu
::
Scharr
(
const
GpuMat
&
,
GpuMat
&
,
int
,
int
,
int
,
GpuMat
&
,
double
,
int
,
int
,
Stream
&
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
GaussianBlur
(
const
GpuMat
&
,
GpuMat
&
,
Size
,
double
,
double
,
int
,
int
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
GaussianBlur
(
const
GpuMat
&
,
GpuMat
&
,
Size
,
GpuMat
&
,
double
,
double
,
int
,
int
,
Stream
&
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
Laplacian
(
const
GpuMat
&
,
GpuMat
&
,
int
,
int
,
double
,
Stream
&
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
Laplacian
(
const
GpuMat
&
,
GpuMat
&
,
int
,
int
,
double
,
int
,
Stream
&
)
{
throw_nogpu
();
}
#else
...
...
@@ -664,8 +664,8 @@ namespace cv { namespace gpu { namespace device
namespace
imgproc
{
template
<
typename
T
,
typename
D
>
void
filter2D_gpu
(
DevMem2Db
srcWhole
,
int
ofsX
,
int
ofsY
,
DevMem2Db
dst
,
int
kWidth
,
int
kHeight
,
int
anchorX
,
int
anchorY
,
const
float
*
kernel
,
void
filter2D_gpu
(
DevMem2Db
srcWhole
,
int
ofsX
,
int
ofsY
,
DevMem2Db
dst
,
int
kWidth
,
int
kHeight
,
int
anchorX
,
int
anchorY
,
const
float
*
kernel
,
int
borderMode
,
const
float
*
borderValue
,
cudaStream_t
stream
);
}
}}}
...
...
@@ -708,14 +708,14 @@ namespace
nppFilter2D_t
func
;
};
typedef
void
(
*
gpuFilter2D_t
)(
DevMem2Db
srcWhole
,
int
ofsX
,
int
ofsY
,
DevMem2Db
dst
,
int
kWidth
,
int
kHeight
,
int
anchorX
,
int
anchorY
,
const
float
*
kernel
,
typedef
void
(
*
gpuFilter2D_t
)(
DevMem2Db
srcWhole
,
int
ofsX
,
int
ofsY
,
DevMem2Db
dst
,
int
kWidth
,
int
kHeight
,
int
anchorX
,
int
anchorY
,
const
float
*
kernel
,
int
borderMode
,
const
float
*
borderValue
,
cudaStream_t
stream
);
struct
GpuFilter2D
:
public
BaseFilter_GPU
{
GpuFilter2D
(
Size
ksize_
,
Point
anchor_
,
gpuFilter2D_t
func_
,
const
GpuMat
&
kernel_
,
int
brd_type_
)
:
BaseFilter_GPU
(
ksize_
,
anchor_
),
func
(
func_
),
kernel
(
kernel_
),
brd_type
(
brd_type_
)
BaseFilter_GPU
(
ksize_
,
anchor_
),
func
(
func_
),
kernel
(
kernel_
),
brd_type
(
brd_type_
)
{
}
...
...
@@ -1193,7 +1193,7 @@ void cv::gpu::Scharr(const GpuMat& src, GpuMat& dst, int ddepth, int dx, int dy,
sepFilter2D
(
src
,
dst
,
ddepth
,
kx
,
ky
,
buf
,
Point
(
-
1
,
-
1
),
rowBorderType
,
columnBorderType
,
stream
);
}
void
cv
::
gpu
::
Laplacian
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
ksize
,
double
scale
,
Stream
&
stream
)
void
cv
::
gpu
::
Laplacian
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
ddepth
,
int
ksize
,
double
scale
,
int
borderType
,
Stream
&
stream
)
{
CV_Assert
(
ksize
==
1
||
ksize
==
3
);
...
...
@@ -1206,7 +1206,7 @@ void cv::gpu::Laplacian(const GpuMat& src, GpuMat& dst, int ddepth, int ksize, d
if
(
scale
!=
1
)
kernel
*=
scale
;
filter2D
(
src
,
dst
,
ddepth
,
kernel
,
Point
(
-
1
,
-
1
),
stream
);
filter2D
(
src
,
dst
,
ddepth
,
kernel
,
Point
(
-
1
,
-
1
),
borderType
,
stream
);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
...
...
modules/gpu/test/test_filters.cpp
View file @
489a1da0
...
...
@@ -334,10 +334,7 @@ TEST_P(Laplacian, Accuracy)
cv
::
Mat
dst_gold
;
cv
::
Laplacian
(
src
,
dst_gold
,
-
1
,
ksize
.
width
);
if
(
type
==
CV_32FC1
)
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
else
EXPECT_MAT_NEAR
(
getInnerROI
(
dst_gold
,
cv
::
Size
(
3
,
3
)),
getInnerROI
(
dst
,
cv
::
Size
(
3
,
3
)),
0.0
);
EXPECT_MAT_NEAR
(
dst_gold
,
dst
,
0.0
);
}
INSTANTIATE_TEST_CASE_P
(
GPU_Filter
,
Laplacian
,
testing
::
Combine
(
...
...
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