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
74c77d82
Commit
74c77d82
authored
Aug 21, 2014
by
Alexander Mordvintsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base class name resolution
fixed find_obj.py
parent
40d0f853
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
common.cmake
modules/python/common.cmake
+2
-0
gen2.py
modules/python/src2/gen2.py
+14
-3
find_obj.py
samples/python2/find_obj.py
+8
-5
No files found.
modules/python/common.cmake
View file @
74c77d82
...
...
@@ -16,6 +16,7 @@ endforeach(mp)
ocv_list_filterout
(
candidate_deps
"^opencv_cud(a|ev)"
)
ocv_list_filterout
(
candidate_deps
"^opencv_matlab$"
)
ocv_list_filterout
(
candidate_deps
"^opencv_ts$"
)
ocv_list_filterout
(
candidate_deps
"^opencv_adas$"
)
ocv_add_module
(
${
MODULE_NAME
}
BINDINGS OPTIONAL
${
candidate_deps
}
)
...
...
@@ -35,6 +36,7 @@ ocv_list_filterout(opencv_hdrs ".h$")
ocv_list_filterout
(
opencv_hdrs
"cuda"
)
ocv_list_filterout
(
opencv_hdrs
"cudev"
)
ocv_list_filterout
(
opencv_hdrs
"opencv2/objdetect/detection_based_tracker.hpp"
)
ocv_list_filterout
(
opencv_hdrs
"opencv2/ximgproc/structured_edge_detection.hpp"
)
set
(
cv2_generated_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_include.h"
...
...
modules/python/src2/gen2.py
View file @
74c77d82
...
...
@@ -267,7 +267,7 @@ class ClassInfo(object):
#return sys.exit(-1)
if
self
.
bases
and
self
.
bases
[
0
]
.
startswith
(
"cv::"
):
self
.
bases
[
0
]
=
self
.
bases
[
0
][
4
:]
if
self
.
bases
and
self
.
bases
[
0
]
==
"
cv::
Algorithm"
:
if
self
.
bases
and
self
.
bases
[
0
]
==
"Algorithm"
:
self
.
isalgorithm
=
True
for
m
in
decl
[
2
]:
if
m
.
startswith
(
"="
):
...
...
@@ -752,8 +752,19 @@ class PythonWrapperGenerator(object):
%
(
classinfo
.
name
,
classinfo
.
cname
))
sys
.
exit
(
-
1
)
self
.
classes
[
classinfo
.
name
]
=
classinfo
if
classinfo
.
bases
and
not
classinfo
.
isalgorithm
:
classinfo
.
isalgorithm
=
self
.
classes
[
classinfo
.
bases
[
0
]
.
replace
(
"::"
,
"_"
)]
.
isalgorithm
if
classinfo
.
bases
:
chunks
=
classinfo
.
bases
[
0
]
.
split
(
'::'
)
base
=
'_'
.
join
(
chunks
)
while
base
not
in
self
.
classes
and
len
(
chunks
)
>
1
:
del
chunks
[
-
2
]
base
=
'_'
.
join
(
chunks
)
if
base
not
in
self
.
classes
:
print
(
"Generator error: unable to resolve base
%
s for
%
s"
%
(
classinfo
.
bases
[
0
],
classinfo
.
name
))
sys
.
exit
(
-
1
)
classinfo
.
bases
[
0
]
=
"::"
.
join
(
chunks
)
classinfo
.
isalgorithm
|=
self
.
classes
[
base
]
.
isalgorithm
def
split_decl_name
(
self
,
name
):
chunks
=
name
.
split
(
'.'
)
...
...
samples/python2/find_obj.py
View file @
74c77d82
...
...
@@ -4,7 +4,7 @@
Feature-based image matching sample.
USAGE
find_obj.py [--feature=<sift|surf|orb|brisk>[-flann]] [ <image1> <image2> ]
find_obj.py [--feature=<sift|surf|orb|
akaze|
brisk>[-flann]] [ <image1> <image2> ]
--feature - Feature to use. Can be sift, surf, orb or brisk. Append '-flann'
to feature name to use Flann-based matcher instead bruteforce.
...
...
@@ -23,14 +23,17 @@ FLANN_INDEX_LSH = 6
def
init_feature
(
name
):
chunks
=
name
.
split
(
'-'
)
if
chunks
[
0
]
==
'sift'
:
detector
=
cv2
.
SIFT
()
detector
=
cv2
.
xfeatures2d
.
SIFT
()
norm
=
cv2
.
NORM_L2
elif
chunks
[
0
]
==
'surf'
:
detector
=
cv2
.
SURF
(
800
)
detector
=
cv2
.
xfeatures2d
.
SURF
(
800
)
norm
=
cv2
.
NORM_L2
elif
chunks
[
0
]
==
'orb'
:
detector
=
cv2
.
ORB
(
400
)
norm
=
cv2
.
NORM_HAMMING
elif
chunks
[
0
]
==
'akaze'
:
detector
=
cv2
.
AKAZE
()
norm
=
cv2
.
NORM_HAMMING
elif
chunks
[
0
]
==
'brisk'
:
detector
=
cv2
.
BRISK
()
norm
=
cv2
.
NORM_HAMMING
...
...
@@ -136,8 +139,8 @@ if __name__ == '__main__':
try
:
fn1
,
fn2
=
args
except
:
fn1
=
'../c/box.png'
fn2
=
'../c/box_in_scene.png'
fn1
=
'../c
pp
/box.png'
fn2
=
'../c
pp
/box_in_scene.png'
img1
=
cv2
.
imread
(
fn1
,
0
)
img2
=
cv2
.
imread
(
fn2
,
0
)
...
...
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