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
10cb6602
Commit
10cb6602
authored
Apr 15, 2014
by
Alexander Karsakov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed condition
parent
53bc9373
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
perf_corners.cpp
modules/imgproc/perf/perf_corners.cpp
+3
-3
corner.cpp
modules/imgproc/src/corner.cpp
+17
-7
No files found.
modules/imgproc/perf/perf_corners.cpp
View file @
10cb6602
...
@@ -35,7 +35,7 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris,
...
@@ -35,7 +35,7 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris,
TEST_CYCLE
()
cornerHarris
(
src
,
dst
,
blockSize
,
apertureSize
,
k
,
borderType
);
TEST_CYCLE
()
cornerHarris
(
src
,
dst
,
blockSize
,
apertureSize
,
k
,
borderType
);
SANITY_CHECK
(
dst
,
2e-5
);
SANITY_CHECK
(
dst
,
2e-5
,
ERROR_RELATIVE
);
}
}
typedef
std
::
tr1
::
tuple
<
string
,
int
,
int
,
BorderType
>
Img_BlockSize_ApertureSize_BorderType_t
;
typedef
std
::
tr1
::
tuple
<
string
,
int
,
int
,
BorderType
>
Img_BlockSize_ApertureSize_BorderType_t
;
...
@@ -66,7 +66,7 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerEigenValsAndVecs,
...
@@ -66,7 +66,7 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerEigenValsAndVecs,
Mat
l1
;
Mat
l1
;
extractChannel
(
dst
,
l1
,
0
);
extractChannel
(
dst
,
l1
,
0
);
SANITY_CHECK
(
l1
,
2e-5
);
SANITY_CHECK
(
l1
,
2e-5
,
ERROR_RELATIVE
);
}
}
PERF_TEST_P
(
Img_BlockSize_ApertureSize_BorderType
,
cornerMinEigenVal
,
PERF_TEST_P
(
Img_BlockSize_ApertureSize_BorderType
,
cornerMinEigenVal
,
...
@@ -91,5 +91,5 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerMinEigenVal,
...
@@ -91,5 +91,5 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerMinEigenVal,
TEST_CYCLE
()
cornerMinEigenVal
(
src
,
dst
,
blockSize
,
apertureSize
,
borderType
);
TEST_CYCLE
()
cornerMinEigenVal
(
src
,
dst
,
blockSize
,
apertureSize
,
borderType
);
SANITY_CHECK
(
dst
,
2e-5
);
SANITY_CHECK
(
dst
,
2e-5
,
ERROR_RELATIVE
);
}
}
modules/imgproc/src/corner.cpp
View file @
10cb6602
...
@@ -464,8 +464,20 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
...
@@ -464,8 +464,20 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
#if defined(HAVE_IPP) && (IPP_VERSION_MAJOR >= 8)
#if defined(HAVE_IPP) && (IPP_VERSION_MAJOR >= 8)
typedef
IppStatus
(
CV_STDCALL
*
ippiMinEigenValGetBufferSize
)(
IppiSize
,
int
,
int
,
int
*
);
typedef
IppStatus
(
CV_STDCALL
*
ippiMinEigenValGetBufferSize
)(
IppiSize
,
int
,
int
,
int
*
);
typedef
IppStatus
(
CV_STDCALL
*
ippiMinEigenVal
)(
const
void
*
,
int
,
Ipp32f
*
,
int
,
IppiSize
,
IppiKernelType
,
int
,
int
,
Ipp8u
*
);
typedef
IppStatus
(
CV_STDCALL
*
ippiMinEigenVal
)(
const
void
*
,
int
,
Ipp32f
*
,
int
,
IppiSize
,
IppiKernelType
,
int
,
int
,
Ipp8u
*
);
IppiKernelType
kerType
;
if
(
borderType
==
BORDER_REPLICATE
&&
!
src
.
isSubmatrix
())
int
kerSize
=
ksize
;
if
(
ksize
<
0
)
{
kerType
=
ippKernelScharr
;
kerSize
=
3
;
}
else
{
kerType
=
ippKernelSobel
;
}
bool
isolated
=
(
borderType
&
BORDER_ISOLATED
)
!=
0
;
int
borderTypeNI
=
borderType
&
~
BORDER_ISOLATED
;
if
((
borderTypeNI
==
BORDER_REPLICATE
&&
(
!
src
.
isSubmatrix
()
||
isolated
))
&&
(
kerSize
==
3
||
kerSize
==
5
)
&&
(
kerSize
==
3
||
blockSize
==
5
))
{
{
ippiMinEigenValGetBufferSize
getBufferSizeFunc
=
0
;
ippiMinEigenValGetBufferSize
getBufferSizeFunc
=
0
;
ippiMinEigenVal
minEigenValFunc
=
0
;
ippiMinEigenVal
minEigenValFunc
=
0
;
...
@@ -475,7 +487,7 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
...
@@ -475,7 +487,7 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
{
{
getBufferSizeFunc
=
(
ippiMinEigenValGetBufferSize
)
ippiMinEigenValGetBufferSize_8u32f_C1R
;
getBufferSizeFunc
=
(
ippiMinEigenValGetBufferSize
)
ippiMinEigenValGetBufferSize_8u32f_C1R
;
minEigenValFunc
=
(
ippiMinEigenVal
)
ippiMinEigenVal_8u32f_C1R
;
minEigenValFunc
=
(
ippiMinEigenVal
)
ippiMinEigenVal_8u32f_C1R
;
norm_coef
=
1.
f
/
255
;
norm_coef
=
1.
f
/
255
.
f
;
}
else
if
(
src
.
type
()
==
CV_32FC1
)
}
else
if
(
src
.
type
()
==
CV_32FC1
)
{
{
getBufferSizeFunc
=
(
ippiMinEigenValGetBufferSize
)
ippiMinEigenValGetBufferSize_32f_C1R
;
getBufferSizeFunc
=
(
ippiMinEigenValGetBufferSize
)
ippiMinEigenValGetBufferSize_32f_C1R
;
...
@@ -486,16 +498,14 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
...
@@ -486,16 +498,14 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
if
(
getBufferSizeFunc
&&
minEigenValFunc
)
if
(
getBufferSizeFunc
&&
minEigenValFunc
)
{
{
int
bufferSize
;
int
bufferSize
;
IppiKernelType
kerType
=
ksize
>
0
?
ippKernelSobel
:
ippKernelScharr
;
IppiSize
srcRoi
=
{
src
.
cols
,
src
.
rows
};
IppiSize
srcRoi
=
{
src
.
cols
,
src
.
rows
};
IppiSize
dstRoi
=
{
dst
.
cols
,
dst
.
rows
};
IppStatus
ok
=
getBufferSizeFunc
(
srcRoi
,
ksize
,
blockSize
,
&
bufferSize
);
IppStatus
ok
=
getBufferSizeFunc
(
srcRoi
,
ksize
,
blockSize
,
&
bufferSize
);
if
(
ok
>=
0
)
if
(
ok
>=
0
)
{
{
Ipp8u
*
buffer
=
ippsMalloc_8u
(
bufferSize
);
Ipp8u
*
buffer
=
ippsMalloc_8u
(
bufferSize
);
ok
=
minEigenValFunc
(
src
.
data
,
(
int
)
src
.
step
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
srcRoi
,
kerType
,
k
s
ize
,
blockSize
,
buffer
);
ok
=
minEigenValFunc
(
src
.
data
,
(
int
)
src
.
step
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
srcRoi
,
kerType
,
k
erS
ize
,
blockSize
,
buffer
);
CV_SUPPRESS_DEPRECATED_START
CV_SUPPRESS_DEPRECATED_START
if
(
ok
>=
0
)
ippiMulC_32f_C1IR
(
norm_coef
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
dst
Roi
);
if
(
ok
>=
0
)
ippiMulC_32f_C1IR
(
norm_coef
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
src
Roi
);
CV_SUPPRESS_DEPRECATED_END
CV_SUPPRESS_DEPRECATED_END
ippsFree
(
buffer
);
ippsFree
(
buffer
);
if
(
ok
>=
0
)
if
(
ok
>=
0
)
...
...
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