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
04abffeb
Commit
04abffeb
authored
Apr 13, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cv::cornerHarris
parent
8603c58f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
8 deletions
+50
-8
corner.cpp
modules/imgproc/src/corner.cpp
+50
-8
No files found.
modules/imgproc/src/corner.cpp
View file @
04abffeb
...
...
@@ -251,10 +251,10 @@ cornerEigenValsVecs( const Mat& src, Mat& eigenv, int block_size,
int
depth
=
src
.
depth
();
double
scale
=
(
double
)(
1
<<
((
aperture_size
>
0
?
aperture_size
:
3
)
-
1
))
*
block_size
;
if
(
aperture_size
<
0
)
scale
*=
2.
;
scale
*=
2.
0
;
if
(
depth
==
CV_8U
)
scale
*=
255.
;
scale
=
1.
/
scale
;
scale
*=
255.
0
;
scale
=
1.
0
/
scale
;
CV_Assert
(
src
.
type
()
==
CV_8UC1
||
src
.
type
()
==
CV_32FC1
);
...
...
@@ -381,15 +381,15 @@ static bool ocl_cornerMinEigenValVecs(InputArray _src, OutputArray _dst, int blo
const
char
*
const
cornerType
[]
=
{
"CORNER_MINEIGENVAL"
,
"CORNER_HARRIS"
,
0
};
float
scale
=
(
float
)(
1
<<
((
aperture_size
>
0
?
aperture_size
:
3
)
-
1
))
*
block_size
;
double
scale
=
(
double
)(
1
<<
((
aperture_size
>
0
?
aperture_size
:
3
)
-
1
))
*
block_size
;
if
(
aperture_size
<
0
)
scale
*=
2.0
f
;
scale
*=
2.0
;
if
(
depth
==
CV_8U
)
scale
*=
255.0
f
;
scale
=
1.0
f
/
scale
;
scale
*=
255.0
;
scale
=
1.0
/
scale
;
UMat
Dx
,
Dy
;
if
(
!
extractCovData
(
_src
,
Dx
,
Dy
,
depth
,
scale
,
aperture_size
,
borderType
))
if
(
!
extractCovData
(
_src
,
Dx
,
Dy
,
depth
,
(
double
)
scale
,
aperture_size
,
borderType
))
return
false
;
ocl
::
Kernel
cornelKernel
(
"corner"
,
ocl
::
imgproc
::
corner_oclsrc
,
...
...
@@ -472,6 +472,48 @@ void cv::cornerHarris( InputArray _src, OutputArray _dst, int blockSize, int ksi
Mat
src
=
_src
.
getMat
();
_dst
.
create
(
src
.
size
(),
CV_32FC1
);
Mat
dst
=
_dst
.
getMat
();
#if defined HAVE_IPP && !defined HAVE_IPP_ICV_ONLY
int
type
=
src
.
type
(),
depth
=
CV_MAT_DEPTH
(
type
),
cn
=
CV_MAT_CN
(
type
);
int
borderTypeNI
=
borderType
&
~
BORDER_ISOLATED
;
bool
isolated
=
(
borderType
&
BORDER_ISOLATED
)
!=
0
;
if
(
(
ksize
==
3
||
ksize
==
5
)
&&
(
type
==
CV_8UC1
||
type
==
CV_32FC1
)
&&
(
borderTypeNI
==
BORDER_CONSTANT
||
borderTypeNI
==
BORDER_REPLICATE
)
&&
cn
==
1
&&
(
!
src
.
isSubmatrix
()
||
isolated
)
)
{
IppiSize
roisize
=
{
src
.
cols
,
src
.
rows
};
IppiMaskSize
masksize
=
ksize
==
5
?
ippMskSize5x5
:
ippMskSize3x3
;
IppDataType
datatype
=
type
==
CV_8UC1
?
ipp8u
:
ipp32f
;
Ipp32s
bufsize
=
0
;
double
scale
=
(
double
)(
1
<<
((
ksize
>
0
?
ksize
:
3
)
-
1
))
*
blockSize
;
if
(
ksize
<
0
)
scale
*=
2.0
;
if
(
depth
==
CV_8U
)
scale
*=
255.0
;
scale
=
std
::
pow
(
scale
,
-
4.0
f
);
if
(
ippiHarrisCornerGetBufferSize
(
roisize
,
masksize
,
blockSize
,
datatype
,
cn
,
&
bufsize
)
>=
0
)
{
Ipp8u
*
buffer
=
ippsMalloc_8u
(
bufsize
);
IppiDifferentialKernel
filterType
=
ksize
>
0
?
ippFilterSobel
:
ippFilterScharr
;
IppiBorderType
borderTypeIpp
=
borderTypeNI
==
BORDER_CONSTANT
?
ippBorderConst
:
ippBorderRepl
;
IppStatus
status
=
(
IppStatus
)
-
1
;
if
(
depth
==
CV_8U
)
status
=
ippiHarrisCorner_8u32f_C1R
((
const
Ipp8u
*
)
src
.
data
,
(
int
)
src
.
step
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
roisize
,
filterType
,
masksize
,
blockSize
,
(
Ipp32f
)
k
,
(
Ipp32f
)
scale
,
borderTypeIpp
,
0
,
buffer
);
else
if
(
depth
==
CV_32F
)
status
=
ippiHarrisCorner_32f_C1R
((
const
Ipp32f
*
)
src
.
data
,
(
int
)
src
.
step
,
(
Ipp32f
*
)
dst
.
data
,
(
int
)
dst
.
step
,
roisize
,
filterType
,
masksize
,
blockSize
,
(
Ipp32f
)
k
,
(
Ipp32f
)
scale
,
borderTypeIpp
,
0
,
buffer
);
ippsFree
(
buffer
);
if
(
status
>=
0
)
return
;
}
}
#endif
cornerEigenValsVecs
(
src
,
dst
,
blockSize
,
ksize
,
HARRIS
,
k
,
borderType
);
}
...
...
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