×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    8

    camera.take_photo() latency and resolution

    I working on an N95 application that needs to snap high-res photos and save to flash as quickly possible in a continuous loop.

    Here's my initial, PyS60-newbie approach at testing the N95/Python's capabilities:
    Code:
    for i in range( 10 ):
    	image = camera.take_photo( 'RGB16', (1024,768) )
    	image.save( "E:\test" + str(i) + ".jpg")
    So, there are a couple of problems with this approah:
    • Latency is huge: Captures an image from the camera about every 8 seconds. How might I improve this latency?
    • Resolution is low: Nothing above 1024x768. I read elsewhere that I can do better if I capture in 'JPEG_Exif' mode, but that doesn;t seem to be the case. How can I get higher res captures?


    If need be, I'm willing to write extension modules in C++.

    Thanks!
    Jeremy

  2. #2
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    209

    Re: camera.take_photo() latency and resolution

    Quote Originally Posted by Holy Samosa View Post
    • Latency is huge: Captures an image from the camera about every 8 seconds. How might I improve this latency?
    You might want to tune the "cam_take_photo" function in "cameramodule.cpp" - the reinitialization of the camera object is partly the reason for the slowness.

    If I remember correctly the reason for the reinitialization was the support for multiple cameras - without the reinitialization you could not change the camera (front, back) between the "take_photo" calls. Better solution would be to have a "Camera" type for a specific camera.

    Quote Originally Posted by Holy Samosa View Post
    • Resolution is low: Nothing above 1024x768. I read elsewhere that I can do better if I capture in 'JPEG_Exif' mode, but that doesn;t seem to be the case. How can I get higher res captures?
    The Python application in N95 needs to be in landscape mode to capture higher resolution images. Prior "camera" import, switch to landscape mode (see "Application.orientation") and you'll be able to utilize higher resolution.

    Hope this helps.

  3. #3
    Registered User
    Join Date
    Jun 2007
    Posts
    8

    Re: camera.take_photo() latency and resolution

    Thanks for the information on tuning the camera.take_photo() function. I'll give it a shot!

    Unfortunately, setting the application orientation to landscape prior to importing camera doesn't seem to yeild higher resolutions.

    Code:
    >>> appuifw.app.orientation = 'landscape'
    >>> import camera
    >>> camera.image_sizes()
    [(1024, 768), (640, 480)]
    Alas, still stuck at 1 megapixel.

  4. #4
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    209

    Re: camera.take_photo() latency and resolution

    Quote Originally Posted by Holy Samosa View Post
    Unfortunately, setting the application orientation to landscape prior to importing camera doesn't seem to yeild higher resolutions.

    Code:
    >>> appuifw.app.orientation = 'landscape'
    >>> import camera
    >>> camera.image_sizes()
    [(1024, 768), (640, 480)]
    Alas, still stuck at 1 megapixel.
    I'll check this later (I don't have an N95 near right now), but some earlier findings on this issue I had written down:

    ""The image sizes works perfectly when you first change the orientation (the
    application changes into landscape orientation):

    Code:
    >>> import appuifw
    >>> appuifw.app.orientation='landscape'
    >>> import camera
    >>> camera.image_sizes("JPEG_Exif")
    [(2592, 1944), (2048, 1536), (1600, 1200), (1024, 768), (640, 480)]
    >>>
    This happens in N95 with:

    OS: 2.00(1167)
    SW: V 10.0.014 06-03-07 RM-159

    Furthermore, it seems currently that you can only take higher sized pictures (above (1600,
    1200)) if you are using other than the self-signed PyS60. This would indicate
    that there is (unnecessary) capability checking and degrading of picture quality
    happening in the camera dll.""

    The last section is questionable, I am not sure if this is really so - Are you using a self-signed version and if yes, do you get more image sizes with devcert signing?

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    17

    Re: camera.take_photo() latency and resolution

    Hi, i have the same problem with the latency, did you be able to result that problem?, i am thinking using threads

  6. #6
    Registered User
    Join Date
    Jul 2007
    Location
    France, Marseille
    Posts
    23

    Re: camera.take_photo() latency and resolution

    We have also the same problem.

    I noticed few things (I don't know if it helps) :
    - On the 2nd edition there are no latency (N70 device)
    - On the 3rd edition there are 3 seconds of latency (Nokia 6120)
    - On the 3rd edition with autofocus capabilities, there are 6 seconds of latency (N73, N95)

    In C++ the program are fast on the same device, so I think the problem is inside the python library. Maybe there is a different JPG algorithm ?

    We tried to write a C++ wrapper but it didn't work.

    I don't think thread will help.

    I'm also very interested in the solution.

  7. #7
    Nokia Developer Champion
    Join Date
    Jun 2007
    Posts
    480

    Re: camera.take_photo() latency and resolution

    Code:
    >>> import appuifw
    >>> appuifw.app.orientation='landscape'
    >>> import camera
    >>> camera.image_sizes("JPEG_Exif")
    [(2592, 1944), (2048, 1536), (1600, 1200), (1024, 768), (640, 480)]
    >>>
    Is there anything else I should do to get these resolutions ? I'm using PyS60 1.4.3 and 1.4.4 from the PyS60 website. I used that script and could not get more than 1600x1200.

    I tested with (same results with all):

    N95
    v 20.0.015
    13-11-07
    rm-159
    n95 (01.01)

    N95 8G
    v 1.2.011
    28-01-08
    rm 421
    nokia n95 (a6.01)

    N82
    v 20.0.062
    28-02-08
    rm-313
    nokia n82 (01.01)


    Also, is there any way to get the image sizes for the secondary camera ?

  8. #8
    Registered User
    Join Date
    Jun 2008
    Posts
    45

    Re: camera.take_photo() latency and resolution

    I am also interested in this.
    Can anyone advise what can be the problem?
    I am using N95 8Gb and I can get max 1600x1200.

  9. #9
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: camera.take_photo() latency and resolution

    Quote Originally Posted by lpvalente View Post
    Code:
    >>> import appuifw
    >>> appuifw.app.orientation='landscape'
    >>> import camera
    >>> camera.image_sizes("JPEG_Exif")
    [(2592, 1944), (2048, 1536), (1600, 1200), (1024, 768), (640, 480)]
    >>>
    Is there anything else I should do to get these resolutions ? I'm using PyS60 1.4.3 and 1.4.4 from the PyS60 website. I used that script and could not get more than 1600x1200.

    I tested with (same results with all):

    N95
    v 20.0.015
    13-11-07
    rm-159
    n95 (01.01)

    N95 8G
    v 1.2.011
    28-01-08
    rm 421
    nokia n95 (a6.01)

    N82
    v 20.0.062
    28-02-08
    rm-313
    nokia n82 (01.01)


    Also, is there any way to get the image sizes for the secondary camera ?
    Hello Luis

    Could you try with the new advanced pycamera module if you have the same problems ?

    Instructions use about it can be found HERE

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

Posting Permissions

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