Capture isn’t just about writing data to disk. You can grab images as they come in and analyze or manipulate them.
A great example of “grabbing different” is Lisa Lippincott’s ScrollPlate, a demo shown at ADHOC 2004. She used her iSight camera as a scroll wheel, by holding up a Styrofoam plate with either a large green arrow (for up) or a large red arrow (for down). Her code presumably grabbed from the camera, looked at the grabbed image for an abundance of green or red, and scrolled the top window in response.
This example offers a simple motion detector, which will display an alarm message if two subsequent grabs are markedly different. The idea is that if the camera is not moving, a significant difference between two subsequent grabs indicates that something in view of the camera has moved.
In this case, what you want to do is to set up video-only capture,
but instead of saving the data to disk, you do a little bit of image
processing each time you
. Specifically, there is a
getSimilarity( ), which compares two images
(one as a
and the other as an
EncodedImage). Motion—objects entering,
exiting, or significantly moving within the camera’s
field of vision—can be understood as a significant difference
between two consecutive grabbed images.
See Chapter 5 for more on QTImage, QDGraphics, and EncodedImage.
Unfortunately, this requires jumping through quite a bit of QuickDraw hoops once ...