Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Archived:Take a photo at regular intervals using PySymbian

From Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Created: cyke64 (02 Oct 2007)
Last edited: hamishwillee (14 Jun 2013)

Here is a code that will help to take photos from a camera at regular intervals.This interval can be set as required by the developer.

import e32, camera
path = "c:\\tmp.jpg"
def capture():
img = camera.take_photo() path )
d = 0
while True:
print "Wait"
print "Photo %d saved\n" %(d)
print "Session Ended"

The loop in the code is a forever loop.This loop can be modified according to the condition required by the developer. The above code clicks a new image from the camera at a regular interval of 3 seconds. This interval can also be modified by changing the argument in the statement

e32.ao_sleep(3)  Which is a delay introduced.

Also It can be observed that the images are saved with the same name with the above code.

Also provision can be made to save the images with different name.There are several formats for naming.

One such format is to save the image with the date in the file name.The following code an be used for the same.

from time import ctime
your_path="C:\\image "
def capture():
img = camera.take_photo() your_path + ctime + ".jpg")
#this saves the picture in jpg format with a date in the filename

Both the codes can be appropriately combined to have the required code to capture photos from the camera at regular intervals and to save them to a desired location with the desired different file name.

This page was last modified on 14 June 2013, at 05:11.
17 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.