Hardware Reference
In-Depth Information
Prepare for lift off
We will get started by mouning a camera on top of the sink and connecing it to an
overhead camera, as shown in the following image:
An overhead camera on top of the sink
Engage thrusters
1.
We will get started by imporing the OpenCV module:
import time
import sys
import cv2.cv as cv
2. We will iniialize the camera to capture frames:
capture = cv.CaptureFromCAM(0)
3. Ater iniializaion, we will grab a frame for processing:
im = cv.QueryFrame(capture)
4. We'll convert the image to grayscale for image processing and feature detecion:
gray = cv.CreateImage(cv.GetSize(im),8,1)
edges = cv.CreateImage(cv.GetSize(im),cv.IPL_DEPTH_8U,1)
cv.CvtColor(im,gray,cv.CV_BGR2GRAY)
 
Search WWH ::




Custom Search