ALPhotoCapture Tutorial

On this page

NAOqi Vision - Overview | API | Tutorial


This tutorial explains how to run the ALPhotoCapture functions using Python.

Getting a proxy to ALPhotoCapture

After some initialization steps, we first instantiate a proxy to the ALPhotoCapture module.

             # This test demonstrates how to use the ALPhotoCapture module.
# Note that you might not have this module depending on your distribution
import os
import sys
import time
from naoqi import ALProxy

# Replace this with your robot's IP address
IP = ""
PORT = 9559

# Create a proxy to ALPhotoCapture
  photoCaptureProxy = ALProxy("ALPhotoCapture", IP, PORT)
except Exception, e:
  print "Error when creating ALPhotoCapture proxy:"
  print str(e)


Taking pictures

             # Take 3 pictures in VGA and store them in /home/nao/recordings/cameras/

photoCaptureProxy.takePictures(3, "/home/nao/recordings/cameras/", "image")

# This call returns ['/home/nao/recordings/cameras/image_0.jpg', '/home/nao/recordings/cameras/image_1.jpg', '/home/nao/recordings/cameras/image_2.jpg']