I've attached a Python camera that will take photos over the full set of exposure compensation values.
It's modified from test_viewfinder.py that comes with the Nokia CV camera library. I added support for multiple exposure compensations by selecting "HDR" from the exposure comensation menu. I also added support for switching the flash on/off. Images are saved to E:\Images.
At high resolution, it takes a while to run through all the exposures.
This is my first non-"hello world" work in Python, so let me know if anything doesn't work correctly, please 😊
Attachments:
hdr_viewfinder.zip (2 KB)
Not running here.
Are there other python scripts I need to be running?
edit:
Ok got it working. Script seems slow. Dont know what's going on when its taking pictures.
It needs PyCameraLib from the Nokia CV project (which I assume you now have).
It is slow, but that's because it's taking (and transferring to memory card) 17 pictures (0.25 steps from -2 to +2). I can add more HDR settings to do fewer steps (e.g. every 0.5, and 1.0 steps). You can also reduce the resolution to speed it up.
I agree that I (or someone!) should update it to show more information about what it's doing. As I said, it's my first Python work. PyCameraLib has no documentation either, and some methods (such as the flash) weren't used in any samples, so I figured that out myself.
I'll take a look at making some improvements as soon as I can. Thanks for the feedback - it was your post on HDR with the N95 that initially inspired me, as I don't have a bluetooth keyboard!
Hi,
I've been looking for something like this for ages, so thanks!
But I can't get it to work...
I've got Python on the N95, working, and pycamera, working - but when I run hdr_viewfinder, I get the error message:
SymbianError: [Errno -1]
KErrNotFound
Any ideas? Bearing in mind that today is the first day that I have used Python, and have absolutely NO programming experience 😊
Thanks again!
Hi, I'll try to help.
First, did you install the PyCameraLib from NokiaCV available here.
They need to be installed to internal memory, unless you tweak a script.
Then, test the scripts that come with the package (e.g. test_viewfinder.py).
If they work, I'll probably need to see more information on the error, please!
Ah, I was installing to the memory card, not the phone memory. Many thanks for your help!
Erm... okay... so I have got the script working... kinda.
I run the script, everything is great, the exposure is set to HDR... it takes some photos (max so far has been five), then the script shuts down and Python exits. I thought maybe it was something to do with the fact that my images are stored to the memory card, so changed that, but it did the same.
I put the flash on, but it did the same.
No error messages, just turns itself off.
Any ideas?
Don't worry - sorted now - the images were set at the highest resolution, which I don't think it liked. I lowered the resolutin considerably, and it worked - now I'm going to see how high I can go - ooh, the thrills...
I think that it's probably running out of memory somewhere - I've had this issue before as well (sometimes at around picture 12). I'll see if I can track it down - not sure if there's anything I can do about it (depends if it's within the library, or the script.
I've changed the script to be able to do less different exposures (17 is a bit many, really!) and I'll try and see if I can get it to show more information about what it is doing while taking photos - a preview picture, or at least some on-screen information.
I'll upload it again when I've had a bit of time to test. Thanks for the feed back and I hope that someone finds it useful!
I've updated it with more features (showing what's happening, allowing for different size steps of exposure compensation).
It doesn't seem to be very stable, though, often causing Python to exit with no error. I imagine that it's related to the native library, but with so little documentation, it's hard to tell.
Attachments:
hdr_viewfinder.zip (2 KB)
Hi there,
I installed python and the scripts and the pycamlib (just 1 sis file) and both the ncvlib.sisx and nokiacvimage.sisx.
I installed them on the internal memory.
When I run python and run the test viewfinder script or the pycamera script I get the error: importerror:no module named pycamera.
i have firmware 30.0.015 on my n95
Any ideas?
i found my problem.
I was using python 1.9.4
uninstalled that and installed 1.45 and now works.:redface:
Hi Argh
Did you get any further with your python script for AEB?- I have tried it in various screen size formats on my N95 with little success - I only seem to get 2 exposures before it crashes - and it does not seem to work at all on latest version of python.I have now upgraded to N97 and it would be awesome to create hdr - well AEB shots on phone.Any way thanks for all your efforts so far.I have not yet ran on N97 - I kmow very little about python and wonder if it will run better on N97 - suppose the best way is to try!
Thanks again for your efforts - Boothy
Edit:I had noted previous post by badchad - why does it not work on later version?
Hi Guys
I have figured how to tweak settings (duh!) and it seems to work better - when using are you supposed to focus with camera first then run script to create bracketed exposures ?
On format type - every format except exif is in red and will not take exposures unless on exif format - is this correct ?
Thanks again in advance
Boothy
PS I will try on N97 later
Hi Boothy.
Sorry, I'm afraid that I can't find my N95 charger at the moment and it doesn't seem to hold charge very well when it's off (my older Windows Mobile devices still turn on).
I don't have any other Symbian devices right now, but if I do get another I will look back at this. It appeared to be a memory leak / bug in the pycamera library.
Does test_viewfinder.py that comes with PyCamLib work?
boothy wrote:Edit:I had noted previous post by badchad - why does it not work on later version?
The native PyCamLib library probably needs to be recompiled for newer Python versions.
Hi Argh
Yes both scripts seem to work on the N95 the main script works better in lower res (1600x1200) - I can get three continuous shots - higher res two images max.I am getting used to app variables but do not understand what the changing to red font on listed options means?
I have tried installing to N97 with python 1.45 - however I try to install pycamera to phone memory the apps manager list it as mass memory.When I ran on N97 it appeared in smaller screen view (top righthand quarter of screen in landscape) and did little else - had to reboot phone - with the camera lens cover operating camera makes it a little more complex than N95.I do not know if this is a python issue with s60 5th edition?
I must try in daylight on N95 to give a good test - within your script - if options turns to a red font - does this mean it is not available?
Thanks again
Boothy
boothy wrote:
I must try in daylight on N95 to give a good test - within your script - if options turns to a red font - does this mean it is not available?
Yes. It tries to apply the setting and if pycamlib returns an error the label turns red.
As mentioned in the first post, this app is really just a hack of test_viewfinder.py (which comes with pycamlib) to automate taking photos over multiple exposures. I was really hoping that someone with more Python experience would improve it, but they haven't (at least not publicly). I'm thinking that the error is unresolvable as Nokia haven't released the source to pycamlib which I believe might contain the issue.
Hello, this is what i was searching for!
But I have one problem, it doesn't work with my n85. I start the hdr_viewfinder.py and it seems like it works, with left and right i can set another exposure compensation, can change the flash-option, quality, ISO and so on. But if I try to make a picture it doesn't work, python doesn't crash, my mobile only doesn't respond with the select_button.
The ISO-Setting is in red font, maybe that has something to do with the problem, can someone change this in the hdr_viewfinder or is it also unresolveable like the problem from boothy?
test_viewfinder makes a picture after I push the select-button (it flashs shortly, then the picture is freezing a few seconds and after that I can make another picture), but I dont know where it is saved,
while starting test_pycamera it makes automatic a picture and save it into C:\Data
Would be great if someone can help me!
Hi!
Cool script, but not optimized.
Made the following adjustments:
1) All the names were from a single time in the filename - fixed.
2) all written to the disk E: \ \ did on D: \ \ (in memory) - removes any program from the root of drive D.
I would like to make an array to store images and record call from the menu.
How do lay.
And enjoy the latest version 🙄
translated from Russian - Google translator. Sorry😉