pyHugin: A Gui exercise in python/pyside

177 views
Skip to first unread message

Harry van der Wolf

unread,
Aug 27, 2011, 5:27:11 PM8/27/11
to hugi...@googlegroups.com
Hi all,

After all the discussions about building a Gui in python, I decided for myself to simply try it and use PySide (1) as graphical part.
I knew absolutely nothing of python and neither of pyside but I felt an itch, so I scratched.

PySide is QT based and I knew a little of QT due to my own KImageFuser (2).  Next to that I worked a little in the QT designer as (former) OSX maintainer of avidemux (3) for the Qt version (my nickname is surfer, something I did intensely many years ago).
So my basic knowledge of QT is the reason I have chosen for pyside instead op wxpython.

I made a super simple Assistant in python/pyside. "super simple"  referring to my work (really a work in progress), not to the user friendliness.
Some screen prints can be found on my website (4).

What did I build:
- Assistant tab, Load images button:
-- loading images
-- writing a basis pto
-- run cpfind (with celeste when checked on the preferences tab)
-- run cpclean (when checked on the preferences tab)
-- run autooptimiser (with photometric optimization checked on the preferences tab)
- Assistant tab, create panorama button
-- run nona (doesn't work on windows, don't know why but I assume something with forward/backward slashes)
-- run enblend (doesn't work on windows as nona doesn't create intermediate tiffs, when copying same tiffs in workdir it works).
- Images tab loads images and displays them correctly (was easy to copy from my KImagefuser, but you need pyside>=1.0.5)

What works:
- Assistant on Linux and Mac OS X. second step: create panorama (nona and enblend) doesn't work on windows
- Load images tab, but not yet the image display and image info button
- Preferences tab with sub tabs: works, but I wanted to store the settings in a SQLite db. Creating and inserting works, retrieving not.

Flimsy:
- progress bar and progress text is clumsy as I lack events programming skills.

What doesn't work:
- Menu on MacOSX (known bug: that's why I built the preferences as a tab instead of a menu)
- Strong in sqlite db.
- nona on windows.

What do you need:
Linux (in my case Ubuntu):
- install hugin (launchpad for example), python, pyside and Qt4

Windows:
- download python (www.python.org), pyside (1) and Qt4 (5), the libraries not the SDK.

Mac OSX:
- If you have macports: install python, pyside for your version and qt4-mac (takes looong)
- Otherwise: download python (www.python.org), pyside (1) and Qt4 (5), the libraries not the SDK.


Being completely blank w.r.t. python/psyide, it took me about 12 hours or so to build this really basic thing and now I'm done for a while.
If you want to try it, simply unpack the attached tgz.
If you want to improve it, please do so.
note: when moving between windows and unix, always take care to do a dos2unix step from windows to unix otherwise your scripts don't work anymore.

I hesitated to create a folder in the trunk as I didn't want to create an experimental branch for only 20KB of files.
For the time being I left it out as the community might decide to move into a completely different direction.


Harry

(1): <http://www.pyside.org/>
(2): <http://panorama.dyndns.org/index.php?lang=en&subject=KImageFuser&texttag=KImagefuser>
(3): <http://avidemux.berlios.de/index.html>
(4): <http://panorama.dyndns.org/pyhugin/>
(5): <http://qt.nokia.com/downloads/>
pyHugin-0.0.1.tgz

Harry van der Wolf

unread,
Aug 28, 2011, 3:18:26 AM8/28/11
to hugi...@googlegroups.com


2011/8/27 Harry van der Wolf <hvd...@gmail.com>

- Images tab loads images and displays them correctly (was easy to copy from my KImagefuser, but you need pyside>=1.0.5)

Should be:  ....., but you need pyside>=1.0.5 on Mac OS X)

Harry

Yuval Levy

unread,
Aug 28, 2011, 3:12:34 PM8/28/11
to hugi...@googlegroups.com
On August 27, 2011 05:27:11 PM Harry van der Wolf wrote:
> After all the discussions about building a Gui in python, I decided for
> myself to simply try it and use PySide (1) as graphical part.

Well done! Amazing! Thanks for sharing.

All I had to do, on my nearly blank new Kubuntu box, was:

sudo add-apt-repository ppa:hugin/hugin-builds
sudo add-apt-repository ppa:hugin/nightly
sudo apt-get update
sudo apt-get install hugin enblend pyside
tar xvfz pyHugin-0.0.1.tgz
cd pyHugin/
./pyHugin.py

Fed it two images and it yielded a panorama. Cool!


> So my basic knowledge of QT is the reason I have chosen for pyside
> instead op wxpython.


About two weeks ago Kay and I were debating on Skype how to go about his
idea of refactoring Hugin, and whether it is better to refactor the
current GUI with wxPython or start from scratch with PySide. We tended
for PySide and agreed that we need a little bit more study / selection of
the modules to use. The question on stackoverflow [0] has quite an
overwhelming answer favoring Qt over wx.


> I made a super simple Assistant in python/pyside.

Your prototype is already much further than what was achieved in the
whole GSoC 2007 project that was meant to take Hugin from wxWidgets to Qt
while keeping the GUI coded in C++.

I am impressed. And I am tempted to tinker, but I can't. When restaging
my notebook and my desktop I deliberately did not restore a Hugin
development environment. Maybe over the Xmas/NewYear, depending how
things go, but for now I am bowing out.

Fare well, Hugin. ehem... pyHugin.
Yuv


[0] http://stackoverflow.com/questions/7058947/can-you-recommend-a-good-
cross-platform-application-development-framework

signature.asc

Lukáš Jirkovský

unread,
Aug 29, 2011, 12:22:17 PM8/29/11
to hugi...@googlegroups.com
On 27 August 2011 23:27, Harry van der Wolf <hvd...@gmail.com> wrote:
> Hi all,
>
> After all the discussions about building a Gui in python, I decided for
> myself to simply try it and use PySide (1) as graphical part.
> I knew absolutely nothing of python and neither of pyside but I felt an
> itch, so I scratched.

I haven't tested it yet, but seems like a bad timing:
http://lists.pyside.org/pipermail/pyside/2011-August/002816.html

Let's hope pySide development will continue.

Lukas

Yuval Levy

unread,
Sep 3, 2011, 5:57:37 PM9/3/11
to hugi...@googlegroups.com
On August 29, 2011 12:22:17 PM Lukáš Jirkovský wrote:
> I haven't tested it yet, but seems like a bad timing:
> http://lists.pyside.org/pipermail/pyside/2011-August/002816.html
>
> Let's hope pySide development will continue.

If it does not, it is still enough compatible with PyQt to fall back on it.

If you really want to worry: Qt belongs to Nokia and Nokia's erratic moves do
not inspire stability nor confidence.

Nokia is the company that acquired Psion/Symbian in 2008, set it Free in 2009,
took it back again in 2010 and announced end of life for 2016.

During the same time Nokia developed Maemo, a proprietary platform / extension
on top of Debian/Linux. Merged 2010 into MeeGo, a "strategic alliance" with
Intel that did not even last a full year / product cycle. Ditched for another
"strategic alliance", this time with Microsoft.

What's next? And how will it affect Qt, that Nokia owns? I am not worried.
There are enough examples out there of Free software that survived their
corporate masters gone bezerks.

Yuv

signature.asc

kfj

unread,
Sep 10, 2011, 3:39:15 AM9/10/11
to hugin and other free panoramic software


On 3 Sep., 23:57, Yuval Levy <goo...@levy.ch> wrote:

> If you really want to worry: Qt belongs to Nokia and Nokia's erratic moves do
> not inspire stability nor confidence.
> ...

so - FUD time again?

Kay
Reply all
Reply to author
Forward
0 new messages