<p>I'd like to use the camera in my Macbook in a program. I'm fairly language agnostic - C, Java, Python etc are all fine. Could anyone suggest the best place to look for documents or "Hello world" type code?</p>

[{'answer_id': 57461, 'author': 'Chris Hanson', 'author_id': 714, 'author_profile': 'https://Stackoverflow.com/users/714', 'pm_score': 4, 'selected': True, 'text': '<p>The ImageKit framework in Leopard has an <a href="http://developer.apple.com/documentation/GraphicsImaging/Reference/IKImagePicker_Class/IKImagePicker_Reference.html#//apple_ref/occ/cl/IKPictureTaker" rel="nofollow noreferrer"><code>IKPictureTaker</code></a> class that will let you run the standard picture-taking sheet or panel that you seen in iChat and other applications.</p>\n\n<p>If you don\'t want to use the standard picture-taker panel/sheet interface, you an use the <a href="http://developer.apple.com/documentation/QuickTime/Conceptual/QTKitCaptureProgrammingGuide/" rel="nofollow noreferrer">QTKit Capture</a> functionality to get an image from the iSight.</p>\n\n<p>Both of these will require writing some Cocoa code in Objective-C, but that shouldn\'t really be an obstacle these days.</p>\n'}, {'answer_id': 57476, 'author': 'Derek', 'author_id': 5440, 'author_profile': 'https://Stackoverflow.com/users/5440', 'pm_score': 1, 'selected': False, 'text': '<p>There is a utility called isightcapture that runs from the unix command line that takes a picture from the isight camera and saves it.</p>\n\n<p>You can check it out at this web site: <a href="http://www.macupdate.com/info.php/id/18598" rel="nofollow noreferrer">http://www.macupdate.com/info.php/id/18598</a></p>\n\n<p>An example of using this with AppleScript is:</p>\n\n<p>tell application "Terminal"\n   do script "/Applications/isightcapture myimage.jpg"\nend tell</p>\n'}, {'answer_id': 58500, 'author': 'millenomi', 'author_id': 6061, 'author_profile': 'https://Stackoverflow.com/users/6061', 'pm_score': 2, 'selected': False, 'text': '<p>If you want to manipulate the camera directly from your code, you must use the QuickTime Capture APIs or the <a href="http://developer.apple.com/documentation/QuickTime/Conceptual/QTKitCaptureProgrammingGuide/Introduction/chapter_1_section_1.html" rel="nofollow noreferrer">Cocoa QTKit Capture</a> wrapper (much better).</p>\n\n<p>The only caveat is: if you use a QTCaptureDecompressedVideoOutput, remember that the callbacks aren\'t made on the main thread, but on the QuickTIme-managed capture thread. Use [someObject performSelectorOnMainThread:... withObject:... waitUntilDone:NO] to send messages to an object on the main thread.</p>\n'}, {'answer_id': 90642, 'author': 'Ken', 'author_id': 17320, 'author_profile': 'https://Stackoverflow.com/users/17320', 'pm_score': 0, 'selected': False, 'text': '<p>Quartz Composer is also a pleasant way to capture and work with video, when it\'s applicable.  There\'s a video input patch.</p>\n\n<p>Quartz Composer is a visual programming environment that integrates into a larger Cocoa program if need be.</p>\n\n<p><a href="http://developer.apple.com/graphicsimaging/quartz/quartzcomposer.html" rel="nofollow noreferrer">http://developer.apple.com/graphicsimaging/quartz/quartzcomposer.html</a></p>\n'}, {'answer_id': 2195738, 'author': 'meduz', 'author_id': 234547, 'author_profile': 'https://Stackoverflow.com/users/234547', 'pm_score': 1, 'selected': False, 'text': '<p>From a related question which specifically asked the solution to be pythonic, you should give a try to <a href="http://github.com/motmot/pycamiface" rel="nofollow noreferrer">motmot\'s camiface</a> library from Andrew Straw. It also works with firewire cameras, but it works also with the isight, which is what you are looking for.</p>\n\n<p>From the tutorial:</p>\n\n<pre><code>import motmot.cam_iface.cam_iface_ctypes as cam_iface\nimport numpy as np\n\nmode_num = 0\ndevice_num = 0\nnum_buffers = 32\n\ncam = cam_iface.Camera(device_num,num_buffers,mode_num)\ncam.start_camera()\nframe = np.asarray(cam.grab_next_frame_blocking())\nprint \'grabbed frame with shape %s\'%(frame.shape,)\n</code></pre>\n\n<p>It is used in this <a href="http://www.incm.cnrs-mrs.fr/LaurentPerrinet/SimpleCellDemo" rel="nofollow noreferrer">sample neuroscience demo</a></p>\n'}, {'answer_id': 4777011, 'author': 'meduz', 'author_id': 234547, 'author_profile': 'https://Stackoverflow.com/users/234547', 'pm_score': 0, 'selected': False, 'text': '<p>Another solution is <a href="http://opencv.willowgarage.com/documentation/python/cookbook.html" rel="nofollow">OpenCV+python</a> with a script like:</p>\n\n<pre><code>import cv\ncapture = cv.CaptureFromCAM(0)\nimg = cv.QueryFrame(capture)\n</code></pre>\n\n<p>Cannot do any simpler!</p>\n'}]
['https://Stackoverflow.com/questions/57424', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5346/']