major code changes

Pablo d'Angelo pablo at mathematik.uni-ulm.de
Mon Sep 15 01:11:55 BST 2003


Hi,

As I said before I have changed major parts of the hugin code,
especially the lens handling. I found that the interface for it was way
to confusing, so I'm in the progress of redesigning it.

The main idea is that there are different types of variables:
image position variables (they are called external parameters in the
literature) and lens parameters (also called internal parameters).

The internal parameters describe the way the image was captured, so
they more than just lens settings in the physical meaning, and depend on
the whole image creation process (also including errors from scanning
etc.).

Panotools can link the internal parameters, so that they always have the
same value, for multiple images. this makes sense if the linked internal
parameter does not change for a set of images. if they change then they
should not be linked, so that they can be different for each image.

So I removed the explicit setting of link targets, and introduced the
Lens class as the class that describes the image creation process. Each
lens has the v,a,b,c,d,e (and soon f and g) parameters. they can be
different for each image or the same for all images that use this Lens.

currently, the GUI supports only one lens per pano, but the underlaying
model & PT interface already support multiple lenses. Adding them to the
gui is mainly a question how it should be represented. PTLens
integration would be another nice thing for the future.

Acutally the old hugin printed bad optimizer scripts when
variables where linked, so probably nobody tried using linked variables
in the past ;)

I while I was at it I also rewrote the pano, image and lens panel to
work with the new model.

Unfortunately, due to the changed internal interfaces I had to remove
some features kai-uwe has added, but I will readd them later on.
Most noteably the preview feature is not included right now. I'd like to
keep the preview in a separate window, so that it can be seen while
using any of the tabs, if needed.

On the other hand, the preview image in the ImagesPanel had a second
functionality, where one could click on it, and set the position of the
selected images there.
this actually belongs into the images panel. So it might make sense to
keep a small preview, or at least a black square, with lines every
90 degrees or so there.

The third use of the preview was that it sometimes showed the selected
image. This functionality could be either made with a popup, that shows
the image if the mouse is over it, or it could be shown separately
somewhere on the ImagesPanel. The popup idea might not be too great, and
I found no simple way to implement it in wxwindows.

About the preview window: I think that it should show the panorama at
its output settings, just in a scaled down version. Enforcing a 360x180
preview not nice for partial panoramas, since most of the preview window
would be black. Probably the default settings for the output panorama
should be 360x180.

Hmm, I would simply make the normal preview window resizeable and
calculate the preview to fit its size, instead of fixing it to 256x128.

A second preview, for usage before doing the final rendering does make
sense if somebody want do check a low res version, without starting a
the panoviewer by hand etc.

On the technical side: the panorama class can't stitch anymore, since
this depends on wxwindows. the RunStitcherFrame can be use for this.
Probably I should add a option to make it stich without showing a
progress window, but showing the progress somewhere in the preview
window. (without using global variables ;)

Kai-Uwe, you will notice that I removed/rewrote a lot of code you have written.
I had a bad feeling when deleting so much code that I didn't write, but I
hope that the codebase is cleaner now, and its easier to extend/improve

I disabled the "center image" function, because I didn't port it to the
new Images/Lens panel yet. But it should be pretty straightforward.

btw. the panel looks nice! how about setting the crop for circular
fisheye from there as well? you already got the radius.

One question: which image center should I be changing when multiple
images are selected? wouldn't it be less confusing to be able to change
only one center at a time?

If you miss some code that you want to re-add or use as reference,
you can use cvs -D to check out an older version.

ciao
  Pablo
--
http://wurm.wohnheim.uni-ulm.de/~redman/
Please use PGP


More information about the ptX mailing list