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
2a385be0
Commit
2a385be0
authored
Aug 10, 2010
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meanShiftFilteringGPU: performance and bug with type conversions
parent
f9cbb36b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
gpu.hpp
modules/gpu/include/opencv2/gpu/gpu.hpp
+1
-1
imgproc.cu
modules/gpu/src/cuda/imgproc.cu
+7
-7
imgproc_gpu.cpp
modules/gpu/src/imgproc_gpu.cpp
+3
-3
No files found.
modules/gpu/include/opencv2/gpu/gpu.hpp
View file @
2a385be0
...
...
@@ -333,7 +333,7 @@ namespace cv
CV_EXPORTS
void
remap
(
const
GpuMat
&
src
,
const
GpuMat
&
xmap
,
const
GpuMat
&
ymap
,
GpuMat
&
dst
);
CV_EXPORTS
void
meanShiftFiltering_GPU
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
float
sp
,
floa
t
sr
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
MAX_ITER
+
TermCriteria
::
EPS
,
5
,
1
));
CV_EXPORTS
void
meanShiftFiltering_GPU
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
sp
,
in
t
sr
,
TermCriteria
criteria
=
TermCriteria
(
TermCriteria
::
MAX_ITER
+
TermCriteria
::
EPS
,
5
,
1
));
//////////////////////////////// StereoBM_GPU ////////////////////////////////
...
...
modules/gpu/src/cuda/imgproc.cu
View file @
2a385be0
...
...
@@ -138,12 +138,12 @@ namespace imgproc
if( count == 0 )
break;
icount = 1./count;
int x1 =
floor
(sx*icount);
int y1 =
floor
(sy*icount);
s0 =
floor
(s0*icount);
s1 =
floor
(s1*icount);
s2 =
floor
(s2*icount);
icount = 1.
f
/count;
int x1 =
__float2int_rz
(sx*icount);
int y1 =
__float2int_rz
(sy*icount);
s0 =
__float2int_rz
(s0*icount);
s1 =
__float2int_rz
(s1*icount);
s2 =
__float2int_rz
(s2*icount);
int norm2 = (s0 - c.x) * (s0 - c.x) + (s1 - c.y) * (s1 - c.y) + (s2 - c.z) * (s2 - c.z);
...
...
@@ -166,7 +166,7 @@ namespace imgproc
namespace cv { namespace gpu { namespace impl
{
extern "C" void meanShiftFiltering_gpu(const DevMem2D& src, DevMem2D dst,
float sp, floa
t sr, int maxIter, float eps)
extern "C" void meanShiftFiltering_gpu(const DevMem2D& src, DevMem2D dst,
int sp, in
t sr, int maxIter, float eps)
{
dim3 grid(1, 1, 1);
dim3 threads(32, 16, 1);
...
...
modules/gpu/src/imgproc_gpu.cpp
View file @
2a385be0
...
...
@@ -48,7 +48,7 @@ using namespace cv::gpu;
#if !defined (HAVE_CUDA)
void
cv
::
gpu
::
remap
(
const
GpuMat
&
/*src*/
,
const
GpuMat
&
/*xmap*/
,
const
GpuMat
&
/*ymap*/
,
GpuMat
&
/*dst*/
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
meanShiftFiltering_GPU
(
const
GpuMat
&
,
GpuMat
&
,
float
,
floa
t
,
TermCriteria
)
{
throw_nogpu
();
}
void
cv
::
gpu
::
meanShiftFiltering_GPU
(
const
GpuMat
&
,
GpuMat
&
,
int
,
in
t
,
TermCriteria
)
{
throw_nogpu
();
}
#else
/* !defined (HAVE_CUDA) */
...
...
@@ -58,7 +58,7 @@ namespace cv { namespace gpu
{
extern
"C"
void
remap_gpu
(
const
DevMem2D
&
src
,
const
DevMem2D_
<
float
>&
xmap
,
const
DevMem2D_
<
float
>&
ymap
,
DevMem2D
dst
);
extern
"C"
void
meanShiftFiltering_gpu
(
const
DevMem2D
&
src
,
DevMem2D
dst
,
float
sp
,
floa
t
sr
,
int
maxIter
,
float
eps
);
extern
"C"
void
meanShiftFiltering_gpu
(
const
DevMem2D
&
src
,
DevMem2D
dst
,
int
sp
,
in
t
sr
,
int
maxIter
,
float
eps
);
}
}}
...
...
@@ -75,7 +75,7 @@ void cv::gpu::remap(const GpuMat& src, const GpuMat& xmap, const GpuMat& ymap, G
void
cv
::
gpu
::
meanShiftFiltering_GPU
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
float
sp
,
floa
t
sr
,
TermCriteria
criteria
)
void
cv
::
gpu
::
meanShiftFiltering_GPU
(
const
GpuMat
&
src
,
GpuMat
&
dst
,
int
sp
,
in
t
sr
,
TermCriteria
criteria
)
{
if
(
src
.
empty
()
)
CV_Error
(
CV_StsBadArg
,
"The input image is empty"
);
...
...
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