Download Introduction to pcDuino
Transcript
if grayscale:
gray = cv.CreateImage(cv.GetSize(frame), frame.depth, 1)
cv.CvtColor(frame, gray, cv.CV_RGB2GRAY)
frame = gray
if blur:
g = cv.CreateImage(cv.GetSize(frame), cv.IPL_DEPTH_8U, frame.channels)
cv.Smooth(frame, g, cv.CV_GAUSSIAN, gx, gy)
frame = g
if grayscale and canny:
c = cv.CreateImage(cv.GetSize(frame), frame.depth, frame.channels)
cv.Canny(frame, c, 10, 100, 3)
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