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
19544b3d
Commit
19544b3d
authored
Nov 15, 2010
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed gpu linear filters
parent
5915e4c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
42 deletions
+21
-42
filters.cu
modules/gpu/src/cuda/filters.cu
+0
-0
filtering.cpp
modules/gpu/src/filtering.cpp
+21
-42
No files found.
modules/gpu/src/cuda/filters.cu
View file @
19544b3d
This diff is collapsed.
Click to expand it.
modules/gpu/src/filtering.cpp
View file @
19544b3d
...
...
@@ -577,34 +577,11 @@ void cv::gpu::filter2D(const GpuMat& src, GpuMat& dst, int ddepth, const Mat& ke
namespace
cv
{
namespace
gpu
{
namespace
filters
{
template
<
int
CN
,
typename
T
,
typename
D
>
template
<
typename
T
,
typename
D
>
void
linearRowFilter_gpu
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
//void linearRowFilter_gpu_8u_8u_c4(const DevMem2D& src, const DevMem2D& dst, const float kernel[], int ksize, int anchor);
void
linearRowFilter_gpu_8u_8s_c4
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_8s_8u_c4
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_8s_8s_c4
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_16u_16u_c2
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_16u_16s_c2
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_16s_16u_c2
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_16s_16s_c2
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_32s_32s_c1
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_32s_32f_c1
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_32f_32s_c1
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearRowFilter_gpu_32f_32f_c1
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_8u_8u_c4
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_8u_8s_c4
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_8s_8u_c4
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_8s_8s_c4
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_16u_16u_c2
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_16u_16s_c2
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_16s_16u_c2
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_16s_16s_c2
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_32s_32s_c1
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_32s_32f_c1
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_32f_32s_c1
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
void
linearColumnFilter_gpu_32f_32f_c1
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
template
<
typename
T
,
typename
D
>
void
linearColumnFilter_gpu
(
const
DevMem2D
&
src
,
const
DevMem2D
&
dst
,
const
float
kernel
[],
int
ksize
,
int
anchor
);
}}}
namespace
...
...
@@ -656,13 +633,12 @@ Ptr<BaseRowFilter_GPU> cv::gpu::getLinearRowFilter_GPU(int srcType, int bufType,
static
const
nppFilter1D_t
nppFilter1D_callers
[]
=
{
0
,
nppiFilterRow_8u_C1R
,
0
,
0
,
nppiFilterRow_8u_C4R
};
static
const
gpuFilter1D_t
gpuFilter1D_callers
[
6
][
6
]
=
{
{
linearRowFilter_gpu
<
4
,
uchar4
,
uchar4
>
/*linearRowFilter_gpu_8u_8u_c4*/
,
linearRowFilter_gpu_8u_8s_c4
,
0
,
0
,
0
,
0
},
{
linearRowFilter_gpu_8s_8u_c4
,
linearRowFilter_gpu_8s_8s_c4
,
0
,
0
,
0
,
0
},
{
0
,
0
,
linearRowFilter_gpu_16u_16u_c2
,
linearRowFilter_gpu_16u_16s_c2
,
0
,
0
},
{
0
,
0
,
linearRowFilter_gpu_16s_16u_c2
,
linearRowFilter_gpu_16s_16s_c2
,
0
,
0
},
{
0
,
0
,
0
,
0
,
linearRowFilter_gpu_32s_32s_c1
,
linearRowFilter_gpu_32s_32f_c1
},
{
0
,
0
,
0
,
0
,
linearRowFilter_gpu_32f_32s_c1
,
linearRowFilter_gpu_32f_32f_c1
}
{
linearRowFilter_gpu
<
uchar4
,
uchar4
>
,
linearRowFilter_gpu
<
uchar4
,
char4
>
,
0
,
0
,
0
,
0
},
{
linearRowFilter_gpu
<
char4
,
uchar4
>
,
linearRowFilter_gpu
<
char4
,
char4
>
,
0
,
0
,
0
,
0
},
{
0
,
0
,
linearRowFilter_gpu
<
ushort2
,
ushort2
>
,
linearRowFilter_gpu
<
ushort2
,
short2
>
,
0
,
0
},
{
0
,
0
,
linearRowFilter_gpu
<
short2
,
ushort2
>
,
linearRowFilter_gpu
<
short2
,
short2
>
,
0
,
0
},
{
0
,
0
,
0
,
0
,
linearRowFilter_gpu
<
int
,
int
>
,
linearRowFilter_gpu
<
int
,
float
>
},
{
0
,
0
,
0
,
0
,
linearRowFilter_gpu
<
float
,
int
>
,
linearRowFilter_gpu
<
float
,
float
>
}
};
if
((
bufType
==
srcType
)
&&
(
srcType
==
CV_8UC1
||
srcType
==
CV_8UC4
))
...
...
@@ -686,6 +662,9 @@ Ptr<BaseRowFilter_GPU> cv::gpu::getLinearRowFilter_GPU(int srcType, int bufType,
Mat
cont_krnl
=
temp
.
reshape
(
1
,
1
);
int
ksize
=
cont_krnl
.
cols
;
CV_Assert
(
ksize
<
16
);
normalizeAnchor
(
anchor
,
ksize
);
return
Ptr
<
BaseRowFilter_GPU
>
(
new
GpuLinearRowFilter
(
ksize
,
anchor
,
cont_krnl
,
...
...
@@ -736,17 +715,14 @@ Ptr<BaseColumnFilter_GPU> cv::gpu::getLinearColumnFilter_GPU(int bufType, int ds
static
const
nppFilter1D_t
nppFilter1D_callers
[]
=
{
0
,
nppiFilterColumn_8u_C1R
,
0
,
0
,
nppiFilterColumn_8u_C4R
};
static
const
gpuFilter1D_t
gpuFilter1D_callers
[
6
][
6
]
=
{
{
linearColumnFilter_gpu
_8u_8u_c4
,
linearColumnFilter_gpu_8u_8s_c4
,
0
,
0
,
0
,
0
},
{
linearColumnFilter_gpu
_8s_8u_c4
,
linearColumnFilter_gpu_8s_8s_c4
,
0
,
0
,
0
,
0
},
{
0
,
0
,
linearColumnFilter_gpu
_16u_16u_c2
,
linearColumnFilter_gpu_16u_16s_c2
,
0
,
0
},
{
0
,
0
,
linearColumnFilter_gpu
_16s_16u_c2
,
linearColumnFilter_gpu_16s_16s_c2
,
0
,
0
},
{
0
,
0
,
0
,
0
,
linearColumnFilter_gpu
_32s_32s_c1
,
linearColumnFilter_gpu_32s_32f_c1
},
{
0
,
0
,
0
,
0
,
linearColumnFilter_gpu
_32f_32s_c1
,
linearColumnFilter_gpu_32f_32f_c1
}
{
linearColumnFilter_gpu
<
uchar4
,
uchar4
>
,
linearColumnFilter_gpu
<
uchar4
,
char4
>
,
0
,
0
,
0
,
0
},
{
linearColumnFilter_gpu
<
char4
,
uchar4
>
,
linearColumnFilter_gpu
<
char4
,
char4
>
,
0
,
0
,
0
,
0
},
{
0
,
0
,
linearColumnFilter_gpu
<
ushort2
,
ushort2
>
,
linearColumnFilter_gpu
<
ushort2
,
short2
>
,
0
,
0
},
{
0
,
0
,
linearColumnFilter_gpu
<
short2
,
ushort2
>
,
linearColumnFilter_gpu
<
short2
,
short2
>
,
0
,
0
},
{
0
,
0
,
0
,
0
,
linearColumnFilter_gpu
<
int
,
int
>
,
linearColumnFilter_gpu
<
int
,
float
>
},
{
0
,
0
,
0
,
0
,
linearColumnFilter_gpu
<
float
,
int
>
,
linearColumnFilter_gpu
<
float
,
float
>
}
};
double
kernelMin
;
minMaxLoc
(
columnKernel
,
&
kernelMin
);
if
((
bufType
==
dstType
)
&&
(
bufType
==
CV_8UC1
||
bufType
==
CV_8UC4
))
{
GpuMat
gpu_col_krnl
;
...
...
@@ -768,6 +744,9 @@ Ptr<BaseColumnFilter_GPU> cv::gpu::getLinearColumnFilter_GPU(int bufType, int ds
Mat
cont_krnl
=
temp
.
reshape
(
1
,
1
);
int
ksize
=
cont_krnl
.
cols
;
CV_Assert
(
ksize
<
16
);
normalizeAnchor
(
anchor
,
ksize
);
return
Ptr
<
BaseColumnFilter_GPU
>
(
new
GpuLinearColumnFilter
(
ksize
,
anchor
,
cont_krnl
,
...
...
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