×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Using the Camera

    Hello python brothers

    Can any one give me a code that can use the camera and click a piture automatically after every 5 mins and save it to a predefined folder in a the memory card.

    Thanks in advance

  2. #2
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: Using the Camera

    Hi fellow!

    From a webbrowser I would write that:
    Code:
    def capture():
        img = camera.take_photo()
        img.save( your_path )
    
    timer = e32.Ao_timer()
    
    # loop forever
    while True:
        timer.after( 300, capture )
    I didn't test it but it should be quite close to what you need.

    LFD
    Devices:
    Nokia E61 3rd Edition - pys60 1.4.0

    Tips and modules:
    http://www.lfdm.net/thesis

  3. #3
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: Using the Camera

    thanks
    It works fine to click one picture...But it doesnt take continous pics..
    Thats what i want..Is there anything that has to be done before the camera can take 2nd pic?

  4. #4
    Registered User
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    168

    Re: Using the Camera

    Quote Originally Posted by rabaf View Post
    thanks
    It works fine to click one picture...But it doesnt take continous pics..
    Thats what i want..Is there anything that has to be done before the camera can take 2nd pic?
    Do you mean that you want to save many pictures with different filenames?
    If so, you could use:
    Code:
    from time import ctime
    
    your_path="E:\\image "
    def capture():
        img = camera.take_photo()
        img.save( your_path + ctime + ".png") #this saves the picture in png format with a date in the filename :)
    Nokia E66
    PyS60 1.4.4 final

  5. #5
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    72

    Re: Using the Camera

    No i didnt want that.

    I want to take repetative pictures from the camera and dont care for the file names.But in the code lfd gave the camera can take only one pic..I want to take pics every 5 mins...

    LFD please suggest a solution..

  6. #6
    Super Contributor
    Join Date
    May 2006
    Location
    Oulu, Finland
    Posts
    622

    Re: Using the Camera

    Code:
    import e32, camera
    
    your_path = "D:\\tmp.png"
    
    def capture():
        img = camera.take_photo()
        img.save( your_path )
    
    i = 0
    
    # loop forever
    while True:
        print "Wait"
        e32.ao_sleep(3)
        capture()
        print "Picture %d saved\n" %(i)
        i+=1
    
    print "Finished"
    As I said it was not tested

    This solution works on my emulator.

    Cheers,

    LFD
    Devices:
    Nokia E61 3rd Edition - pys60 1.4.0

    Tips and modules:
    http://www.lfdm.net/thesis

Similar Threads

  1. Python for S60 1.4.0 released
    By jplauril in forum Symbian
    Replies: 43
    Last Post: 2009-05-24, 09:22
  2. Nokia N-Series Complete Model Line-Up
    By Dopod in forum General Development Questions
    Replies: 6
    Last Post: 2008-07-22, 20:16
  3. Camera API on Symbian 9.1 (Nokia N80)
    By srigans1 in forum Symbian Media (Closed)
    Replies: 4
    Last Post: 2007-10-20, 05:31
  4. N73 camera can't start
    By nemotse in forum Symbian
    Replies: 1
    Last Post: 2006-09-17, 14:05
  5. embedable camera application??
    By zhengyu97 in forum Symbian
    Replies: 0
    Last Post: 2005-04-22, 11:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×