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
9c780260
Commit
9c780260
authored
May 07, 2014
by
Alexander Alekhin
Committed by
OpenCV Buildbot
May 07, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2605 from akarsakov:ipp_min_eigen_val
parents
849228ac
eda084e1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
44 deletions
+110
-44
perf_cornerEigenValsAndVecs.cpp
modules/imgproc/perf/perf_cornerEigenValsAndVecs.cpp
+0
-40
perf_corners.cpp
modules/imgproc/perf/perf_corners.cpp
+56
-3
corner.cpp
modules/imgproc/src/corner.cpp
+54
-1
No files found.
modules/imgproc/perf/perf_cornerEigenValsAndVecs.cpp
deleted
100644 → 0
View file @
849228ac
#include "perf_precomp.hpp"
using
namespace
std
;
using
namespace
cv
;
using
namespace
perf
;
using
std
::
tr1
::
make_tuple
;
using
std
::
tr1
::
get
;
CV_ENUM
(
BorderType
,
BORDER_REPLICATE
,
BORDER_CONSTANT
,
BORDER_REFLECT
,
BORDER_REFLECT_101
)
typedef
std
::
tr1
::
tuple
<
string
,
int
,
int
,
BorderType
>
Img_BlockSize_ApertureSize_BorderType_t
;
typedef
perf
::
TestBaseWithParam
<
Img_BlockSize_ApertureSize_BorderType_t
>
Img_BlockSize_ApertureSize_BorderType
;
PERF_TEST_P
(
Img_BlockSize_ApertureSize_BorderType
,
cornerEigenValsAndVecs
,
testing
::
Combine
(
testing
::
Values
(
"stitching/a1.png"
,
"cv/shared/pic5.png"
),
testing
::
Values
(
3
,
5
),
testing
::
Values
(
3
,
5
),
BorderType
::
all
()
)
)
{
string
filename
=
getDataPath
(
get
<
0
>
(
GetParam
()));
int
blockSize
=
get
<
1
>
(
GetParam
());
int
apertureSize
=
get
<
2
>
(
GetParam
());
BorderType
borderType
=
get
<
3
>
(
GetParam
());
Mat
src
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
if
(
src
.
empty
())
FAIL
()
<<
"Unable to load source image"
<<
filename
;
Mat
dst
;
TEST_CYCLE
()
cornerEigenValsAndVecs
(
src
,
dst
,
blockSize
,
apertureSize
,
borderType
);
Mat
l1
;
extractChannel
(
dst
,
l1
,
0
);
SANITY_CHECK
(
l1
,
2e-5
);
}
modules/imgproc/perf/perf_corner
Harri
s.cpp
→
modules/imgproc/perf/perf_corners.cpp
View file @
9c780260
...
...
@@ -28,12 +28,65 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris,
BorderType
borderType
=
get
<
4
>
(
GetParam
());
Mat
src
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
if
(
src
.
empty
())
FAIL
()
<<
"Unable to load source image"
<<
filename
;
ASSERT_FALSE
(
src
.
empty
())
<<
"Unable to load source image: "
<<
filename
;
Mat
dst
;
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
perf
::
TestBaseWithParam
<
Img_BlockSize_ApertureSize_BorderType_t
>
Img_BlockSize_ApertureSize_BorderType
;
PERF_TEST_P
(
Img_BlockSize_ApertureSize_BorderType
,
cornerEigenValsAndVecs
,
testing
::
Combine
(
testing
::
Values
(
"stitching/a1.png"
,
"cv/shared/pic5.png"
),
testing
::
Values
(
3
,
5
),
testing
::
Values
(
3
,
5
),
BorderType
::
all
()
)
)
{
string
filename
=
getDataPath
(
get
<
0
>
(
GetParam
()));
int
blockSize
=
get
<
1
>
(
GetParam
());
int
apertureSize
=
get
<
2
>
(
GetParam
());
BorderType
borderType
=
get
<
3
>
(
GetParam
());
Mat
src
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
src
.
empty
())
<<
"Unable to load source image: "
<<
filename
;
Mat
dst
;
TEST_CYCLE
()
cornerEigenValsAndVecs
(
src
,
dst
,
blockSize
,
apertureSize
,
borderType
);
Mat
l1
;
extractChannel
(
dst
,
l1
,
0
);
SANITY_CHECK
(
l1
,
2e-5
,
ERROR_RELATIVE
);
}
PERF_TEST_P
(
Img_BlockSize_ApertureSize_BorderType
,
cornerMinEigenVal
,
testing
::
Combine
(
testing
::
Values
(
"stitching/a1.png"
,
"cv/shared/pic5.png"
),
testing
::
Values
(
3
,
5
),
testing
::
Values
(
3
,
5
),
BorderType
::
all
()
)
)
{
string
filename
=
getDataPath
(
get
<
0
>
(
GetParam
()));
int
blockSize
=
get
<
1
>
(
GetParam
());
int
apertureSize
=
get
<
2
>
(
GetParam
());
BorderType
borderType
=
get
<
3
>
(
GetParam
());
Mat
src
=
imread
(
filename
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
src
.
empty
())
<<
"Unable to load source image: "
<<
filename
;
Mat
dst
;
TEST_CYCLE
()
cornerMinEigenVal
(
src
,
dst
,
blockSize
,
apertureSize
,
borderType
);
SANITY_CHECK
(
dst
,
2e-5
,
ERROR_RELATIVE
);
}
modules/imgproc/src/corner.cpp
View file @
9c780260
...
...
@@ -460,10 +460,63 @@ void cv::cornerMinEigenVal( InputArray _src, OutputArray _dst, int blockSize, in
Mat
src
=
_src
.
getMat
();
_dst
.
create
(
src
.
size
(),
CV_32FC1
);
Mat
dst
=
_dst
.
getMat
();
#if defined(HAVE_IPP) && !defined(HAVE_IPP_ICV_ONLY) && (IPP_VERSION_MAJOR >= 8)
typedef
IppStatus
(
CV_STDCALL
*
ippiMinEigenValGetBufferSize
)(
IppiSize
,
int
,
int
,
int
*
);
typedef
IppStatus
(
CV_STDCALL
*
ippiMinEigenVal
)(
const
void
*
,
int
,
Ipp32f
*
,
int
,
IppiSize
,
IppiKernelType
,
int
,
int
,
Ipp8u
*
);
IppiKernelType
kerType
;
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
;
ippiMinEigenVal
minEigenValFunc
=
0
;
float
norm_coef
=
0.
f
;
if
(
src
.
type
()
==
CV_8UC1
)
{
getBufferSizeFunc
=
(
ippiMinEigenValGetBufferSize
)
ippiMinEigenValGetBufferSize_8u32f_C1R
;
minEigenValFunc
=
(
ippiMinEigenVal
)
ippiMinEigenVal_8u32f_C1R
;
norm_coef
=
1.
f
/
255.
f
;
}
else
if
(
src
.
type
()
==
CV_32FC1
)
{
getBufferSizeFunc
=
(
ippiMinEigenValGetBufferSize
)
ippiMinEigenValGetBufferSize_32f_C1R
;
minEigenValFunc
=
(
ippiMinEigenVal
)
ippiMinEigenVal_32f_C1R
;
norm_coef
=
255.
f
;
}
if
(
getBufferSizeFunc
&&
minEigenValFunc
)
{
int
bufferSize
;
IppiSize
srcRoi
=
{
src
.
cols
,
src
.
rows
};
IppStatus
ok
=
getBufferSizeFunc
(
srcRoi
,
ksize
,
blockSize
,
&
bufferSize
);
if
(
ok
>=
0
)
{
AutoBuffer
<
uchar
>
buffer
(
bufferSize
);
ok
=
minEigenValFunc
(
src
.
data
,
(
int
)
src
.
step
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
srcRoi
,
kerType
,
kerSize
,
blockSize
,
buffer
);
CV_SUPPRESS_DEPRECATED_START
if
(
ok
>=
0
)
ok
=
ippiMulC_32f_C1IR
(
norm_coef
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
srcRoi
);
CV_SUPPRESS_DEPRECATED_END
if
(
ok
>=
0
)
return
;
}
setIppErrorStatus
();
}
}
#endif
cornerEigenValsVecs
(
src
,
dst
,
blockSize
,
ksize
,
MINEIGENVAL
,
0
,
borderType
);
}
void
cv
::
cornerHarris
(
InputArray
_src
,
OutputArray
_dst
,
int
blockSize
,
int
ksize
,
double
k
,
int
borderType
)
{
CV_OCL_RUN
(
_src
.
dims
()
<=
2
&&
_dst
.
isUMat
(),
...
...
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