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
e844c082
Commit
e844c082
authored
Feb 01, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some fixes and improvements in cv::matchTemplate
parent
02692f9a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
15 deletions
+13
-15
ocl_defs.hpp
modules/core/include/opencv2/core/opencl/ocl_defs.hpp
+0
-2
perf_matchTemplate.cpp
modules/imgproc/perf/opencl/perf_matchTemplate.cpp
+0
-0
match_template.cl
modules/imgproc/src/opencl/match_template.cl
+2
-2
templmatch.cpp
modules/imgproc/src/templmatch.cpp
+0
-0
test_match_template.cpp
modules/imgproc/test/ocl/test_match_template.cpp
+11
-11
No files found.
modules/core/include/opencv2/core/opencl/ocl_defs.hpp
View file @
e844c082
...
...
@@ -5,8 +5,6 @@
// Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
#define CV_OPENCL_RUN_ASSERT
#ifdef HAVE_OPENCL
#ifdef CV_OPENCL_RUN_VERBOSE
...
...
modules/imgproc/perf/opencl/perf_matchTemplate.cpp
View file @
e844c082
modules/imgproc/src/opencl/match_template.cl
View file @
e844c082
...
...
@@ -98,7 +98,7 @@ __kernel void matchTemplate_Naive_CCORR (__global const uchar * img,int img_step
__kernel
void
matchTemplate_CCORR_NORMED
(
__global
const
uchar
*
img_sqsums,
int
img_sqsums_step,
int
img_sqsums_offset,
__global
uchar
*
res,
int
res_step,
int
res_offset,
int
res_rows,
int
res_cols,
int
tpl_rows,
int
tpl_cols,
ulong
tpl_sqsum
)
int
tpl_rows,
int
tpl_cols,
float
tpl_sqsum
)
{
int
gidx
=
get_global_id
(
0
)
;
int
gidy
=
get_global_id
(
1
)
;
...
...
@@ -157,7 +157,7 @@ __kernel void matchTemplate_Naive_SQDIFF(__global const uchar * img,int img_step
__kernel
void
matchTemplate_SQDIFF_NORMED
(
__global
const
uchar
*
img_sqsums,
int
img_sqsums_step,
int
img_sqsums_offset,
__global
uchar
*
res,
int
res_step,
int
res_offset,
int
res_rows,
int
res_cols,
int
tpl_rows,
int
tpl_cols,
ulong
tpl_sqsum
)
int
tpl_rows,
int
tpl_cols,
float
tpl_sqsum
)
{
int
gidx
=
get_global_id
(
0
)
;
int
gidy
=
get_global_id
(
1
)
;
...
...
modules/imgproc/src/templmatch.cpp
View file @
e844c082
This diff is collapsed.
Click to expand it.
modules/imgproc/test/ocl/test_match_template.cpp
View file @
e844c082
...
...
@@ -51,9 +51,12 @@
namespace
cvtest
{
namespace
ocl
{
/////////////////////////////////////////////
matchTemplate
//////////////////////////////////////////////////////////
/////////////////////////////////////////////
matchTemplate
//////////////////////////////////////////////////////////
PARAM_TEST_CASE
(
MatchTemplate
,
MatDepth
,
Channels
,
int
,
bool
)
CV_ENUM
(
MatchTemplType
,
CV_TM_SQDIFF
,
CV_TM_SQDIFF_NORMED
,
CV_TM_CCORR
,
CV_TM_CCORR_NORMED
,
CV_TM_CCOEFF
,
CV_TM_CCOEFF_NORMED
)
PARAM_TEST_CASE
(
MatchTemplate
,
MatDepth
,
Channels
,
MatchTemplType
,
bool
)
{
int
type
;
int
depth
;
...
...
@@ -88,7 +91,7 @@ PARAM_TEST_CASE(MatchTemplate, MatDepth, Channels, int, bool)
randomSubMat
(
templ
,
templ_roi
,
templ_roiSize
,
templBorder
,
type
,
-
upValue
,
upValue
);
Border
resultBorder
=
randomBorder
(
0
,
use_roi
?
MAX_VALUE
:
0
);
randomSubMat
(
result
,
result_roi
,
result_roiSize
,
resultBorder
,
CV_32F
,
-
upValue
,
upValue
);
randomSubMat
(
result
,
result_roi
,
result_roiSize
,
resultBorder
,
CV_32F
C1
,
-
upValue
,
upValue
);
UMAT_UPLOAD_INPUT_PARAMETER
(
image
)
UMAT_UPLOAD_INPUT_PARAMETER
(
templ
)
...
...
@@ -97,7 +100,7 @@ PARAM_TEST_CASE(MatchTemplate, MatDepth, Channels, int, bool)
void
Near
(
double
threshold
=
0.0
)
{
OCL_EXPECT_MATS_NEAR
(
result
,
threshold
);
OCL_EXPECT_MATS_NEAR
_RELATIVE
(
result
,
threshold
);
}
};
...
...
@@ -107,20 +110,17 @@ OCL_TEST_P(MatchTemplate, Mat)
{
generateTestData
();
OCL_OFF
(
cv
::
matchTemplate
(
image_roi
,
templ_roi
,
result_roi
,
method
));
OCL_ON
(
cv
::
matchTemplate
(
uimage_roi
,
utempl_roi
,
uresult_roi
,
method
));
OCL_OFF
(
cv
::
matchTemplate
(
image_roi
,
templ_roi
,
result_roi
,
method
));
OCL_ON
(
cv
::
matchTemplate
(
uimage_roi
,
utempl_roi
,
uresult_roi
,
method
));
if
(
method
==
0
)
Near
(
10.0
f
);
else
Near
(
method
%
2
==
1
?
0.001
f
:
1.0
f
);
Near
(
1.5e-4
);
}
}
OCL_INSTANTIATE_TEST_CASE_P
(
ImageProc
,
MatchTemplate
,
Combine
(
Values
(
CV_8U
,
CV_32F
),
Values
(
1
,
2
,
4
),
Values
(
0
,
1
,
2
,
3
,
4
,
5
),
MatchTemplType
::
all
(
),
Bool
())
);
}
}
// namespace cvtest::ocl
...
...
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