Python OpenCV: Detecting a general direction of movement?
问题 I'm still hacking together a book scanning script, and for now, all I need is to be able to automagically detect a page turn. The book fills up 90% of the screen (I'm using a cruddy webcam for the motion detection), so when I turn a page, the direction of motion is basically in that same direction. I have modified a motion-tracking script, but derivatives are getting me nowhere: #!/usr/bin/env python import cv, numpy class Target: def __init__(self): self.capture = cv.CaptureFromCAM(0) cv