This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import opencv | |
#this is important for capturing/displaying images | |
from opencv import highgui | |
import pygame | |
import sys | |
camera = highgui.cvCreateCameraCapture(0) | |
def get_image(): | |
im = highgui.cvQueryFrame(camera) | |
# Add the line below if you need it (Ubuntu 8.04+) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local sutil = {} | |
function sutil.getchar(ttyfile) | |
return ttyfile:read(1) | |
end | |
function sutil.readall_timeout(ttyfile, n, time) | |
local data = "" | |
local ret = true | |
local ctr = 0 |