Permalink
Browse files

Added little visual aid to which corner to click in callibration mode

  • Loading branch information...
1 parent bc3da78 commit 9df521a08c8a12e6b8d1aa58d665394faaaac10f @antimatter15 antimatter15 committed Jan 17, 2010
Showing with 19 additions and 2 deletions.
  1. +1 −1 config_warp.py
  2. +17 −1 includes/graphics.py
  3. +1 −0 shinytouch.py
View
@@ -1,3 +1,3 @@
# Points to warp to
# top left, top right, bottom right, bottom left
-warp_points = [[217, 112], [499, 73], [489, 419], [188, 412]]
+warp_points = [[393, 122], [521, 47], [536, 400], [400, 353]]
View
@@ -30,4 +30,20 @@ def fps(self, frame, fps):
cvPutText(frame, "FPS: "+str(fps), cvPoint(5,height-10), font, cvScalar(255,255,255))
return frame
-
+
+ def callibration(self, frame, clicks):
+ global width, height
+ if clicks == 0:
+ point1 = cvPoint(0,0)
+ point2 = cvPoint(20,20)
+ elif clicks == 1:
+ point1 = cvPoint(width - 20, 0)
+ point2 = cvPoint(width, 20)
+ elif clicks == 2:
+ point1 = cvPoint(width - 20, height - 20)
+ point2 = cvPoint(width, height)
+ elif clicks == 3:
+ point1 = cvPoint(0, height-20)
+ point2 = cvPoint(20, height)
+ cvRectangle(frame, point1, point2, cvScalar(0,255,255), 20)
+ return frame
View
@@ -86,6 +86,7 @@ def handleclick(event, x, y, flags, param):
lastframe=cvCloneImage(preserved_frame)
elif mode==3: # Callibrate Mode
+ frame=gfx.callibration(frame, callib.clicks)
frame=gfx.draw_mode(frame,"Callibrate Mode")
frame=gfx.drawquad(frame)

0 comments on commit 9df521a

Please sign in to comment.