Professional Documents
Culture Documents
Simplecv: "Exit " "CTRL+ D" "Clear" "Tutorial" "Example" "Forums" "Walkthrough"
Simplecv: "Exit " "CTRL+ D" "Clear" "Tutorial" "Example" "Forums" "Walkthrough"
+-----------------------------------------------------------+
Commands:
Usage:
Documentation:
SimpleCV:1> cam=Camera()
91
VIDIOC_QUERYMENU: Invalid argument
SimpleCV:2> img=cam.getImage()
SimpleCV:3> img.show()
SimpleCV:5:
92
OpenCV
OpenCV is an open source computer vision package based on Python. In this post, we are going
to detail the steps to install OpenCV on pcDuino. Two examples are given, one is used to capture
an image through the USB camera, the other is to use OpenCV to to face recognition.
Installation Steps:
93
$sudo easy_install PIL
#!/Users/brent/.virtualenvs/lumber/bin/python
import cv
cv.NamedWindow("w1", cv.CV_WINDOW_AUTOSIZE)
camera_index = 0
capture = cv.CaptureFromCAM(camera_index)
gx = gy = 1
def repeat():
global camera_index
frame = cv.QueryFrame(capture)
94
if grayscale:
frame = gray
if blur:
frame = g
frame = c
cv.ShowImage("w1", frame)
c = cv.WaitKey(10)
if c==ord('='): #in "n" key is pressed while the popup window is in focus
gx += 2
gy += 2
elif c == ord('-'):
gx = max(1, gx-2)
gy = max(1, gy-2)
elif c == ord('x'):
gx += 2
95