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
eaa7fcc3
Commit
eaa7fcc3
authored
Aug 13, 2013
by
Roman Donchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Boring changes - legacy.
parent
34127ba8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
23 deletions
+26
-23
features2d.cpp
modules/legacy/src/features2d.cpp
+5
-5
kdtree.cpp
modules/legacy/src/kdtree.cpp
+1
-1
oneway.cpp
modules/legacy/src/oneway.cpp
+12
-10
planardetect.cpp
modules/legacy/src/planardetect.cpp
+8
-7
No files found.
modules/legacy/src/features2d.cpp
View file @
eaa7fcc3
...
...
@@ -73,7 +73,7 @@ cvExtractSURF( const CvArr* _img, const CvArr* _mask,
Mat
descr
;
Ptr
<
Feature2D
>
surf
=
Algorithm
::
create
<
Feature2D
>
(
"Feature2D.SURF"
);
if
(
surf
.
empty
()
)
if
(
!
surf
)
CV_Error
(
CV_StsNotImplemented
,
"OpenCV was built without SURF support"
);
surf
->
set
(
"hessianThreshold"
,
params
.
hessianThreshold
);
...
...
@@ -107,10 +107,10 @@ CV_IMPL CvSeq*
cvGetStarKeypoints
(
const
CvArr
*
_img
,
CvMemStorage
*
storage
,
CvStarDetectorParams
params
)
{
Ptr
<
StarDetector
>
star
=
new
StarDetector
(
params
.
maxSize
,
params
.
responseThreshold
,
params
.
lineThresholdProjected
,
params
.
lineThresholdBinarized
,
params
.
suppressNonmaxSize
);
Ptr
<
StarDetector
>
star
(
new
StarDetector
(
params
.
maxSize
,
params
.
responseThreshold
,
params
.
lineThresholdProjected
,
params
.
lineThresholdBinarized
,
params
.
suppressNonmaxSize
)
);
std
::
vector
<
KeyPoint
>
kpts
;
star
->
detect
(
cvarrToMat
(
_img
),
kpts
,
Mat
());
...
...
modules/legacy/src/kdtree.cpp
View file @
eaa7fcc3
...
...
@@ -172,7 +172,7 @@ public:
CV_Error
(
CV_StsUnsupportedFormat
,
"dist must be CV_64FC1"
);
if
(
CV_MAT_TYPE
(
type
())
!=
CV_MAT_TYPE
(
desc
->
type
))
{
tmp_desc
=
cvCreateMat
(
desc
->
rows
,
desc
->
cols
,
type
(
));
tmp_desc
.
reset
(
cvCreateMat
(
desc
->
rows
,
desc
->
cols
,
type
()
));
cvConvert
(
desc
,
tmp_desc
);
desc
=
tmp_desc
;
}
...
...
modules/legacy/src/oneway.cpp
View file @
eaa7fcc3
...
...
@@ -1736,7 +1736,7 @@ namespace cv{
{
std
::
vector
<
KeyPoint
>
features
;
Ptr
<
FeatureDetector
>
surf_extractor
=
FeatureDetector
::
create
(
"SURF"
);
if
(
surf_extractor
.
empty
()
)
if
(
!
surf_extractor
)
CV_Error
(
CV_StsNotImplemented
,
"OpenCV was built without SURF support"
);
surf_extractor
->
set
(
"hessianThreshold"
,
1.0
);
//printf("Extracting SURF features...");
...
...
@@ -2186,7 +2186,7 @@ namespace cv{
{
clear
();
if
(
_base
.
empty
()
)
if
(
!
_base
)
base
=
_base
;
params
=
_params
;
...
...
@@ -2197,16 +2197,17 @@ namespace cv{
GenericDescriptorMatcher
::
clear
();
prevTrainCount
=
0
;
if
(
!
base
.
empty
()
)
if
(
base
)
base
->
clear
();
}
void
OneWayDescriptorMatcher
::
train
()
{
if
(
base
.
empty
()
||
prevTrainCount
<
(
int
)
trainPointCollection
.
keypointCount
()
)
if
(
!
base
||
prevTrainCount
<
(
int
)
trainPointCollection
.
keypointCount
()
)
{
base
=
new
OneWayDescriptorObject
(
params
.
patchSize
,
params
.
poseCount
,
params
.
pcaFilename
,
params
.
trainPath
,
params
.
trainImagesList
,
params
.
minScale
,
params
.
maxScale
,
params
.
stepScale
);
base
.
reset
(
new
OneWayDescriptorObject
(
params
.
patchSize
,
params
.
poseCount
,
params
.
pcaFilename
,
params
.
trainPath
,
params
.
trainImagesList
,
params
.
minScale
,
params
.
maxScale
,
params
.
stepScale
));
base
->
Allocate
(
(
int
)
trainPointCollection
.
keypointCount
()
);
prevTrainCount
=
(
int
)
trainPointCollection
.
keypointCount
();
...
...
@@ -2270,8 +2271,9 @@ namespace cv{
void
OneWayDescriptorMatcher
::
read
(
const
FileNode
&
fn
)
{
base
=
new
OneWayDescriptorObject
(
params
.
patchSize
,
params
.
poseCount
,
String
(),
String
(),
String
(),
params
.
minScale
,
params
.
maxScale
,
params
.
stepScale
);
base
.
reset
(
new
OneWayDescriptorObject
(
params
.
patchSize
,
params
.
poseCount
,
String
(),
String
(),
String
(),
params
.
minScale
,
params
.
maxScale
,
params
.
stepScale
));
base
->
Read
(
fn
);
}
...
...
@@ -2282,12 +2284,12 @@ namespace cv{
bool
OneWayDescriptorMatcher
::
empty
()
const
{
return
base
.
empty
()
||
base
->
empty
();
return
!
base
||
base
->
empty
();
}
Ptr
<
GenericDescriptorMatcher
>
OneWayDescriptorMatcher
::
clone
(
bool
emptyTrainData
)
const
{
OneWayDescriptorMatcher
*
matcher
=
new
OneWayDescriptorMatcher
(
params
);
Ptr
<
OneWayDescriptorMatcher
>
matcher
=
makePtr
<
OneWayDescriptorMatcher
>
(
params
);
if
(
!
emptyTrainData
)
{
...
...
modules/legacy/src/planardetect.cpp
View file @
eaa7fcc3
...
...
@@ -1240,7 +1240,7 @@ FernDescriptorMatcher::FernDescriptorMatcher( const Params& _params )
params
=
_params
;
if
(
!
params
.
filename
.
empty
()
)
{
classifier
=
new
FernClassifier
;
classifier
=
makePtr
<
FernClassifier
>
()
;
FileStorage
fs
(
params
.
filename
,
FileStorage
::
READ
);
if
(
fs
.
isOpened
()
)
classifier
->
read
(
fs
.
getFirstTopLevelNode
()
);
...
...
@@ -1260,7 +1260,7 @@ void FernDescriptorMatcher::clear()
void
FernDescriptorMatcher
::
train
()
{
if
(
classifier
.
empty
()
||
prevTrainCount
<
(
int
)
trainPointCollection
.
keypointCount
()
)
if
(
!
classifier
||
prevTrainCount
<
(
int
)
trainPointCollection
.
keypointCount
()
)
{
assert
(
params
.
filename
.
empty
()
);
...
...
@@ -1268,9 +1268,10 @@ void FernDescriptorMatcher::train()
for
(
size_t
imgIdx
=
0
;
imgIdx
<
trainPointCollection
.
imageCount
();
imgIdx
++
)
KeyPoint
::
convert
(
trainPointCollection
.
getKeypoints
((
int
)
imgIdx
),
points
[
imgIdx
]
);
classifier
=
new
FernClassifier
(
points
,
trainPointCollection
.
getImages
(),
std
::
vector
<
std
::
vector
<
int
>
>
(),
0
,
// each points is a class
params
.
patchSize
,
params
.
signatureSize
,
params
.
nstructs
,
params
.
structSize
,
params
.
nviews
,
params
.
compressionMethod
,
params
.
patchGenerator
);
classifier
.
reset
(
new
FernClassifier
(
points
,
trainPointCollection
.
getImages
(),
std
::
vector
<
std
::
vector
<
int
>
>
(),
0
,
// each points is a class
params
.
patchSize
,
params
.
signatureSize
,
params
.
nstructs
,
params
.
structSize
,
params
.
nviews
,
params
.
compressionMethod
,
params
.
patchGenerator
));
}
}
...
...
@@ -1384,12 +1385,12 @@ void FernDescriptorMatcher::write( FileStorage& fs ) const
bool
FernDescriptorMatcher
::
empty
()
const
{
return
classifier
.
empty
()
||
classifier
->
empty
();
return
!
classifier
||
classifier
->
empty
();
}
Ptr
<
GenericDescriptorMatcher
>
FernDescriptorMatcher
::
clone
(
bool
emptyTrainData
)
const
{
FernDescriptorMatcher
*
matcher
=
new
FernDescriptorMatcher
(
params
);
Ptr
<
FernDescriptorMatcher
>
matcher
=
makePtr
<
FernDescriptorMatcher
>
(
params
);
if
(
!
emptyTrainData
)
{
CV_Error
(
CV_StsNotImplemented
,
"deep clone dunctionality is not implemented, because "
...
...
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