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
db3f9b13
Commit
db3f9b13
authored
Apr 25, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed SURF behavior - from now it always returns keypoints in the same order
parent
562e4042
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
49 deletions
+38
-49
BruteForceDescriptorMatcherTest.java
...encv/test/features2d/BruteForceDescriptorMatcherTest.java
+7
-15
BruteForceL1DescriptorMatcherTest.java
...cv/test/features2d/BruteForceL1DescriptorMatcherTest.java
+5
-12
BruteForceSL2DescriptorMatcherTest.java
...v/test/features2d/BruteForceSL2DescriptorMatcherTest.java
+4
-11
FlannBasedDescriptorMatcherTest.java
...encv/test/features2d/FlannBasedDescriptorMatcherTest.java
+4
-11
surf.cpp
modules/nonfree/src/surf.cpp
+18
-0
No files found.
modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java
View file @
db3f9b13
...
...
@@ -19,8 +19,6 @@ import org.opencv.features2d.KeyPoint;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
android.util.Log
;
public
class
BruteForceDescriptorMatcherTest
extends
OpenCVTestCase
{
DescriptorMatcher
matcher
;
...
...
@@ -86,18 +84,11 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
matSize
=
100
;
truth
=
new
DMatch
[]
{
/*
new DMatch(0, 0, 0, 0.643284f),
new DMatch(1, 1, 0, 0.92945856f),
new DMatch(2, 1, 0, 0.2841479f),
new DMatch(3, 1, 0, 0.9194034f),
new DMatch(4, 1, 0, 0.3006621f)
*/
new
DMatch
(
0
,
0
,
0
,
1.049694f
),
new
DMatch
(
1
,
0
,
0
,
1.0
83795f
),
new
DMatch
(
2
,
1
,
0
,
0.4
84352f
),
new
DMatch
(
3
,
0
,
0
,
1.098605f
),
new
DMatch
(
4
,
1
,
0
,
0.494587
f
)
new
DMatch
(
1
,
0
,
0
,
1.0
98605f
),
new
DMatch
(
2
,
1
,
0
,
0.4
94587f
),
new
DMatch
(
3
,
1
,
0
,
0.484352f
),
new
DMatch
(
4
,
0
,
0
,
1.083795
f
)
};
super
.
setUp
();
...
...
@@ -180,9 +171,10 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
Mat
query
=
getQueryDescriptors
();
List
<
MatOfDMatch
>
matches
=
new
ArrayList
<
MatOfDMatch
>();
matcher
.
knnMatch
(
query
,
train
,
matches
,
k
);
/*
Log.d("knnMatch", "train = " + train);
Log.d("knnMatch", "query = " + query);
/*
matcher.add(train);
matcher.knnMatch(query, matches, k);
*/
...
...
@@ -190,7 +182,7 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
for
(
int
i
=
0
;
i
<
matches
.
size
();
i
++)
{
MatOfDMatch
vdm
=
matches
.
get
(
i
);
Log
.
d
(
"knn"
,
"vdm["
+
i
+
"]="
+
vdm
.
dump
());
//
Log.d("knn", "vdm["+i+"]="+vdm.dump());
assertTrue
(
Math
.
min
(
k
,
train
.
rows
())
>=
vdm
.
total
());
for
(
DMatch
dm
:
vdm
.
toArray
())
{
...
...
modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java
View file @
db3f9b13
...
...
@@ -84,18 +84,11 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
matSize
=
100
;
truth
=
new
DMatch
[]
{
/*
new DMatch(0, 0, 0, 3.175296f),
new DMatch(1, 1, 0, 3.5954158f),
new DMatch(2, 1, 0, 1.2537984f),
new DMatch(3, 1, 0, 3.5761614f),
new DMatch(4, 1, 0, 1.3250958f)
*/
new
DMatch
(
0
,
1
,
0
,
6.920234f
),
new
DMatch
(
1
,
0
,
0
,
6.1294847f
),
new
DMatch
(
2
,
1
,
0
,
2.6545324f
),
new
DMatch
(
3
,
1
,
0
,
6.1675916f
),
new
DMatch
(
4
,
1
,
0
,
2.679859f
)
new
DMatch
(
0
,
1
,
0
,
6.9202342f
),
new
DMatch
(
1
,
1
,
0
,
6.1675916f
),
new
DMatch
(
2
,
1
,
0
,
2.6798589f
),
new
DMatch
(
3
,
1
,
0
,
2.6545324f
),
new
DMatch
(
4
,
0
,
0
,
6.1294847f
)
};
super
.
setUp
();
}
...
...
modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java
View file @
db3f9b13
...
...
@@ -89,18 +89,11 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
matSize
=
100
;
truth
=
new
DMatch
[]
{
/*
new DMatch(0, 0, 0, sqr(0.643284f)),
new DMatch(1, 1, 0, sqr(0.92945856f)),
new DMatch(2, 1, 0, sqr(0.2841479f)),
new DMatch(3, 1, 0, sqr(0.9194034f)),
new DMatch(4, 1, 0, sqr(0.3006621f))
*/
new
DMatch
(
0
,
0
,
0
,
1.1018577f
),
new
DMatch
(
1
,
0
,
0
,
1.
1746116
f
),
new
DMatch
(
2
,
1
,
0
,
0.2
3459719
f
),
new
DMatch
(
3
,
0
,
0
,
1.2069331
f
),
new
DMatch
(
4
,
1
,
0
,
0.2446168
f
)
new
DMatch
(
1
,
0
,
0
,
1.
2069331
f
),
new
DMatch
(
2
,
1
,
0
,
0.2
446168
f
),
new
DMatch
(
3
,
1
,
0
,
0.2345972
f
),
new
DMatch
(
4
,
0
,
0
,
1.1746116
f
)
};
super
.
setUp
();
...
...
modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java
View file @
db3f9b13
...
...
@@ -158,18 +158,11 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
matSize
=
100
;
truth
=
new
DMatch
[]
{
/*
new DMatch(0, 0, 0, 0.643284f),
new DMatch(1, 1, 0, 0.92945856f),
new DMatch(2, 1, 0, 0.2841479f),
new DMatch(3, 1, 0, 0.9194034f),
new DMatch(4, 1, 0, 0.3006621f)
*/
new
DMatch
(
0
,
0
,
0
,
1.049694f
),
new
DMatch
(
1
,
0
,
0
,
1.0
8379
5f
),
new
DMatch
(
2
,
1
,
0
,
0.4
84352
f
),
new
DMatch
(
3
,
0
,
0
,
1.098605
f
),
new
DMatch
(
4
,
1
,
0
,
0.494587
f
)
new
DMatch
(
1
,
0
,
0
,
1.0
9860
5f
),
new
DMatch
(
2
,
1
,
0
,
0.4
94587
f
),
new
DMatch
(
3
,
1
,
0
,
0.484352
f
),
new
DMatch
(
4
,
0
,
0
,
1.083795
f
)
};
super
.
setUp
();
...
...
modules/nonfree/src/surf.cpp
View file @
db3f9b13
...
...
@@ -443,6 +443,22 @@ struct SURFFindInvoker
float
hessianThreshold
;
};
struct
KeypointGreater
{
inline
bool
operator
()(
const
KeyPoint
&
kp1
,
const
KeyPoint
&
kp2
)
const
{
if
(
kp1
.
response
>
kp2
.
response
)
return
true
;
if
(
kp1
.
response
<
kp2
.
response
)
return
false
;
if
(
kp1
.
size
>
kp2
.
size
)
return
true
;
if
(
kp1
.
size
<
kp2
.
size
)
return
false
;
if
(
kp1
.
octave
>
kp2
.
octave
)
return
true
;
if
(
kp1
.
octave
<
kp2
.
octave
)
return
false
;
if
(
kp1
.
pt
.
y
<
kp2
.
pt
.
y
)
return
false
;
if
(
kp1
.
pt
.
y
>
kp2
.
pt
.
y
)
return
true
;
return
kp1
.
pt
.
x
<
kp2
.
pt
.
y
;
}
};
static
void
fastHessianDetector
(
const
Mat
&
sum
,
const
Mat
&
mask_sum
,
vector
<
KeyPoint
>&
keypoints
,
int
nOctaves
,
int
nOctaveLayers
,
float
hessianThreshold
)
...
...
@@ -490,6 +506,8 @@ static void fastHessianDetector( const Mat& sum, const Mat& mask_sum, vector<Key
SURFFindInvoker
(
sum
,
mask_sum
,
dets
,
traces
,
sizes
,
sampleSteps
,
middleIndices
,
keypoints
,
nOctaveLayers
,
hessianThreshold
)
);
std
::
sort
(
keypoints
.
begin
(),
keypoints
.
end
(),
KeypointGreater
());
}
...
...
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