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
7e9f1c33
Commit
7e9f1c33
authored
Mar 05, 2013
by
cuda-geek
Committed by
OpenCV Buildbot
Mar 05, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #617 from moshekaplan:master
parents
9e12b7c3
facd580f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
common.py
samples/python2/common.py
+1
-1
find_obj.py
samples/python2/find_obj.py
+15
-6
No files found.
samples/python2/common.py
View file @
7e9f1c33
#/usr/bin/env python
'''
This module contais some common routines used by other samples.
This module contai
n
s some common routines used by other samples.
'''
import
numpy
as
np
...
...
samples/python2/find_obj.py
View file @
7e9f1c33
...
...
@@ -9,7 +9,7 @@ USAGE
--feature - Feature to use. Can be sift, surf of orb. Append '-flann' to feature name
to use Flann-based matcher instead bruteforce.
Press left mouse button on a feature point to see its mat
hc
ing point.
Press left mouse button on a feature point to see its mat
ch
ing point.
'''
import
numpy
as
np
...
...
@@ -130,7 +130,8 @@ if __name__ == '__main__':
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
''
,
[
'feature='
])
opts
=
dict
(
opts
)
feature_name
=
opts
.
get
(
'--feature'
,
'sift'
)
try
:
fn1
,
fn2
=
args
try
:
fn1
,
fn2
=
args
except
:
fn1
=
'../c/box.png'
fn2
=
'../c/box_in_scene.png'
...
...
@@ -138,12 +139,20 @@ if __name__ == '__main__':
img1
=
cv2
.
imread
(
fn1
,
0
)
img2
=
cv2
.
imread
(
fn2
,
0
)
detector
,
matcher
=
init_feature
(
feature_name
)
if
detector
!=
None
:
print
'using'
,
feature_name
else
:
if
img1
is
None
:
print
'Failed to load fn1:'
,
fn1
sys
.
exit
(
1
)
if
img2
is
None
:
print
'Failed to load fn2:'
,
fn2
sys
.
exit
(
1
)
if
detector
is
None
:
print
'unknown feature:'
,
feature_name
sys
.
exit
(
1
)
print
'using'
,
feature_name
kp1
,
desc1
=
detector
.
detectAndCompute
(
img1
,
None
)
kp2
,
desc2
=
detector
.
detectAndCompute
(
img2
,
None
)
...
...
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