Revision: 4114
http://hugin.svn.sourceforge.net/hugin/?rev=4114&view=rev
Author: tksharpless
Date: 2009-07-27 11:11:03 +0000 (Mon, 27 Jul 2009)
Log Message:
-----------
Usable, needs work.
Reads PTGui & PTAsm projects; works with stereographic off;
Several command options still to be implemented
Modified Paths:
--------------
autopano-sift-C/trunk/APSCpp/APSCpp.c
autopano-sift-C/trunk/APSCpp/APSCpp_main.c
autopano-sift-C/trunk/APSCpp/CamLens.c
autopano-sift-C/trunk/APSCpp/sphereAlign.h
autopano-sift-C/trunk/LoweDetector.c
autopano-sift-C/trunk/RevisionLog.txt
Modified: autopano-sift-C/trunk/APSCpp/APSCpp.c
===================================================================
--- autopano-sift-C/trunk/APSCpp/APSCpp.c 2009-07-27 05:30:19 UTC (rev 4113)
+++ autopano-sift-C/trunk/APSCpp/APSCpp.c 2009-07-27 11:11:03 UTC (rev 4114)
@@ -24,8 +24,6 @@
#include <math.h>
#include <tiffio.h>
-extern double globFov; // hfov if no project file
-
// create empty
pDIinfo DIinfo_new0(){
pDIinfo p = (pDIinfo)malloc(sizeof(DIinfo));
@@ -350,10 +348,13 @@
18 July 2009 new stgfov argument
<0 forbids reprojection
>=0 allows reprojection when hfov exceeds this value
+
+ 26 July 2009 add argument globFov, used when pdi is null.
+
*/
///#define _DEBUG_INTERP
KeypointXMLList * GenerateKeyspp( char * imgname, int maxdim, DIinfo * pdi,
- double stgfov, int * KPcount )
+ double stgfov, int * KPcount, double globFov )
{
#ifdef _DEBUG_INTERP
char tmp[262];
@@ -367,6 +368,8 @@
KeypointXMLList* kpp;
double Scale = 1.0;
+ double xcen, ycen; // scaled center
+
double hfov = 0;
@@ -390,8 +393,8 @@
pW = pic->width;
pH = pic->height;
- Xcen = 0.5 * pW;
- Ycen = 0.5 * pH;
+ xcen = Xcen = 0.5 * pW;
+ ycen = Ycen = 0.5 * pH;
// convert to monochrome float and discard input image
@@ -409,7 +412,7 @@
also convert to stereographic if pdi is valid
*/
// prescale factor
- if( maxdim > 0) Scale = max( pW, pH ) / (double) maxdim;
+ if( maxdim > 0) Scale = ( pW > pH ? pW : pH ) / (double) maxdim;
if( Scale <= 1 ) Scale = 1;
// interpolate if necessary
@@ -420,15 +423,19 @@
int dwid = pW, dhgt = pH;
// reduced dimensions
if( Scale > 1 ){
- dwid = (int)(0.5 + pW / Scale );
- dhgt = (int)(0.5 + pH / Scale );
- Scale = (double) pW / (double) dwid; // exact
- WriteLine(" reduce size to %d x %d ...", dwid, dhgt );
+ // scaled dimensions
+ dwid = (int)( pW / Scale ); xcen = 0.5 * dwid;
+ dhgt = (int)( pH / Scale ); ycen = 0.5 * dhgt;
+ // exact scale factor
+ if( pW > pH ) Scale = (double) pW / (double) dwid;
+ else Scale = (double) pH / (double) dhgt;
+ WriteLine(" reduce to %d x %d (Scale %.4f)...", dwid, dhgt, Scale );
// smooth the source for antialiasing
ImageMap* tmp = ImageMap_GaussianConvolution( picMap, 0.75 * Scale );
ImageMap_delete( picMap );
picMap = tmp;
}
+
// create result map
pn = ImageMap_new( dwid, dhgt );
@@ -443,6 +450,8 @@
prm = saRemap_new( psp, pdp );
saRemap_inv ( prm, 0.5 * dwid, 0.5 * dhgt, &Xcen, &Ycen );
WriteLine(" convert to stereographic projection ...");
+ CamLens_delete( psp );
+ CamLens_delete( pdp );
}
// interpolate
saInterpSetup((void *)picMap->values, // void * pdata
@@ -460,7 +469,10 @@
for( y = 0; y < pn->yDim; y++ ){
X = (double) x; Y = (double) y;
if( prm ) saRemap_inv ( prm, X, Y, &X, &Y ); // ++
- else { X *= Scale; Y *= Scale; } // legacy
+ else { // linear rescale...
+ // note no need to subtract and re-add center, that just adds noise
+ X *= Scale; Y *= Scale;
+ }
saInterp_float( &(pd[y]), X, Y );
}
}
@@ -468,6 +480,7 @@
ImageMap_delete( picMap );
picMap = pn;
saRemap_delete( prm ); prm = 0;
+
#ifdef _DEBUG_INTERP
strcpy(tmp, imgname);
strcat(tmp,"-MAP-PROJ.TIF");
@@ -479,6 +492,7 @@
/* find the features
+ Note feature point coords are at source scale
*/
WriteLine(" find keypoints ..." );
@@ -488,30 +502,33 @@
WriteLine(" %d keypoints found\n", nKeys );
*KPcount = nKeys;
- /* build the return value
- for ANN mode a list of Keypoint,
- that will be converted to keypointN after matching
+ /* build the return value. For APSCPP this is a list of keypoint (float
+ feature vector) not of keypointN (char feature vector). The feature
+ detector returns KP coordinates at source scale, so here all we need
+ to do is undo the stereographic projection if one was done.
*/
{
ArrayList * globalNaturalKeypoints = 0;
int i;
-
- if( pdi ){ // build remapping function at input scale
- CamLens * psp, * pdp;
- psp = CamLens_new1( pW, pH, pdi->format, hfov, 16.0 );
- pdp = CamLens_new1( pW, pH, _stereographic, hfov, 0 );
- prm = saRemap_new( psp, pdp ); // dest=>src
+ if( pdi && stgfov >= 0 && hfov >= stgfov ){
+ // build remapping function at source scale
+ CamLens * psp, * pdp;
+ psp = CamLens_new1( pW, pH, pdi->format, hfov, 16.0 );
+ pdp = CamLens_new1( pW, pH, _stereographic, hfov, 0 );
+ prm = saRemap_new( psp, pdp ); // dest=>src
+ CamLens_delete( psp );
+ CamLens_delete( pdp );
} else prm = 0;
for(i=0; i < ArrayList_Count(lf->globalKeypoints); i++) {
Keypoint* kp = (Keypoint *) ArrayList_GetItem( lf->globalKeypoints, i );
if( prm ){ // remap coordinates to image projection
saRemap_inv ( prm,
- kp->x , kp->y , // scale to image size
- &kp->x, &kp->y // remapped coords
+ kp->x , kp->y ,
+ &kp->x, &kp->y
);
- }
+ }
}
// package the list
Modified: autopano-sift-C/trunk/APSCpp/APSCpp_main.c
===================================================================
--- autopano-sift-C/trunk/APSCpp/APSCpp_main.c 2009-07-27 05:30:19 UTC (rev 4113)
+++ autopano-sift-C/trunk/APSCpp/APSCpp_main.c 2009-07-27 11:11:03 UTC (rev 4114)
@@ -43,65 +43,64 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
+#define APSCPP_VERSION "2.5.2 23July2009" // now separate from package version
+
#include <time.h>
-
#include "AutoPanoSift.h"
#include "sphereAlign.h"
// APSCpp.cpp
int LoadProjectImages( char* script, ArrayList * DIlist, bool equalAngle );
KeypointXMLList * GenerateKeyspp( char * imgname, int maxdim,
- DIinfo * pdi, double stgfov, int * KPcount );
+ DIinfo * pdi, double stgfov,
+ int * KPcount, double globFov );
int MultiMatch_ANN ( MultiMatch* );
-// globals
-double globFov = 0; // width for all images in degrees
-
-
void Usage ()
{
WriteLine ("autopano-sift-c: Find control points giving a Hugin project file\n");
- WriteLine (" Version %s \n", PACKAGE_VERSION);
+ WriteLine (" Version %s \n", APSCPP_VERSION);
WriteLine ("autopano-sift-c [options] output.pto image1 image2 [..]");
WriteLine (" hugin project file output.pto gets the results ");
WriteLine (" input images can be jpeg, tiff, or other formats.\n");
+ WriteLine (" output.pto: The output Hugin project file name, or \"-\" for stdout.");
+ WriteLine (" image<n>: The input image files (any common format: JPEG, PNG, TIFF,...)");
WriteLine ("autopano-sift-c [options] output.pto projectfile");
- WriteLine (" projectfile: a Hugin or other PT family project script with");
- WriteLine (" image file names, projections, angular widths and optionally");
- WriteLine (" alignments. Enables the options of stereographic projection");
- WriteLine (" and layout-guided control point placement.\n");
-
- WriteLine ("Options");
- WriteLine (" --ransac <on|off|1|0> Switch RANSAC filtration on or off (default: off).");
+ WriteLine (" projectfile: a Hugin, PTGui, PTAssembler, PTSticher,... project script with");
+ WriteLine (" image file names, fields of view, alignments and lens correction");
+ WriteLine (" factors. Enables stereographic, lens-correction, layout options.");
+ WriteLine ("");
+ WriteLine ("Options that affect image processing");
+ WriteLine (" --maxdim <n> Make largest image dimension <= n (default: 1600).");
+ WriteLine (" --projection <n>,<d> n = PT format code, d = hfov in degrees, for all images.");
+ WriteLine (" --equal-angle-fisheye lens type for format codes 2,3. Default is equal-area.");
+ WriteLine (" --lens-type <1|2|3> set lens type 1: rectlinear ('normal'), 2: equal-area");
+ WriteLine (" fisheye (common), 3: equal-angle fisheye (uncommon).");
+ WriteLine (" Used instead of format code, for all images.");
+ WriteLine (" --focal-length <mm>,<cf> mm = lens focal length in mm, cf = camera crop factor.");
+ WriteLine (" Used instead of hfov, for all images.");
+ WriteLine (" --stereographic <on|off|1|0> reprojection on (if enabled) or off. Default on.");
+ WriteLine (" Enabled by project file, --projection, --focal-length.");
+ WriteLine (" --stgfov <d> minimum hfov (degrees) for reprojection. Default 65.");
+ WriteLine (" --lens-correction <on|off|1|0> correction on (if enabled) or off. Default off.");
+ WriteLine (" Enabled if project has lens correction coefficients.");
+ WriteLine ("");
+ WriteLine ("Options that affect Control Point processing and output");
+ WriteLine (" --use-layout <on|off|1|0> image alignment in pto file guides control point");
+ WriteLine (" placement; or does not. Default is off.");
WriteLine (" --maxmatches <matches> Output no more that this many control points per");
WriteLine (" image pair (default: 25, zero means unlimited)");
- WriteLine (" --maxdim <n> Make largest image dimension <= n (default: 1600).");
- WriteLine (" --projection <n>,<d> n = PT format code, d = hfov in degrees. These");
- WriteLine (" apply to all images. Enables stereographic option.");
- WriteLine (" --stereographic <on|off|1|0> reprojection on (if enabled) or off. Default on.");
- WriteLine (" --stgfov <d> minimum hfov (degrees) for reprojection. Default 65.");
- WriteLine (" --equal-angle-fisheye Set fisheye lens type to equal-angle instead of");
- WriteLine (" equal-area. Ignored for PTAssembler projects.");
- WriteLine (" --disable-areafilter Do not use max-area filtration, which is default.");
- WriteLine (" See manpage for details.");
+ WriteLine (" --ransac <on|off|1|0> Switch RANSAC filtration on or off (default: off).");
WriteLine (" --integer-coordinates Truncate match coordinates to integer numbers.");
WriteLine (" --absolute-pathnames <on|off|1|0> Use the absolute pathname of the image");
WriteLine (" file in the PTO output file. Disabled by default.");
- WriteLine (" --use-layout <on|off|1|0> image alignment in pto file guides control point");
- WriteLine (" placement; or does not. Default is off.");
- WriteLine ("");
-
- WriteLine ("Refinement options");
- WriteLine (" --refine Refine the found control points using the");
- WriteLine (" original images.");
+ WriteLine (" --disable-areafilter Do not use max-area filtration, which is default.");
+ WriteLine (" See manpage for details.");
+ WriteLine (" --refine Refine control points using the original images.");
WriteLine (" --refine-by-middle Use the best middle point to refine (default).");
WriteLine (" --refine-by-mean Use the mean of the patches control points.");
- WriteLine (" --keep-unrefinable <on|off|1|0>");
- WriteLine (" Keep unrefinable matches (default: on).");
-
- WriteLine ("output.pto: The output PTO panorama project file.");
- WriteLine (" This filename can be \"-\", then stdout is used");
- WriteLine ("image<n>: input image files (any common format: JPEG, PNG, TIFF, ..)");
+ WriteLine (" --keep-unrefinable <on|off|1|0> Keep unrefinable CPs (default: on).");
WriteLine ("");
}
@@ -427,7 +426,7 @@
DIinfo * pdi = 0;
char buffer[262];
- fprintf(pto, "# Stitcher project file generated by APSCpp version %s\n\n", PACKAGE_VERSION);
+ fprintf(pto, "# Stitcher project file generated by APSCpp version %s\n\n", APSCPP_VERSION);
fprintf(pto, "p f2 w3000 h1500 v360 n\"JPEG q90\"\n");
fprintf(pto, "m g1 i0\n\n");
@@ -544,11 +543,14 @@
// list used in ++ mode only -- image info from pto file
ArrayList * DIlist = 0; // item = DIinfo struct.
char *projectfile = 0;
- // "--projection" option sets these for all images
- int globFmt = -1; // PT format code
int Nerr = 0; // counts commandline errors
- // downscale option = largest allowed image dimension (0: none)
+// "--projection" option
+ int globFmt = -1; // default PT format code
+ double globFov = 0; // width for all images in degrees
+
+
+// downscale option = largest allowed image dimension (0: none)
int maxdim = 1600;
// output to stdout flag
@@ -560,10 +562,18 @@
// Use stereographic projection if feasible
bool useStereographic = true;
double stgfov = 65; // don't reproject below this hfov
-
- // Use input alignment if feasible
+
+ // Lens and camera settings, valid if > 0
+ double FLmm = 0,
+ cropFactor = 0;
+ int lensType = 0;
+
+ // Use project alignment if feasible
bool useLayout = false;
+ // Use project lens correction fn if feasible
+ bool lensCorrection = false;
+
// treat fisheye lens as equal-angle
bool equalAngle = false;
@@ -590,7 +600,7 @@
int i;
int totalKPs = 0;
- WriteLine ("\nAPSCpp, enhanced autopano-sift-c version %s \n", PACKAGE_VERSION);
+ WriteLine ("\nAPSCpp, enhanced autopano-sift-c version %s \n", APSCPP_VERSION);
LoweFeatureDetector_SetVerbose(false); // default low chatter
@@ -624,6 +634,19 @@
++Nerr;
}
+ } else if( strcmp (optionStr, "--focal-length") == 0) {
+ joptN = 2;
+ char *p = argv[optionN + 1];
+ if(sscanf( p, "%g", &FLmm ) != 1 ){
+ WriteLine ("Invalid focal-length parameter");
+ ++Nerr;
+ }
+ p = strchr(p,',');
+ if( !p || sscanf( p, "%g", &cropFactor ) != 1 )
+ {
+ WriteLine ("Invalid focal-length parameter");
+ ++Nerr;
+ }
} else if (strcmp (optionStr, "--ransac") == 0) {
joptN = 2;
useRansac = YesNoOption ("--ransac", argv[optionN + 1], &Nerr );
@@ -636,6 +659,9 @@
} else if (strcmp (optionStr, "--use-layout") == 0) {
joptN = 2;
useLayout = YesNoOption ("--use-layout", argv[optionN + 1], &Nerr );
+ } else if (strcmp (optionStr, "--lens-correction") == 0) {
+ joptN = 2;
+ lensCorrection = YesNoOption ("--lens-correction", argv[optionN + 1], &Nerr );
} else if (strcmp (optionStr, "--maxmatches") == 0) {
joptN = 2;
if (sscanf(argv[optionN + 1], "%d", &maxMatches) != 1) {
@@ -712,19 +738,42 @@
DIlist = ArrayList_new0( (void *) DIinfo_delete );
}
+ /** set up and report options **/
- WriteLine(" Default fisheye lens type is %s.",
+ if( !DIlist ){
+ lensCorrection = false;
+ useLayout = false;
+ if( globFmt < 0 && FLmm == 0 ) useStereographic = false;
+ }
+
+ if( lensType ){
+ WriteLine(" Assuming %s lens type.",
+ lensType == 1 ? "rectilinear"
+ : lensType == 2 ? "equal-area fisheye"
+ : "equal-angle fisheye" );
+ } else {
+ WriteLine(" Default fisheye lens type is %s.",
equalAngle ? "equal-angle" : "equal-area" );
+ }
- if( DIlist ){
- if( useStereographic )
- WriteLine(" Stereographic projection enabled for hfov >= %.1f degrees.", stgfov );
- if( useLayout )
- WriteLine(" Will try to use source image layout to guide CP placement.");
+ if( FLmm && cropFactor ){
+ WriteLine(" Assuming focal length %.2f mm, crop factor %.4f.",
+ FLmm, cropFactor);
+ } else {
+ WriteLine(" Focal length will be computed from hfov.");
}
+ if( useStereographic )
+ WriteLine(" Stereographic projection enabled for hfov >= %.1f degrees.", stgfov );
+ if( lensCorrection )
+ WriteLine(" Lens correction enabled BUT NOT IMPLEMENTED.");
+ if( useLayout )
+ WriteLine(" Layout guided CP placement enabled BUT NOT IMPLEMENTED.");
+
+
+
/** Find keypoints **/
start = clock();
@@ -748,14 +797,18 @@
for( i = 0; i < ArrayList_Count( DIlist ); i++ ){
pd = (pDIinfo) ArrayList_GetItem( DIlist, i);
if( !DIinfo_isDummy( pd ) )
- ArrayList_AddItem(keylists, GenerateKeyspp( pd->name, maxdim, pd,
- useStereographic ? stgfov : -1, &totalKPs ) );
+ ArrayList_AddItem( keylists,
+ GenerateKeyspp( pd->name, maxdim, pd,
+ useStereographic ? stgfov : -1,
+ &totalKPs, globFov ) );
}
} else {
// std mode: image names only from commandline
for( i=0; i<argc - 1 - optionCount; i++) {
- ArrayList_AddItem( keylists, GenerateKeyspp( argv[i+optionCount+1],
- maxdim, 0, 0, &totalKPs ) );
+ ArrayList_AddItem( keylists,
+ GenerateKeyspp( argv[i+optionCount+1],
+ maxdim, 0, 0, &totalKPs,
+ globFov ) );
}
}
Modified: autopano-sift-C/trunk/APSCpp/CamLens.c
===================================================================
--- autopano-sift-C/trunk/APSCpp/CamLens.c 2009-07-27 05:30:19 UTC (rev 4113)
+++ autopano-sift-C/trunk/APSCpp/CamLens.c 2009-07-27 11:11:03 UTC (rev 4114)
@@ -150,6 +150,10 @@
}
}
+void CamLens_delete( pCamLens self ){
+ if( self ) free( self );
+}
+
// create empty
pCamLens CamLens_new0()
{
Modified: autopano-sift-C/trunk/APSCpp/sphereAlign.h
===================================================================
--- autopano-sift-C/trunk/APSCpp/sphereAlign.h 2009-07-27 05:30:19 UTC (rev 4113)
+++ autopano-sift-C/trunk/APSCpp/sphereAlign.h 2009-07-27 11:11:03 UTC (rev 4114)
@@ -181,6 +181,8 @@
fmt is a Panotools format code
flmm should be 0 for ideal projections, else > 0
*/
+// delete
+void CamLens_delete( pCamLens self );
// create empty
pCamLens CamLens_new0();
// create with minimal info
Modified: autopano-sift-C/trunk/LoweDetector.c
===================================================================
--- autopano-sift-C/trunk/LoweDetector.c 2009-07-27 05:30:19 UTC (rev 4113)
+++ autopano-sift-C/trunk/LoweDetector.c 2009-07-27 11:11:03 UTC (rev 4114)
@@ -152,12 +152,12 @@
// Print license restriction
WriteLine ("");
WriteLine ("===============================================================================");
- WriteLine ("The use of this software is restricted by certain conditions.");
- WriteLine ("See the \"LICENSE\" file distributed with the program for details.");
+ WriteLine (" The use of this software is restricted by certain conditions.");
+ WriteLine (" See the LICENSE file distributed with the program for details.");
WriteLine ("");
- WriteLine ("The University of British Columbia has applied for a patent on the SIFT");
- WriteLine ("algorithm in the United States. Commercial applications of this software may");
- WriteLine ("require a license from the University of British Columbia.");
+ WriteLine (" The University of British Columbia has applied for a patent on the SIFT");
+ WriteLine (" algorithm in the United States. Commercial applications of this software");
+ WriteLine (" may require a license from the University of British Columbia.");
WriteLine ("===============================================================================");
WriteLine ("");
}
Modified: autopano-sift-C/trunk/RevisionLog.txt
===================================================================
--- autopano-sift-C/trunk/RevisionLog.txt 2009-07-27 05:30:19 UTC (rev 4113)
+++ autopano-sift-C/trunk/RevisionLog.txt 2009-07-27 11:11:03 UTC (rev 4114)
@@ -156,3 +156,147 @@
Give the output file name the same extension as the input
project, no matter what user enters?
+22 July Design for layout-guided CP selection
+
+The key thing is to match keypoints for one pair of images
+at a time. A list of pairs to be processed will be created,
+based on overlaps predicted by the layout.
+
+The overlaps should be evaluated using only (Y,P) and some
+kind of average image diameter. Then candidate CPs can be
+validated (for each pair) as follows.
+
+1) map KP coordinates to the sphere (using lens fn, including
+correction if known).
+2) repeat {
+ find rotation of one image around optic axis that minimizes
+ the variance of KP differences (considered as 3-vectors);
+ discard outlier CPs;
+} until( set is pretty compact );
+3) If there are more than maxmatches CPs left, sort them on
+position across the line between image centers, divide into
+maxmatches groups, and keep the strongest CP in each group.
+
+If there is no layout, it is more efficient to match KPs for
+all images at once, as now; however for really big jobs it
+might be necessary to divide the kp's into several groups &
+do global matching on those. Anyhow, we should then select
+the image pairs having decent numbers of matches and do the
+rotational refinement on those.
+
+It would be possible to construct a complete alignment from
+the results of the pairwise alignments. But perhaps just a
+consistency check is enough.
+
+It might be feasible to use a Monte Carlo approach to
+build the overlapping pairs list: Match a random selection
+of keypoints (equal numbers from each image), count matches
+by pair, use the pairs with above average numbers of matches.
+This could be a good check for layout errors, too.
+
+So I need a KP matching subroutine that will support all
+these modes. For full generality it should take a list of
+KP lists to be loaded into the k-d tree, and a second list
+of KP lists to be used as probes, and output a list of CPs
+(caller can separate that into lists by image pair).
+
+And a rotational optimizer that takes a list of CPs for a
+single pair of images; the projection specifications; and
+maybe a tuning parameter or two, and returns the subset of
+good CPs and the relative alignment of the pair. I don't
+think this needs to be given an initial alignment.
+
+Infrastructure---
+I'd like to abandon Nowozin's MultiMatch structure as it
+puts all KP data and CP data "in one basket", making it
+hard to partition a big job pairwise. That will mean
+abandoning his polishing fns too, as they all assume a
+MultiMatch. So with this change the "autopano" part of
+APSCpp will become a completely different program from
+autopano.
+
+For a performance boost on multicore systems, it would be
+good to repackage the KP finder as a task (or a separate
+command pgm).
+
+But first, test whether there are any systematic coordinate
+errors in CPs:
+-- make project with an image and same rotated 90 degrees;
+ check optimization errors.
+1) Hugin assigns different focal lengths to the 2 images, so
+must set them equal by hand. It then stitches them with near
+perfect cancellation, either with the 90 deg rotation set at
+load, or using CPS from legacy APSCpp.
+PFS_093-PFS_093-rot.pto, "8mm crop 1.60149 circular fisheye".
+2)Run this thru APSCpp 2.5.2 giving
+ 93-93r-stg.pto -- maxdim 1600, stg on
+ Hugin and PTAsm display CP at same spots in both images;
+ Hugin gets good auto alignment after deleting 2 bad CPS.
+ PTAsm auto alignment fails.
+ 93-93r-nostg.pto -- maxdim 1600, stg off
+ Hug & Pta show CPs not coinciding,
+ Hug auto alignment very bad.
+Clearly I am botching CP rescaling when the stg is off.
+-- try re-using the pre-find remapper & (when stg off) inverting
+the pre-find scale. Now both stg on & stg off CPs are misplaced!
+The relative positions are same in both images, but all are in
+the wrong places.
+So must review how to prescale & scale back.... tomorrow.
+
+23 July kp coord scaling tests w/rotated image pairs
+-- put stg rescaling back the way it was. Compute true factor
+ from long image axis instead of width.
+Now stg on gives good match w/90 deg rot (1 wild CP), stg off
+still gives shifted CP sets.
+-- try 180 deg rotation: PFS_093-PFS_093-180.pto
+stg on: perfect alignment (1 bad point).
+stg off: perfect alignment (2 bad points).
+
+So it looks like N. code gets coords wrong on 90 deg rot, and
+SAremap somehow corrects that?? No, as usual the fault is all
+mine: I forgot to make undoing the stereographic mapping
+conditional on having done it in the first place. With that
+fixed the no-stg 90 deg case aligns perfectly (0 bad pnts) --
+indeed significantly better than with stg enabled, which means
+the remapping makes SIFT localization a bit less certain.
+
+Now that it's working, improve the API some more....
+-- lens-type option to override PT format codes.
+-- focal-length + crop factor option to override hfovs.
+-- lens-correction option to use a,b,c,d,e from project.
+
+26 July BUT FIRST -- some more testing
+
+Test set: L:EOSPix\StFx\IMG_7346-7350.pts. Six 15mm fisheye
+pix that stitch well with PTGui. Run APSCpp with ransac on,
+maxdim 1600 (2.19x reduction), autoalign with Hugin...
+ result CPs Avg Worst
+ PTGui autoalign 200 1.0 7.8
+ no stg 245 2.9 35.4
+ no stg + refine 249 3.5 307
+ stg 222 2.1 17.5
+ stg + refine 241 2.7 26.8
+and at full source resolution...
+ no stg, full rez 334 2.9 20.6
+ stg, full rez 296 2.1 19.2
+
+Stereographic remapping seems quite worthwhile, and gives
+a big payoff per CPU second because it runs very fast.
+
+Reducing resolution did not degrade CP quality measurably.
+
+The refine option takes a very long time and makes the result
+worse. It is actually an attempt to find SIFT CPs over again
+at original resolution, in small patches around the found CPs.
+I think I'll drop it, possibly in favor of something like local
+correlation, perhaps on patches that have be reprojected to
+on-axis rectilinear...
+
+Anyhow the bottom line is that APSCpp's CPs are still far
+worse than PTGui's. And it takes about 5 times longer to
+find them.
+
+BTW ransac does prune some bad points, but not enough, it
+needs attention too.
+
+BTW
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|