| Reply | « Previous Thread | Next Thread » |
|
Hi,
I'm trying to write a python script/app which can take pictures simultaneously from both the front and rear camera of the device if it has two devices or else just take picture from the rear camera. When I test with Nokia N70 2nd Ed Fp3 which has two cameras, I get error in line 43 saying 'TypeError: an Integer is required', only the rear camera is started and the picture is not saved. I do not have a picture with the same name at the location. Please help me debug... I'm getting error in this line: photo = _my_camera.take_photo('RGB',(640, 480),0,'none','auto','auto',1) My code is import appuifw, e32, camera import _camera import graphics _my_camera=_camera.Camera(0) #_finder_camera=_camera.Camera(0) no_of_cameras = _my_camera.cameras_available() #no_of_cameras = cameras_available() print no_of_cameras camera_position=0 if no_of_cameras>1: camera_position=1 print camera_position temp = int(camera_position) app_lock = e32.Ao_lock() #Define the exit function def quit(): #Close the viewfinder camera.stop_finder() #Release the camera so that other programs can use it camera.release() app_lock.signal() appuifw.app.exit_key_handler = quit #Function for displaying the viewfinder def vf(im): appuifw.app.body.blit(im) #Function for taking the picture def take_picture(): if _my_camera.taking_photo(): raise RuntimeError, "Photo request ongoing" #Take the photo #take_photo(mode='RGB16',size=(640, 480),zoom=0,flash='none', # exposure='auto',white_balance='auto',position=0): if no_of_cameras>1: #photo = camera.take_photo('JPEG_Exif', (2592, 1944),'none','0','auto','auto','1') photo = _my_camera.take_photo('RGB',(640, 480),0,'none','auto','auto',1) photo1 = _my_camera.take_photo('RGB',(640, 480),0,'none','auto','auto',0) #_my_camera.take_photo('RGB',(1024, 768),0,'none','auto','auto',1) else: photo = _my_camera.take_photo('RGB',(640, 480),0,'none','auto','auto',0) #photo = camera.take_photo('RGB', (1024, 768),camera_position) #photo = camera.take_photo('RGB', (640, 480),camera_position) #Save it at maximum quality photo.save(photo_savepath, quality = 100) photo1.save(photo_savepath1, quality = 100) #Save it #f = open(photo_savepath, "w") #f.write(photo) #f.close() #f = open(photo_savepath1, "w") #f.write(photo1) #f.close() #Restart the viewfinder camera.stop_finder() camera.start_finder(vf) photo_savepath = u"E:\\System\\Apps\\Python\\my\\photo.jpg" photo_savepath1 = u"E:\\System\\Apps\\Python\\my\\photo1.jpg" #This is the path and name for storing the photo #Set the application's body to Canvas appuifw.app.body = appuifw.Canvas() #Start the viewfinder camera.start_finder(vf) #Set the application's menu with the option to take the photo appuifw.app.menu=[(u"Take photo", take_picture)] #Wait for the user to request the exit app_lock.wait() Thanks and Regards Neeraj |
| itmediaconnect |
| View Public Profile |
| Find all posts by itmediaconnect |
|
Quote:
hi, i think the parameter sequence is wrong. may be like this: photo = _my_camera.take_photo('RGB',(640, 480),'none',0,'auto','auto',1) |
|
Hi xiaobu,
I changed the parameter sequence as you suggested to: photo = _my_camera.take_photo('RGB',(640, 480),'none',0,'auto','auto',1) but I'm still getting the same error at the same place ![]() Thanks Thanks and Regards Neeraj |
| itmediaconnect |
| View Public Profile |
| Find all posts by itmediaconnect |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Online
Forum Nokia Champion
|
|
|
Quote:
i will advice you that whenever you are posting any code in the dibo please use the code tags(#) avilable in your editor box so that we can easily get your code with indentation. ![]() enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| [defect report] carbide.cpp code formatter can't produce code conforming to s60 style | simo.salminen | Carbide.c++ IDE and plug-ins | 2 | 2008-10-27 11:56 |
| carbide-error | upendersolanki | Carbide.c++ IDE and plug-ins | 5 | 2008-02-06 12:09 |
| problems displaying video | gorsken | Mobile Java Media (Graphics & Sounds) | 6 | 2006-06-21 18:18 |
| Is it possible to use same source code for 7610 & 6600 Camera module? | ppiggy | General Symbian C++ | 1 | 2004-08-04 14:30 |