sixbacon
Posts: 13
Joined: Sun Jan 22, 2012 4:22 pm

Graphical interface for raspistill

Sat Jun 22, 2013 4:49 pm

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.
sixbacon

User avatar
rkinch
Posts: 72
Joined: Sun Jun 02, 2013 7:19 am
Location: Palm Beach County, Florida USA
Contact: Website

Re: Graphical interface for raspistill

Sat Jun 22, 2013 5:17 pm

sixbacon wrote:It works when running headless over ssh – a main driver for writing it.
Nice. Thank you.

User avatar
mmiller
Posts: 22
Joined: Wed Nov 16, 2011 8:38 pm
Contact: Website

Re: Graphical interface for raspistill

Sun Jun 23, 2013 12:48 am

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?
  • Slowly spreading the joy the RaspberryPi way!
    http://raspberrytorte.com/ http://wiki.raspberrytorte.com https://github.com/raspberrytorte

sixbacon
Posts: 13
Joined: Sun Jan 22, 2012 4:22 pm

Re: Graphical interface for raspistill

Sun Jun 23, 2013 9:06 am

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.
sixbacon

User avatar
mmiller
Posts: 22
Joined: Wed Nov 16, 2011 8:38 pm
Contact: Website

Re: Graphical interface for raspistill

Sun Jun 23, 2013 9:38 am

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.
  • Slowly spreading the joy the RaspberryPi way!
    http://raspberrytorte.com/ http://wiki.raspberrytorte.com https://github.com/raspberrytorte

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: Graphical interface for raspistill

Sun Jun 23, 2013 2:38 pm

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.

sharix
Posts: 200
Joined: Thu Feb 16, 2012 11:29 am
Location: Slovenia

Re: Graphical interface for raspistill

Sat Jun 29, 2013 12:16 pm

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

sixbacon
Posts: 13
Joined: Sun Jan 22, 2012 4:22 pm

Re: Graphical interface for raspistill

Mon Sep 09, 2013 8:56 pm

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.
sixbacon

rasphoto
Posts: 14
Joined: Tue Aug 27, 2013 9:14 pm
Location: Mexico
Contact: Website

Re: Graphical interface for raspistill

Tue Sep 10, 2013 2:53 pm

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.

technoducky
Posts: 62
Joined: Sat Jan 26, 2013 7:29 pm
Contact: Website

Re: Graphical interface for raspistill

Wed Sep 11, 2013 9:58 am

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.

User avatar
mikerr
Posts: 2501
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Graphical interface for raspistill

Fri Sep 13, 2013 12:39 pm

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.

K.Kong
Posts: 35
Joined: Fri Oct 26, 2012 1:55 am

Re: Graphical interface for raspistill

Fri Sep 13, 2013 2:15 pm

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.

lingon
Posts: 115
Joined: Fri Aug 26, 2011 7:31 am

Re: Graphical interface for raspistill

Mon Sep 16, 2013 7:25 pm

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

User avatar
TideMan
Posts: 203
Joined: Fri Jun 22, 2012 8:08 am
Location: ChCh, NZ

Re: Graphical interface for raspistill

Thu Sep 19, 2013 1:11 am

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!!
If you wish in this world to advance, your merits you're bound to enhance.
You must stir it and stump it and blow your own trumpet, or trust me you haven't a chance.
Ruddigore, G&S

javahaxxor
Posts: 9
Joined: Fri Sep 20, 2013 8:38 am

Re: Graphical interface for raspistill

Sat Sep 21, 2013 7:49 pm

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

christianz
Posts: 3
Joined: Sun Mar 30, 2014 6:42 pm
Location: Germany

Re: Graphical interface for raspistill

Sat Jul 26, 2014 9:10 am

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

Return to “Camera board”

Who is online

Users browsing this forum: Bing [Bot] and 12 guests