Page 1 of 1

Graphical interface for raspistill

Posted: Sat Jun 22, 2013 4:49 pm
by sixbacon
Here is simple graphical interface for testing out some of the options when taking photos on the Raspberry Pi camera. Written in python 2.7, it collects the options required, calls the command line program “rapistill” and then loads the image. It works when running headless over ssh – a main driver for writing it. The command line used is shown underneath the image.

Image
Program available at

https://github.com/sixbacon/RPICameraGUI.git

Run it in IDLE , but you may have to load the wx module.

You can run it from a terminal session by typing
“ python RPiCameraGUI.py”

Remember to check the relevant box, if you want to use a setting.

Note if you specify a small photo size, the program will scale it up the fit. It will be pixelated though.

The images are stored in the same directory as the program resides. You can move them and rename them with other programs.

The rotation buttons operate on the image in memory, not the camera, and are useful when setting it up.

It is a first attempt - no detection of camera problems, and not all the options are available. If you like it, improve it or suggest improvements. Python experts will hate the code, I might tidy that up. If you want to fiddle with the program on another computer, comment out the subprocess call in the TakePic method and have a jpg called “image.jpg” available for it to load.

Re: Graphical interface for raspistill

Posted: Sat Jun 22, 2013 5:17 pm
by rkinch
sixbacon wrote:It works when running headless over ssh – a main driver for writing it.
Nice. Thank you.

Re: Graphical interface for raspistill

Posted: Sun Jun 23, 2013 12:48 am
by mmiller
I've tried the following steps:

Code: Select all

$ wget https://raw.github.com/sixbacon/RPICameraGUI/master/RPICameraGUI.py
$ sudo apt-get install -y python-wxtools
$ python RPiCameraGUI.py
but get an error about X.

Code: Select all

Unable to access the X Display, is $DISPLAY set properly?
I can run this via a remote desktop connection but how do I get the GUI up via SSH?

Re: Graphical interface for raspistill

Posted: Sun Jun 23, 2013 9:06 am
by sixbacon
I run tightvnc to access the RPi remotely.
Have you checked RPiCameraGUI.py program is on you RPi?
Open IDLE on the RPi and load RpiCameraGui.py.
Have you checked the wx module is installed?

I want to be sure I have loaded the program correctly so it is easily available, so please let me know how get on.

Hope this helps.

Re: Graphical interface for raspistill

Posted: Sun Jun 23, 2013 9:38 am
by mmiller
I'm not using Tight VNC but xrdp and Win7 RemoteDesktop as per http://wiki.raspberrytorte.com/index.ph ... mote_Login.
Installation of wx is covered by the toolset using sudo apt-get install -y python-wxtools as above
Execution in IDLE works well.
When running from the CLI, the only feedback I get is 'Xlib: RAND missing', but it doesn't affect functionality and I assume is something to do with xrdp.

A very nice tool, good work.

Addition of drop downs for the AWM, metering and Image effects would complete the coverage? I'd like to help but your code is beyond my 'ken' at this time.

Re: Graphical interface for raspistill

Posted: Sun Jun 23, 2013 2:38 pm
by poing
Looks nice, I'll have a try. But you should definitely add the -ev option to adjust exposure. The manual says it works from -10 to +10 but I found it works from -25.

Re: Graphical interface for raspistill

Posted: Sat Jun 29, 2013 12:16 pm
by sharix
I get an error when trying to run this:

Code: Select all

Traceback (most recent call last):
  File "RPICameraGUI.py", line 9, in <module>
    from wx.lib.pubsub import Publisher
ImportError: No module named lib.pubsub

Re: Graphical interface for raspistill

Posted: Mon Sep 09, 2013 8:56 pm
by sixbacon
Updated version of software on Github, see link at the top. More features implemented -

exposure compensation
automatic white balance
image effects

and rotation has been updated to give the four rotations actually implemented.

It just takes a few minutes to explore all the features and the comand line instruction for raspistill used to generate each photo is shown.

Re: Graphical interface for raspistill

Posted: Tue Sep 10, 2013 2:53 pm
by rasphoto
HI, I am pretty new to all of this so hope you can bear with me. I tried in the terminal:
wget https://raw.github.com/sixbacon/RPICame ... meraGUI.py
then: apt-get install -y python-wxtools
Finally I entered in my home directory: python RPiCameraGUI.py
But I get this message: python: can't open file 'RPiCameraGUI.py': [Errno 2] No such file or directory

Any idea what I am doing wrong?

thanks.

Re: Graphical interface for raspistill

Posted: Wed Sep 11, 2013 9:58 am
by technoducky
rasphoto wrote:HI, I am pretty new to all of this so hope you can bear with me. I tried in the terminal:
wget https://raw.github.com/sixbacon/RPICame ... meraGUI.py
then: apt-get install -y python-wxtools
Finally I entered in my home directory: python RPiCameraGUI.py
But I get this message: python: can't open file 'RPiCameraGUI.py': [Errno 2] No such file or directory

Any idea what I am doing wrong?

thanks.
Go to your home directory before you execute wget, although by default you start a new terminal there anyway.

Re: Graphical interface for raspistill

Posted: Fri Sep 13, 2013 12:39 pm
by mikerr
rasphoto wrote:HI, I am pretty new to all of this so hope you can bear with me. I tried in the terminal:
wget https://raw.github.com/sixbacon/RPICame ... meraGUI.py
then: apt-get install -y python-wxtools
Finally I entered in my home directory: python RPiCameraGUI.py
But I get this message: python: can't open file 'RPiCameraGUI.py': [Errno 2] No such file or directory

Any idea what I am doing wrong?

thanks.
Capital letters are important - you're using a lower case i - should be RPICameraGUI.py

A tip is to press tab key at the terminal after typing the first few letters (RP...) as it will auto-complete with the correct filename.

Re: Graphical interface for raspistill

Posted: Fri Sep 13, 2013 2:15 pm
by K.Kong
I get an error: Xlib: extension "RANDR" missing on display ":10.0" but otherwise appears to work fine.

I am running it in LXDE via RDP. I don't get to see any preview. Is there supposed to be a preview?

Thanks for the great work.

Re: Graphical interface for raspistill

Posted: Mon Sep 16, 2013 7:25 pm
by lingon
sixbacon wrote:Updated version of software on Github, see link at the top. More features implemented -

exposure compensation
automatic white balance
image effects

and rotation has been updated to give the four rotations actually implemented.

It just takes a few minutes to explore all the features and the comand line instruction for raspistill used to generate each photo is shown.
Thanks, this application is very nice! Could you please also add the options
-ISO, --ISO : Set capture ISO
-mm, --metering : Set metering mode (see Notes)
The exposure time from the EXIF data would be interesting to see on the image using jhead or possible also all of the EXIF data

Re: Graphical interface for raspistill

Posted: Thu Sep 19, 2013 1:11 am
by TideMan
The GUI worked fine for me straight out of the box, running headless using TightVNC.
It's fun trying out all the options to change and improve the image.
Excellent work!!

Re: Graphical interface for raspistill

Posted: Sat Sep 21, 2013 7:49 pm
by javahaxxor
for those wanting to run anything graphical over ssh, you need to enable X11 tunnelling when connecting with SSH as such:

Code: Select all

ssh -Y <user@hostname>
apart from this you need to be running some kind of X server on your workstation. If you're running Linux, you're set. If you're running OSX, I You can install XQuartz (don't know if it works out of the box)
and if You're running Windows, there's a ton of X servers, such as Cygwin/X from the Cygwin distribution.

Then you can execute whatever GUI application You might want to , such as midori, chromium, etc etc. Fbi doesn't work of course but that's kindof expected. The application will start on the remote Pi, but the graphical output will run on your local workstation in an X window

Re: Graphical interface for raspistill

Posted: Sat Jul 26, 2014 9:10 am
by christianz
Hi sixbacon!

Thanks for your gui program! It's really helpful.

And it animated me to dig into programming Python with graphical environment.

So I forked your program and refactored it a bit.

Then I added a timer function to be able to take pictures every n seconds.
It's already working but not yet mature. I need to learn more about wxPython...

My code is available here: https://bitbucket.org/chriz/rpicameragui

Regards

Christian

Re: Graphical interface for raspistill

Posted: Fri Dec 29, 2017 3:56 pm
by xxKingCreeperxx
I get this error every time I run the file:

Code: Select all

pi@TollyPi:~ $ python RPICameraGUI.py
Traceback (most recent call last):
  File "RPICameraGUI.py", line 12, in <module>
    from wx.lib.pubsub import Publisher
ImportError: cannot import name Publisher
pi@TollyPi:~ $ 

Re: Graphical interface for raspistill

Posted: Fri Jan 12, 2018 8:28 pm
by itsmedoofer
xxKingCreeperxx wrote:
Fri Dec 29, 2017 3:56 pm
I get this error every time I run the file:

Code: Select all

pi@TollyPi:~ $ python RPICameraGUI.py
Traceback (most recent call last):
  File "RPICameraGUI.py", line 12, in <module>
    from wx.lib.pubsub import Publisher
ImportError: cannot import name Publisher
pi@TollyPi:~ $ 
I'm seeing this as well, any ideas ?

Re: Graphical interface for raspistill

Posted: Fri May 18, 2018 10:34 am
by netlinker
There has been a change in WxPython. Therefore the Code has to be changed.
You have to open the Python file in the editor of your choice and modify line 12 to:

Code: Select all

from wx.lib.pubsub import pub as Publisher
and you have to change each occurrence of

Code: Select all

Publisher().
to

Code: Select all

Publisher.
.

This works for me kind of. Only my layout is a bit strange now.

Hope this helps.