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
d9dc0254
Commit
d9dc0254
authored
Aug 05, 2012
by
Alexander Mordvintesv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added descriptions to PlaneTracker samples
parent
353c69e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
3 deletions
+65
-3
feature_homography.py
samples/python2/feature_homography.py
+7
-2
plane_ar.py
samples/python2/plane_ar.py
+22
-0
plane_tracker.py
samples/python2/plane_tracker.py
+36
-1
No files found.
samples/python2/feature_homography.py
View file @
d9dc0254
...
...
@@ -3,16 +3,21 @@ Feature homography
==================
Example of using features2d framework for interactive video homography matching.
ORB features and FLANN matcher are used.
ORB features and FLANN matcher are used. The actual tracking is implemented by
PlaneTracker class in plane_tracker.py
Inspired by http://www.youtube.com/watch?v=-ZNYoL8rzPY
video: http://www.youtube.com/watch?v=FirtmYcC0Vc
Usage
-----
feature_homography.py [<video source>]
Select a textured planar object to track by drawing a box with a mouse.
Keys:
SPACE - pause video
Select a textured planar object to track by drawing a box with a mouse.
'''
import
numpy
as
np
...
...
samples/python2/plane_ar.py
View file @
d9dc0254
'''
Planar augmented reality
==================
This sample shows an example of augmented reality overlay over a planar object
tracked by PlaneTracker from plane_tracker.py. solvePnP funciton is used to
estimate the tracked object location in 3d space.
video: http://www.youtube.com/watch?v=pzVbhxx6aog
Usage
-----
plane_ar.py [<video source>]
Keys:
SPACE - pause video
c - clear targets
Select a textured planar object to track by drawing a box with a mouse.
Use 'focal' slider to adjust to camera focal length for proper video augmentation.
'''
import
numpy
as
np
import
cv2
import
video
...
...
samples/python2/plane_tracker.py
View file @
d9dc0254
'''
Multitarget planar tracking
==================
Example of using features2d framework for interactive video homography matching.
ORB features and FLANN matcher are used. This sample provides PlaneTracker class
and an example of its usage.
video: http://www.youtube.com/watch?v=pzVbhxx6aog
Usage
-----
plane_tracker.py [<video source>]
Keys:
SPACE - pause video
c - clear targets
Select a textured planar object to track by drawing a box with a mouse.
'''
import
numpy
as
np
import
cv2
from
collections
import
namedtuple
...
...
@@ -14,8 +35,22 @@ flann_params= dict(algorithm = FLANN_INDEX_LSH,
MIN_MATCH_COUNT
=
10
'''
image - image to track
rect - tracked rectangle (x1, y1, x2, y2)
keypoints - keypoints detected inside rect
descrs - their descriptors
data - some user-provided data
'''
PlanarTarget
=
namedtuple
(
'PlaneTarget'
,
'image, rect, keypoints, descrs, data'
)
'''
target - reference to PlanarTarget
p0 - matched points coords in target image
p1 - matched points coords in input frame
H - homography matrix from p0 to p1
quad - target bounary quad in input frame
'''
TrackedTarget
=
namedtuple
(
'TrackedTarget'
,
'target, p0, p1, H, quad'
)
class
PlaneTracker
:
...
...
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