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
dbb5993d
Commit
dbb5993d
authored
Jul 29, 2014
by
Elena Gvozdeva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added dft for all platforms
parent
dc3c691c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
templmatch.cpp
modules/imgproc/src/templmatch.cpp
+2
-6
No files found.
modules/imgproc/src/templmatch.cpp
View file @
dbb5993d
...
@@ -110,12 +110,8 @@ static bool sumTemplate(InputArray _src, UMat & result)
...
@@ -110,12 +110,8 @@ static bool sumTemplate(InputArray _src, UMat & result)
static
bool
useNaive
(
Size
size
)
static
bool
useNaive
(
Size
size
)
{
{
if
(
!
ocl
::
Device
::
getDefault
().
isIntel
())
return
true
;
int
dft_size
=
18
;
int
dft_size
=
18
;
return
size
.
height
<
dft_size
&&
size
.
width
<
dft_size
;
return
size
.
height
<
dft_size
&&
size
.
width
<
dft_size
;
}
}
struct
ConvolveBuf
struct
ConvolveBuf
...
@@ -138,7 +134,7 @@ void ConvolveBuf::create(Size image_size, Size templ_size)
...
@@ -138,7 +134,7 @@ void ConvolveBuf::create(Size image_size, Size templ_size)
const
double
blockScale
=
4.5
;
const
double
blockScale
=
4.5
;
const
int
minBlockSize
=
256
;
const
int
minBlockSize
=
256
;
block_size
.
width
=
cvRound
(
result_size
.
width
*
blockScale
);
block_size
.
width
=
cvRound
(
result_size
.
width
*
blockScale
);
block_size
.
width
=
MAX
(
block_size
.
width
,
minBlockSize
-
templ_size
.
width
+
1
);
block_size
.
width
=
MAX
(
block_size
.
width
,
minBlockSize
-
templ_size
.
width
+
1
);
block_size
.
width
=
std
::
min
(
block_size
.
width
,
result_size
.
width
);
block_size
.
width
=
std
::
min
(
block_size
.
width
,
result_size
.
width
);
...
@@ -175,7 +171,7 @@ static bool convolve_dft(InputArray _image, InputArray _templ, OutputArray _resu
...
@@ -175,7 +171,7 @@ static bool convolve_dft(InputArray _image, InputArray _templ, OutputArray _resu
ConvolveBuf
buf
;
ConvolveBuf
buf
;
CV_Assert
(
_image
.
type
()
==
CV_32F
);
CV_Assert
(
_image
.
type
()
==
CV_32F
);
CV_Assert
(
_templ
.
type
()
==
CV_32F
);
CV_Assert
(
_templ
.
type
()
==
CV_32F
);
buf
.
create
(
_image
.
size
(),
_templ
.
size
());
buf
.
create
(
_image
.
size
(),
_templ
.
size
());
_result
.
create
(
buf
.
result_size
,
CV_32F
);
_result
.
create
(
buf
.
result_size
,
CV_32F
);
...
...
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