Permalink
Browse files

Added bounding box to hand

  • Loading branch information...
1 parent fb396d3 commit 886ed6b96709234298159829710108f9c30f4823 @thisismyrobot committed Apr 11, 2010
Showing with 12 additions and 1 deletion.
  1. +12 −1 hand-recognise.py
View
@@ -47,7 +47,18 @@ def get_diff(old, new):
while 1:
new = get_img(capture)
diff = get_diff(old, new)
- cv.ShowImage('Diff', diff)
+ rect = cv.BoundingRect(diff)
+
+ display = cv.CreateImage(size, 8, 3)
+ cv.Copy(new, display)
+ cv.Rectangle(display,
+ (rect[0], rect[1]),
+ (rect[0] + rect[2], rect[1] + rect[3]),
+ (0, 255, 0),
+ 3,
+ 8,
+ 0)
+ cv.ShowImage('Diff', display)
# handle events, alow windows to refresh
k = cv.WaitKey(5)

0 comments on commit 886ed6b

Please sign in to comment.