Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 18:14, 2 October 2007.

Take a photo at regular intervals

From Forum Nokia Wiki


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()
    img.save( path )
 
d = 0
 
while True:
    print "Wait"
    e32.ao_sleep(3)
    capture()
    print "Photo %d saved\n" %(d)
    d+=1
 
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()
    img.save( 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.

Related Discussions
Thread Thread Starter Forum Replies Last Post
GetThumbnails in 3rd Edition Devices!!! Priju Jacob Paul General Symbian C++ 7 2006-10-31 07:10
jpeg encoding soku123 Mobile Java Media (Graphics & Sounds) 3 2006-06-03 12:35
RTimer and CActiveObject problem diego972 General Symbian C++ 3 2007-05-11 05:24
Cannot start S40 ed.3 emulator from NetBeans 5.5 nvaranki Mobile Java Tools & SDKs 2 2007-05-28 10:16
Disable Options in default image viewer Kavit Patel General Symbian C++ 15 2007-11-08 20:53
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtopicQUqfnTopicZpythonQ
     qfnZtopicQUqfnTopicZseriesE5f60Q
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX