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
5b1967f8
Commit
5b1967f8
authored
Sep 01, 2015
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5274 from ilya-lavrenov:features2d
parents
74f5eaf7
dc441f50
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
8 deletions
+28
-8
test_descriptors_regression.cpp
modules/features2d/test/test_descriptors_regression.cpp
+7
-4
test_lshindex_flannbased_matcher.cpp
modules/features2d/test/test_lshindex_flannbased_matcher.cpp
+11
-1
test_nearestneighbors.cpp
modules/features2d/test/test_nearestneighbors.cpp
+10
-3
No files found.
modules/features2d/test/test_descriptors_regression.cpp
View file @
5b1967f8
...
...
@@ -61,7 +61,7 @@ static void writeMatInBin( const Mat& mat, const string& filename )
fwrite
(
(
void
*
)
&
mat
.
rows
,
sizeof
(
int
),
1
,
f
);
fwrite
(
(
void
*
)
&
mat
.
cols
,
sizeof
(
int
),
1
,
f
);
fwrite
(
(
void
*
)
&
type
,
sizeof
(
int
),
1
,
f
);
int
dataSize
=
(
int
)(
mat
.
step
*
mat
.
rows
*
mat
.
channels
()
);
int
dataSize
=
(
int
)(
mat
.
step
*
mat
.
rows
);
fwrite
(
(
void
*
)
&
dataSize
,
sizeof
(
int
),
1
,
f
);
fwrite
(
(
void
*
)
mat
.
data
,
1
,
dataSize
,
f
);
fclose
(
f
);
...
...
@@ -80,12 +80,15 @@ static Mat readMatFromBin( const string& filename )
size_t
elements_read4
=
fread
(
(
void
*
)
&
dataSize
,
sizeof
(
int
),
1
,
f
);
CV_Assert
(
elements_read1
==
1
&&
elements_read2
==
1
&&
elements_read3
==
1
&&
elements_read4
==
1
);
uchar
*
data
=
(
uchar
*
)
cvAlloc
(
dataSize
);
size_t
elements_read
=
fread
(
(
void
*
)
data
,
1
,
dataSize
,
f
);
Mat
returnMat
(
rows
,
cols
,
type
);
CV_Assert
(
returnMat
.
step
*
returnMat
.
rows
==
(
size_t
)(
dataSize
));
size_t
elements_read
=
fread
(
(
void
*
)
returnMat
.
data
,
1
,
dataSize
,
f
);
CV_Assert
(
elements_read
==
(
size_t
)(
dataSize
));
fclose
(
f
);
return
Mat
(
rows
,
cols
,
type
,
data
)
;
return
returnMat
;
}
return
Mat
();
}
...
...
modules/features2d/test/test_lshindex_flannbased_matcher.cpp
View file @
5b1967f8
...
...
@@ -303,7 +303,8 @@ public:
//
// constructor
//
CV_FeatureDetectorMatcherBaseTest
(
testparam
*
_tp
,
double
_accuracy_margin
,
cv
::
Feature2D
*
_fe
,
cv
::
DescriptorMatcher
*
_flmatcher
,
string
_flmatchername
,
int
norm_type_for_bfmatcher
)
:
CV_FeatureDetectorMatcherBaseTest
(
testparam
*
_tp
,
double
_accuracy_margin
,
cv
::
Feature2D
*
_fe
,
cv
::
DescriptorMatcher
*
_flmatcher
,
string
_flmatchername
,
int
norm_type_for_bfmatcher
)
:
tp
(
_tp
),
target_accuracy_margin_from_bfmatcher
(
_accuracy_margin
),
fe
(
_fe
),
...
...
@@ -318,6 +319,15 @@ public:
bfmatcher
=
new
cv
::
BFMatcher
(
norm_type_for_bfmatcher
);
}
virtual
~
CV_FeatureDetectorMatcherBaseTest
()
{
if
(
bfmatcher
)
{
delete
bfmatcher
;
bfmatcher
=
NULL
;
}
}
//
// Main Test method
//
...
...
modules/features2d/test/test_nearestneighbors.cpp
View file @
5b1967f8
...
...
@@ -159,7 +159,7 @@ void NearestNeighborTest::run( int /*start_from*/ ) {
class
CV_KDTreeTest_CPP
:
public
NearestNeighborTest
{
public
:
CV_KDTreeTest_CPP
()
{}
CV_KDTreeTest_CPP
()
:
NearestNeighborTest
(),
tr
(
NULL
)
{}
protected
:
virtual
void
createModel
(
const
Mat
&
data
);
virtual
int
checkGetPoints
(
const
Mat
&
data
);
...
...
@@ -244,7 +244,7 @@ void CV_KDTreeTest_CPP::releaseModel()
class
CV_FlannTest
:
public
NearestNeighborTest
{
public
:
CV_FlannTest
()
{
}
CV_FlannTest
()
:
NearestNeighborTest
(),
index
(
NULL
)
{
}
protected
:
void
createIndex
(
const
Mat
&
data
,
const
IndexParams
&
params
);
int
knnSearch
(
Mat
&
points
,
Mat
&
neighbors
);
...
...
@@ -255,6 +255,9 @@ protected:
void
CV_FlannTest
::
createIndex
(
const
Mat
&
data
,
const
IndexParams
&
params
)
{
// release previously allocated index
releaseModel
();
index
=
new
Index
(
data
,
params
);
}
...
...
@@ -321,7 +324,11 @@ int CV_FlannTest::radiusSearch( Mat& points, Mat& neighbors )
void
CV_FlannTest
::
releaseModel
()
{
delete
index
;
if
(
index
)
{
delete
index
;
index
=
NULL
;
}
}
//---------------------------------------
...
...
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