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
18ce0dff
Commit
18ce0dff
authored
Jan 25, 2012
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug #1552
parent
4f86af7e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
templmatch.cpp
modules/imgproc/src/templmatch.cpp
+9
-2
No files found.
modules/imgproc/src/templmatch.cpp
View file @
18ce0dff
...
...
@@ -44,7 +44,7 @@
namespace
cv
{
void
crossCorr
(
const
Mat
&
img
,
const
Mat
&
templ
,
Mat
&
corr
,
void
crossCorr
(
const
Mat
&
img
,
const
Mat
&
_
templ
,
Mat
&
corr
,
Size
corrsize
,
int
ctype
,
Point
anchor
,
double
delta
,
int
borderType
)
{
...
...
@@ -52,14 +52,21 @@ void crossCorr( const Mat& img, const Mat& templ, Mat& corr,
const
int
minBlockSize
=
256
;
std
::
vector
<
uchar
>
buf
;
Mat
templ
=
_templ
;
int
depth
=
img
.
depth
(),
cn
=
img
.
channels
();
int
tdepth
=
templ
.
depth
(),
tcn
=
templ
.
channels
();
int
cdepth
=
CV_MAT_DEPTH
(
ctype
),
ccn
=
CV_MAT_CN
(
ctype
);
CV_Assert
(
img
.
dims
<=
2
&&
templ
.
dims
<=
2
&&
corr
.
dims
<=
2
);
CV_Assert
(
depth
==
CV_8U
||
depth
==
CV_16U
||
depth
==
CV_32F
||
depth
==
CV_64F
);
CV_Assert
(
depth
==
tdepth
||
tdepth
==
CV_32F
);
if
(
depth
!=
tdepth
&&
tdepth
!=
std
::
max
(
CV_32F
,
depth
)
)
{
_templ
.
convertTo
(
templ
,
std
::
max
(
CV_32F
,
depth
));
tdepth
=
templ
.
depth
();
}
CV_Assert
(
depth
==
tdepth
||
tdepth
==
CV_32F
);
CV_Assert
(
corrsize
.
height
<=
img
.
rows
+
templ
.
rows
-
1
&&
corrsize
.
width
<=
img
.
cols
+
templ
.
cols
-
1
);
...
...
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