Am 16.01.2011 18:32, schrieb kfj:
> Once I've test-run the code from hugin I'll publish through the usual
> channel. So far there has been so little echo to my work that I am
> getting the feeling that hardly anyone actually reads my posts or is
> at all interested. This is regrettable, since I am certain that my
> path to Python integration is opening up very interesting new
> possibilities. Let me name but a few:
>
> - plugins can provide glue to closely cooperate with other
> applications
> - other code can be glued in without having to link it
> - code contribution from users is made much easier
> - optional functionality can be accessed on on demand
> - Python code can be used to do advanced maths (see numpy, SciPy)
I'm spending all my hugin time on the cpfind improvement now, so I
didn't have much time to try your python work. However, I do a lot of
python programming at work, and I really like it, and I think it would
be a great addition to hugin.
The full benefits might not be obvious to everybody, so don't let the
lack of feedback disapoint you.
I think once some examples of how to use the interface are available,
even people that could not do any hugin coding can start to contribute.
Btw. in order to make it easier for us track your work (and add
improvements etc.), it would be great if you could offer a hg branch of
it (maybe not on sourceforge, if you have issues with that, but maybe at
some other site (for example: bitbucket or so).
Sorry for not answering the tech questions, I'll do this later if nobody
jumps in.
ciao
Pablo
The full benefits might not be obvious to everybody, so don't let the lack of feedback disapoint you.
On January 16, 2011 12:32:53 pm kfj wrote:
> So far there has been so little echo to my work that I am
> getting the feeling that hardly anyone actually reads my posts or is
> at all interested.
apology for not getting back to you. I love what you are doing and look
forward for the next Hugin GUI to be Python scripted.
I am currently swamped at work (and with swamped I mean: 8am-2am with a few
short breaks in between. This week I am not even able to catch up with Hugin
on the weekend).
When this contract ends, I'll be more than happy to play with your work.
It would help if you would work within the Hg repo and publish your Hg branch.
This does not have to be through SourceForge.
I assume you branched Hugin locally on your machine with something like
hg pull
hg branch python_scripting
and that you now switch between your scriptable hugin and "mainstream with"
hg up -C python_scripting
and
hg up -C default
you can push your Hg repository anywhere there is Hg hosting.
so just tell us where you are going to push it, and we'll follow you.
keep up the good work. sorry I can't be of more help.
Yuv
Try saving your '.hugin' file, then go to preferences > Control point
Detectors and select 'Load defaults', and see if that fixes the problem.
Cheers,
--
Regards,
Terry Duell
Yes a python interface is very interesting.
There are some bits of the code that would benefit from being in a
language that doesn't require a 15 minute recompile with every
change - e.g. what happens when you click the Align... button.
Ultimately there could be an advantage to having the GUI elements in
python, but this would be a major change.
What we do need is to have the python interface in the Hugin tree
and built as a compile time option.
--
Bruno
> --
> You received this message because you are subscribed to the Google Groups "Hugin and other free panoramic software" group.
> A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
> To post to this group, send email to hugi...@googlegroups.com
> To unsubscribe from this group, send email to hugin-ptx+...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/hugin-ptx
On Mon, 17 Jan 2011 09:37:39 +1100, stan <gree...@verizon.net> wrote:
> Hi Terry,
> Thanks for your help. It WORKED!
Good.
> I loaded "cpfind". Is this your recommended CP generator?
It is the CP Generator that is provided with Hugin, so I guess it is the
recommended one.
You probably should try some of the others to see what suits your projects
best.
Am 19.01.2011 10:04, schrieb kfj:
> hg export 4852:bf77427fe623 4853:9de97bcfd3b2> patch4853
> gzip patch4853
>
> I hope this is just what you need and convenient enough to use. Echoes
> welcome.
From http://mercurial.selenic.com/wiki/Export, it seems that hg bundle
is the preferred way for contributing changesets. I have tried to import
your changes into the sourceforge repository using hg import, I hope it
worked fine.
ciao
Pablo
I find it very nice that you and Thomas think about supporting Python
3. Most of the software out there doesn't care about Python 3 very
much and so packaging for Arch Linux is unnecessarily difficult (Arch
uses Python 3.1 as a default Python version).
On 5 February 2011 12:37, kfj <_k...@yahoo.com> wrote:
> On 5 Feb., 12:06, "T. Modes" <Thomas.Mo...@gmx.de> wrote:
>
>> Commited after some changes.
>> * Don't misuse configure_file for installing files. Use the install
>> command instead.
>
> Okay. I'm just now sure about how to go on about the installing on
> Linux. So far I'm just keeping the python modules and plugins in my
> target directory and put my PYTHONPATH variable to point to it. But
> really, the module should go to the system module path and the plugins
> should live in a dedicated plugin directory. I'd like some feedback on
> the issue, and I certainly don't want to just shove stuff into paths
> outside hugin's tree without due consideration. Would someone of the
> developers working on Linux please comment on the issue?
>
I'd go for ${LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/hugin
>> * Your patch contains a lot a line, where only the line ending were
>> changed. -> Unified
>
> Sorry for that. On Linux, every line ends with a newline character and
> nothing else. I don't know how other line endings made it into my
> code, I'll do my best to avoid this in the future. What standard do
> you use in the hugin repo? Do I have to put in carriage returns?
Hugin uses Unix line endings.
>> * Some changes in your patch were already in the repo. You did not
>> provide a patch against the head of the python branch.
>
> Again, sorry. I'm not sure how this happened. I drew a fresh clone
> once the patch was integrated, then modified that, and finally created
> the patch after a commit. Do I have to do more than that? Should I
> fetch a clean clone just before I patch, carry over my modifications
> to it and make the patch from that?
If I understand that you're doing clone whenewer you want to change
the code? If yes, I suggest following worflow:
1. clone the repository from source forge (only first time)
2. change to branch python_scripting (only first time)
3. "hg pull -u" to update to the newest changeset, if there was a
conflict, run "hg merge"
4. do some work
5. commit, optionally GOTO 3.
6. "hg bundle" or "hg export -r REV…" and send patch/bundle to be integrated
7. GOTO 3
Lukas
I understand it exactly the same. It was a nice surprise to me to see
support for both major versions of Python.
You may want to do "hg pull -u" (or "hg pull & hg up") after commit to
make sure nothing has changed in the repo meanwhile (hehe, I omitted
it in my suggested work flow too). Otherwise you should have no
problems.
Lukas
Everything will be preserved. The reason why to do hg pull before
creating patch is that you will be able to determine whether some
conflicting change has been committed to the upstream repository or
not. If there is such change mercurial will run merge. Merge is often
completely automatic but in case of problems it will run merge tool as
specified in [1] (I suggest KDiff3 or Diffuse).
[1] http://mercurial.selenic.com/wiki/MergeProgram#How_Mercurial_decides_which_merge_program_to_use
Lukas
Sorry, I haven't had time to look into this. I think initially the
python interface would be useful even if it presents as a menu of
functions that don't take any parameters. i.e. it can be merged
more-or-less in the state it is in.
>Then there is an issue I'd like to have considered by the group: the
>hsi python module could be considered a library, since it can do hugin-
>ish stuff outside hugin, probably linking in a few shared libraries,
>but if it was linked statically, not even that. A lot of hugin's code
>is GPLed. Is there a problem with that?
Please use 'GPL version 2 or later', this makes it easier to ship
with Hugin. Are you concerned about how this effects the license of
potential 3rd party plugins?
>And one more thing: I'd like to see a discussion about a perspective
>for merging the python_scripting branch back into the mainstream.
>Thomas and I have made a good effort to parametrize everything in
>cmake and make the scripting capability a compile-time option. The
>intersections with other code are minimal and well #ifdeffed.
I would like to see the current Hugin 'trunk' move to a 2011.0.0
release branch as soon as possible. So the python interface should
then be merged so that it goes into the next release after that.
--
Bruno
I think it going to be very useful and want to play with it (and even
learn some python), but am very limited with time at the moment.
> Let me point out that SWIG, which I use to generate the Python
> interface, can generate interfaces for other languages as well
> (something like two dozen), among them perl. I had suspected you'd
> start playing with the SWIG code to let it make a perl interface.
Actually I think python is the right language to be using here,
since Hugin needs to work on all platforms I expect that the Windows
installer will include a pythin interpreter.
>> Please use 'GPL version 2 or later', this makes it easier to ship
>> with Hugin. Are you concerned about how this effects the license of
>> potential 3rd party plugins?
>
>What I mean is this: hsi, the python module that is generated by SWIG
>and contains the hugin functionality, can be imported by any python
>script that cares to do so. It's like loading a shared library from an
>executable program, in fact, technically, this is just what happens.
>But the code that finds it way into the script via this route is
>GPLed. Therefore, if I understand things rightly, the module would
>have to make itself known as GPL software, prohibit closed-source
>users to import it and point a way to it's sources, plus whatever
>other requirements the GPL imposes.
We would want people to write their own scripts and not care about
this stuff so long as they didn't distribute them.
Hugin is GPL, and changing this (other than to version 3) isn't ever
going to be practical given the number of contributors. I don't
think having the plugin interface code as LGPL would make any
difference to anyone writing plugins.
>Sadly, the Python scripting project is slightly stalled currently.
>This is due to the Mac side of things - Harry couldn't get it to run,
>went away on a holiday and noone else took over. The Linux and Windows
>side seems fine and ready to be merged. Harry said to go ahead,
>though, never mind the Mac problems. So I hope that maybe we'll soon
>have hpi in 'bleeding edge' mainstream and that it can maybe be part
>of the next release.
Now that 2011.0.0 has branched, this can happen.
--
Bruno
Oops, I was responding to the idea that the plugin interface would
enforce the GPL in plugins programatically, but maybe that wasn't
what you were saying.
Any plugins that were distributed with Hugin would need to be GPL
too, or some more liberal license.
> The module itself doesn't do any i/o though and can't communicate
> it's license status. Is that okay with the GPL? Does there have to
> be some mechanism to display the license or is it enough to have a
> LICENSE file with the distribution?
It isn't necessary to display the license in the GUI, Hugin does
this but it is more of an advocacy/education thing.
> Excellent. You may have seen my second posting where I described
> my experience with merging the branch back. It seems painless, but
> I only tested it on Linux, so there may be obstacles I'm not aware
> of. Would it be useful if I did the merge again at some convenient
> point in time and uploaded the patch?
If you are working with HG, you should be able to just pull updates
from the 'default' branch and never worry that your branch is
diverging.
The main worry we have about merging new features into the 'trunk'
is that in the past we have merged unfinished stuff that then held
up a release for months - Either the new feature needs to be
complete, or it needs to be unobtrusive.
--
Bruno
Kay,
I haven't been following this thread but I would like to ensure this doesn't fade away as I see real benefit in an external interface such as this.
Can you email me offline to bring me up to speed and I'll work with you to get it into the repo.
Best regards,
Gerry
I really would like to use it and see what I can do, but I'm aware
that there are some deadlines approaching and that these have
priority. I suspect that most 'development time' at the moment is
working towards getting the 2011.0.0 release out.
--
Bruno
On March 20, 2011 05:40:02 am kfj wrote:
> you're not the only one busier with something
> else. So, just to remind every one, nothing much is happening with the
> Python interface.
I am one of those guilty with not participating in your effort, although I
find it important and laudable.
The time I am putting into Hugin now goes toward the 2011.0 release, and this
is, in a sense, a contribution to the Python interface, because once 2011.0 is
out the door we can integrate the Python interface into the main codeline and
give it the extra attention it deserves.
I would suggest that you sign up as a Google Summer of Code mentor when Habi
launches the call for mentors; and I hope we can find a student to work on the
Python interface with your guidance.
> - still nothing at all on Mac OS. Would a Mac programmer please come
> forward and help compile the Python module?
My understanding is that the Python module must be activated at build time.
As long as it is not activated, the python_scripting branch builds and works
on Mac OSX too, just without the Python functionality. Is this correct?
If yes, this should not hinder you or anybody else from making progress on
Python scripting and integrating it in the main codeline.
Sooner or later, somebody on the Mac OSX side of things will feel an itch to
scratch. You can ignore it for now.
> - another issue that's been discussed but not solved is how Python
> plugins could be given GUI access. Using wxPython from plugins works
> on Linux with Python <= 2.7 but not Python 3.X, and not at all on
> Windows, quite probably because wxWidgets is linked statically there.
I have skimmed over the discussion and I like both suggested solutions.
I am afraid that for now we can't count on the combination of wxPython and
Python 3.0.
http://groups.google.com/group/wxpython-users/t/59d9f9b5e3adf513
http://docs.python.org/dev/howto/cporting.html
Python 2.7 will be supported for years to come, but if I recalled correctly
from my skimming of all the back and forth, there was an issue with using
Python 2.7?
I like both ideas expressed: the MathMap-like interface, simple, pragmatic,
unified; and the completeness of a wxPython solution. Both have advantages
and disadvantages, and both raise questions.
MathMap-like: some plug-in may need additional user-input / interaction. How
would that happen? wxPython linked from the plugin, external and oblivious to
Hugin?
What I like about wxPython is that eventually we can move more and more parts
of the Hugin interface from C++ to Python, making it more accessible for users
to customize/improve/contribute.
> On the positive side, the Python scripting interface (hsi) seems to be
> running just fine on Linux and Windows.
I am sorry I have not had time to test it but it is positive news indeed.
> it's only the GUI sharing that isn't yet happening.
how critical is GUI sharing?
> I wonder if it might not help progress on the Python front
> if binaries of the Python module were offered for download for Linux
> and Windows?
Sure it would. Once the 2011.0 release is out of the door and the
python_scripting branch is merged, the Hugin PPA's nightly will offer binaries
for download, at least for Ubuntu. Currently the Hugin PPA nightlies are
broken (for another, trivial but time consuming reason); and a change is
discussed that would provide nightlies not only of the main codeline, but also
of all development codelines. Too late for python_scripting, but will
definitely help monitoring progress and advanced testing for the GSoC2011
branches. At least on Ubuntu (and it would probably be only one series, not
all supported series).
Sorry if we are not following you as fast as you would like.
> I find the Python interface immensely useful, as it
> allows me to access most of hugin's functionality from Python. Being
> able to call Python plugins from hugin is a nice-to-have extra and
> mostly works, and GUI access from Python is another nice-to-have
> thing, but waiting for it to materialize before distributing the
> Python module seems silly.
Agree. Let's integrate the Python interface as-is asap after 2011.0 and look
at the nice-to-have extras such as the ability to call Python plugins from
Hugin, and GUI access from Python, later on.
> If interested parties could get easy access to the Python module, the
> body of hsi code might grow, at the same time uncovering issues that
> have not surfaced yet.
Yes, the faster we add this to the main release line, the sooner we'll find
and clean rough edges and attract additional contributors.
> On Linux, getting the module is reasonably
> straightforward, but requires compilation of a specific hugin branch.
The specific branch requirement will fall very soon after 2011.0 is out the
door.
> On Windows, this is probably more involved. Offering the binaries
> would lower the threshold. Is this feasible? Would it be necessary to
> offer a complete 'hugin with Python capability' bundle or would it be
> enough to merge the python_scripting branch into default and make
> BUILD_HSI = ON the default, so hugin and collateral software would be
> the same throughout - would the resulting binaries run on systems
> without Python? I've written hpi (the hugin plugin interface) so that
> embedded Python is only initialized if the interface is used. I'm not
> sure what happens on a system without Python, or with the wrong
> version, but when I wrote it I hoped that the code would simply
> produce an error if Python wasn't available, returning an error code.
> Has anyone tried? This would be easy on Windows, where Python is
> optional. The test would be to run hugin built from the
> python_scripting branch with Python uninstalled and see what happens
> when calling a plugin. If it merely says something like 'script return
> -X' this would mean it' safe. Maybe the presence of Python could be
> detected, and if it's missing the plugin call could be grayed out? I'd
> welcome your comments.
Python is Free software so there is no obstacle to distribute Python with the
Hugin installer. I would not bother too much about detecting, making
exceptions, or other things to make Python "optional". The switch is in the
CMake build, and when built with BUILD_HSI = ON Python becomes a mandated
dependency of Hugin.
This leaves builders and distributors on platforms without package manager
(Windows and OSX) two choices: Build a version of Hugin with HSI and add
Python to the installer/bundle; or build a version of Hugin without HSI and
don't add Python to the mix.
Thank you for your contribution and your patience, Kay!
Yuv
I'm not sure that the Windows Hugin package absolutely has to be
statically linked, this may just be the most convenient way to do it
up until now.
>On the positive side, the Python scripting interface (hsi) seems to be
>running just fine on Linux and Windows. This means that Python
>programs can use pretty much all of hugin's backend functionality.
>I've writtten a very long involved Python program doing just that.
>It's great. And it can be called from hugin, it's only the GUI sharing
>that isn't yet happening.
As I understand, currently plugins can only be run without any
user configuration, since adding a GUI is appearing problematic.
An intermediate solution would be to accept that, for the time
being there isn't going to be any GUI configuration and add the
plugins to Hugin in multiple places.
e.g. plugins that operate on the project as a whole can go in the
the main menu. Plugins that operate on a selection of photos
can go in a pull-down menu on the Images tab, etc...
Would this restrict the functionality too much?
--
Bruno
> I would suggest that you sign up as a Google Summer of Code mentor when Habi
> launches the call for mentors; and I hope we can find a student to work on the
> Python interface with your guidance.
I just did: <https://groups.google.com/d/topic/hugin-ptx/qkDQMOMfIXI/discussion>.
The call for mentors is online and can be acted upon.
>> - still nothing at all on Mac OS. Would a Mac programmer please come
>> forward and help compile the Python module?
I am not a programmer, but an avid user. And I have to say that
currently I don't feel the need to interface with hugin through
Python. From my perspective I am agreeing with Yuv. Ignore "us" for
the moment, of course only if noone else speaks up.
The replies in this thread show that you're doing a very welcome job.
Take that as an incentive and go on with Linux and Windows.
Habi
On Mon, Mar 21, 2011 at 10:12, kfj <_k...@yahoo.com> wrote:
> On 20 Mrz., 18:56, Yuval Levy <goo...@levy.ch> wrote:
>
>> I would suggest that you sign up as a Google Summer of Code mentor when Habi
>> launches the call for mentors; and I hope we can find a student to work on the
>> Python interface with your guidance.
>
> I understand that this would be helpful, but I will not be available
> so much during the summer. This is why I called it my 'winter of
> code'. In summer I spend more time in the italian Alps trekking and
> doing photography. I have also pushed aside all other interests during
> this winter in favour of the hugin Python interface, and I definitely
> want to do some GIS programming during the summer.
Sorry, I have not read this far in the thread before my reply. Sounds
like a great and interesting summer :) We'll see if a student
nonetheless wants to pick up your pieces (or more like grab the thing
afloat :)
Just out of personal curiosity, what GIS are you working on/for (I've
got a friend in the GIS-"scene").
Habi
OK, so not a primary mentor. Still, I suggest you join the mentors when Habi
sends out the invitation, so you get to give your two cents on the selection
of the students and on the evaluation of their work. Plus, you'll get a
Google T-Shirt ;-)
I am confident that you'll make an excellent mentor, even if you won't be
available all of the time.
> I'm using Quantum GIS (QGIS)
AFAIK it uses PyQt, the sole GUI framework known to me that already has
support for Python 3. PySide is in the making and is likely to come in
earlier than wxWidgets. But then this would bring about the old debate of Qt
vs. wxWidgets...
Yuv
back in 2006/7 it was DLL-hell. Static linking was not only convenient: IIRC
only magicians with mystical connection were able to get a dynamically linked
Hugin work, and it would be frail on the users system (read: disappearing DLL
and other funny things).
I don't know if with the current crop of Windows O/S things have improved with
regard to the protection of DLL and other installed files. Definitely worth a
try, if somebody out there wants to try.
This was all with MSVC. minGW is another set of problems. There have been a
few people who have tried over the year, this list archives is full of
reports, partial successes and frustrations. It is not known to me that
anybody has succeeded building Hugin with minGW in the past three years. Yes,
it would have great benefit, but somebody must be really determined to get it
done.
Yuv