[ptx] PTOptimizer (was:windows snapshots available)

Bruno Postle bruno at postle.net
Sun Dec 14 23:30:36 GMT 2003


On Sun 14-Dec-2003 at 04:43:10 +0100, alexandre jenny wrote:
> 
> Ps : No I didn't found yet the crash in the pano12 vs.net release version.
> As we will have our own stitcher I will not spend time debugging this one.

PTOptimizer still uses pano12.

I just noticed (when I was adding it to CVS) that Helmut's gimp
plug-in (that doesn't use pano12) parses script-files and optimises
control-points.

After looking at the pano12 sources, all the same stuff is in
adjust.c and it looks quite straight forward.

Don't look _too_ closely, but I've hacked together an optimiser that
uses pano12, it actually seems to work :-O, it's only been tested on
a single input script with two photos and two sets of control
points.

Attached optimiser.c

-- 
Bruno
-------------- next part --------------
// gcc -ooptimiser -I/usr/include/pano12 -lpano12 optimiser.c

// horribly hacked together, Bruno Postle 2003

// expects a script file called script.txt in the current directory

#include "filter.h"

static  AlignInfo	*g;

int main(TrformStr *TrPtr)
{
	aPrefs		aP, *aPtr;

	char*		script;
	OptInfo		opt;
	AlignInfo	ainf;

	fullPath	infile;
	fullPath	outfile;

	SetAdjustDefaults(&aP);

	StringtoFullPath(&infile, "script.txt");
	StringtoFullPath(&outfile, "output.txt");

	script = LoadScript( &infile );
	if( script != NULL )
	{
		if (ParseScript( script, &ainf ) == 0)
		{
			if( CheckParams( &ainf ) == 0 )
			{
				ainf.fcn	= fcnPano;
				
				SetGlobalPtr( &ainf ); 
				
				opt.numVars 		= ainf.numParam;
				opt.numData 		= ainf.numPts;
				opt.SetVarsToX		= SetLMParams;
				opt.SetXToVars		= SetAlignParams;
				opt.fcn			= ainf.fcn;
				*opt.message		= 0;

				RunLMOptimizer( &opt );
				ainf.data				= opt.message;
				WriteResults( script, &outfile, &ainf, distSquared, 0);
			}
			DisposeAlignInfo( &ainf );
		}
		free( script );
	}
}



More information about the ptX mailing list