You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
(19) |
Nov
(22) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(18) |
Feb
(15) |
Mar
(4) |
Apr
(21) |
May
(5) |
Jun
|
Jul
(21) |
Aug
(6) |
Sep
(8) |
Oct
(1) |
Nov
(8) |
Dec
(17) |
2008 |
Jan
(36) |
Feb
(19) |
Mar
(11) |
Apr
(7) |
May
(3) |
Jun
(9) |
Jul
(10) |
Aug
(12) |
Sep
(27) |
Oct
(8) |
Nov
(2) |
Dec
(9) |
2009 |
Jan
(5) |
Feb
(29) |
Mar
(3) |
Apr
(6) |
May
(17) |
Jun
(18) |
Jul
(16) |
Aug
(24) |
Sep
(59) |
Oct
(27) |
Nov
(49) |
Dec
(31) |
2010 |
Jan
(47) |
Feb
(5) |
Mar
(5) |
Apr
(14) |
May
(4) |
Jun
(4) |
Jul
(8) |
Aug
(5) |
Sep
(8) |
Oct
(2) |
Nov
|
Dec
(1) |
2011 |
Jan
(17) |
Feb
(10) |
Mar
(46) |
Apr
|
May
(3) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2012 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(5) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(9) |
Oct
|
Nov
(1) |
Dec
(1) |
2013 |
Jan
(8) |
Feb
(1) |
Mar
(14) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <pan...@li...> - 2013-04-12 16:55:06
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/04c52cae988a changeset: 784:04c52cae988a user: tmodes date: Fri Apr 12 18:56:04 2013 +0200 description: Fixes wrong calculation in triplane_erect diffstat: math.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diffs (25 lines): diff -r 8ccb62eb329a -r 04c52cae988a math.c --- a/math.c Thu Mar 21 10:42:32 2013 +1100 +++ b/math.c Fri Apr 12 18:56:04 2013 +0200 @@ -2322,8 +2322,8 @@ }; if(x_dest < -mp->pn->precomputedValue[0] / 2) { - x=x_dest -mp->pn->precomputedValue[0] * mp->distance; - offset = mp->pn->precomputedValue[1]; + x=x_dest + mp->pn->precomputedValue[0] * mp->distance; + offset = - mp->pn->precomputedValue[1]; } else if (x_dest < mp->pn->precomputedValue[0] / 2) { @@ -2332,8 +2332,8 @@ } else { - x=x_dest + mp->pn->precomputedValue[0] * mp->distance; - offset = - mp->pn->precomputedValue[1]; + x=x_dest - mp->pn->precomputedValue[0] * mp->distance; + offset = + mp->pn->precomputedValue[1]; } rect_erect(x,y_dest,x_src,y_src,&mp->distance); *x_src += offset; |
From: <pan...@li...> - 2013-03-20 23:48:03
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/8ccb62eb329a changeset: 783:8ccb62eb329a user: td...@ii... date: Thu Mar 21 10:42:32 2013 +1100 description: fix for removed .def files diffstat: Makefile.am | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (17 lines): diff -r 3b87e44598ea -r 8ccb62eb329a Makefile.am --- a/Makefile.am Sun Mar 17 18:55:57 2013 +0100 +++ b/Makefile.am Thu Mar 21 10:42:32 2013 +1100 @@ -126,11 +126,11 @@ CMakeLists.txt \ ChangeLog.hg \ dump.c dump.h \ - bootstrap filter.r libpano13.def pano13.rc \ + bootstrap filter.r pano13.rc \ seamer_.c sys_X11.c sys_win.c bmp.c shell_mac.c \ sys_mac.c ppm.c sys_ansi.c ppm.c ZComb.h adjust.h \ libpano.sln LocalDefs.vsprops \ - pano13vc.def libpano.vcproj PanoTools.pbproj.tgz + libpano.vcproj PanoTools.pbproj.tgz MAINTAINERCLEANFILES = \ aclocal.m4 \ |
From: <bru...@us...> - 2013-03-20 23:01:28
|
Revision: 1357 http://panotools.svn.sourceforge.net/panotools/?rev=1357&view=rev Author: brunopostle Date: 2013-03-20 23:01:21 +0000 (Wed, 20 Mar 2013) Log Message: ----------- Support new Tpp and Tpy parameters Modified Paths: -------------- trunk/Panotools-Script/Changes trunk/Panotools-Script/bin/ptovariable trunk/Panotools-Script/lib/Panotools/Script/Line/Image.pm trunk/Panotools-Script/lib/Panotools/Script/Line/Panorama.pm trunk/Panotools-Script/lib/Panotools/Script/Line/Variable.pm Modified: trunk/Panotools-Script/Changes =================================================================== --- trunk/Panotools-Script/Changes 2013-01-31 21:31:23 UTC (rev 1356) +++ trunk/Panotools-Script/Changes 2013-03-20 23:01:21 UTC (rev 1357) @@ -5,6 +5,7 @@ - new tool: pto2gpano - add GPano XMP metadata - ptovariable: support XYZ translation parameters - match-n-shift: create a project based on a CSV list input file + - support new Tpy,Tpp yaw and pitch of remapping plane for translation 0.27 - remove linux desktop entries for tif2svg-gui enblend-svg process-masks-gui qtvr2erect-gui Modified: trunk/Panotools-Script/bin/ptovariable =================================================================== --- trunk/Panotools-Script/bin/ptovariable 2013-01-31 21:31:23 UTC (rev 1356) +++ trunk/Panotools-Script/bin/ptovariable 2013-03-20 23:01:21 UTC (rev 1357) @@ -17,6 +17,8 @@ my @TrX; my @TrY; my @TrZ; +my @Tpp; +my @Tpy; my $view = 0; my $barrel = 0; my $centre = 0; @@ -42,6 +44,8 @@ 'TrX=i' => \@TrX, 'TrY=i' => \@TrY, 'TrZ=i' => \@TrZ, + 'Tpp=i' => \@Tpp, + 'Tpy=i' => \@Tpy, 'vignetting' => \$vignetting, 'vignetting-centre' => \$vignetting_centre, 'response' => \$response, @@ -107,6 +111,9 @@ $variable->{$_}->{TrY} = 1 for (@TrY); $variable->{$_}->{TrZ} = 1 for (@TrZ); +$variable->{$_}->{Tpp} = 1 for (@Tpp); +$variable->{$_}->{Tpy} = 1 for (@Tpy); + $pto->Write ($path_output); __END__ Modified: trunk/Panotools-Script/lib/Panotools/Script/Line/Image.pm =================================================================== --- trunk/Panotools-Script/lib/Panotools/Script/Line/Image.pm 2013-01-31 21:31:23 UTC (rev 1356) +++ trunk/Panotools-Script/lib/Panotools/Script/Line/Image.pm 2013-03-20 23:01:21 UTC (rev 1357) @@ -70,6 +70,8 @@ TrX,TrY,TrZ Translation on x axis, y axis, z axis + Tpy,Tpp yaw and pitch of remapping plane for translation + Te0,Te1,Te2,Te3 Test parameters Vm vignetting correction mode (default 0): @@ -124,9 +126,9 @@ %{$self} = (a => 0, b => 0, c => 0, d => 0, e => 0, r => 0, p => 0, y => 0); } -sub _valid { return '^([abcdefghjnprtvwy]|[SCXYZ]|K[0-2][ab]|V[abcdfmxy]|Eev|E[rb]|Te[0123]|Tr[XYZ]|Ti[XYZS]|R[abcde])(.*)' } +sub _valid { return '^([abcdefghjnprtvwy]|[SCXYZ]|K[0-2][ab]|V[abcdfmxy]|Eev|E[rb]|Tp[yp]|Te[0123]|Tr[XYZ]|Ti[XYZS]|R[abcde])(.*)' } -sub _valid_ptoptimizer { return '^([abcdefghnprtvwySC]|Te[0123]|Tr[XYZ]|Ti[XYZS])(.*)' } +sub _valid_ptoptimizer { return '^([abcdefghnprtvwySC]|Tp[yp]|Te[0123]|Tr[XYZ]|Ti[XYZS])(.*)' } sub _sanitise_ptoptimizer { Modified: trunk/Panotools-Script/lib/Panotools/Script/Line/Panorama.pm =================================================================== --- trunk/Panotools-Script/lib/Panotools/Script/Line/Panorama.pm 2013-01-31 21:31:23 UTC (rev 1356) +++ trunk/Panotools-Script/lib/Panotools/Script/Line/Panorama.pm 2013-03-20 23:01:21 UTC (rev 1357) @@ -36,6 +36,9 @@ 16 - Equirectangular Panini 17 - Biplane 18 - Triplane + 19 - Panini_General + 20 - Thoby + 21 - Hammer v360 horizontal field of view of panorama (default 360) nPICT Panorama file format, one of: Modified: trunk/Panotools-Script/lib/Panotools/Script/Line/Variable.pm =================================================================== --- trunk/Panotools-Script/lib/Panotools/Script/Line/Variable.pm 2013-01-31 21:31:23 UTC (rev 1356) +++ trunk/Panotools-Script/lib/Panotools/Script/Line/Variable.pm 2013-03-20 23:01:21 UTC (rev 1357) @@ -38,6 +38,8 @@ TrX3 Optimise x-coordinate of image 3, mosaic/translation mode TrY2 Optimise y-coordinate of image 2, mosaic/translation mode TrZ1 Optimise z-coordinate of image 1, mosaic/translation mode + Tpp1 Optimise pitch of picture plane of image 1, mosaic/translation mode + Tpy1 Optimise yaw of picture plane of image 1, mosaic/translation mode Additionally, photometric optimisation uses the same system. although this is a secondary process and not simultaneous with geometric optimisation: @@ -63,7 +65,7 @@ =cut -sub _valid { return '^([abcdegprtvyXYZ]|Te[0123]|Tr[XYZ]|Ti[XYZS]|Eev|Er|Eb|Ra|Rb|Rc|Rd|Re|Va|Vb|Vc|Vd|Vx|Vy)(.*)' } +sub _valid { return '^([abcdegprtvyXYZ]|Te[0123]|Tp[py]|Tr[XYZ]|Ti[XYZS]|Eev|Er|Eb|Ra|Rb|Rc|Rd|Re|Va|Vb|Vc|Vd|Vx|Vy)(.*)' } sub Identifier { @@ -76,10 +78,10 @@ my $self = shift; my $string = shift || return 0; my $valid = $self->_valid; - my @res = $string =~ / ([a-zERV]+[0-9]+)/g; + my @res = $string =~ / ([a-zA-Z]+[0-9]+)/g; for my $token (grep { defined $_ } @res) { - my ($param, $image) = $token =~ /([a-zERV]+)([0-9]+)/; + my ($param, $image) = $token =~ /([a-zA-Z]+)([0-9]+)/; next unless defined $image; $self->{$image}->{$param} = 1; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@li...> - 2013-03-17 17:55:53
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/3b87e44598ea changeset: 782:3b87e44598ea user: tmodes date: Sun Mar 17 18:55:57 2013 +0100 description: [Windows] Use __declspec(dllexport) instead of modul definition file Functions exported via modul definition file can't be compared with function points (needed by nona gpu). Function pointers works for functions exported with __declspec(dllexport). diffstat: CMakeLists.txt | 2 +- ColourBrightness.h | 30 +- PTcommon.h | 32 +- ZComb.h | 16 +- file.h | 27 +- filter.h | 592 +++++++++++++++++++++++++-------------------------- libpano13.def | 197 ----------------- pano13vc.def | 240 --------------------- panorama.h | 18 +- ptfeather.h | 2 +- ptstitch.h | 8 +- pttiff.h | 65 ++-- queryfeature.h | 11 +- tools/PToptimizer.c | 1 - 14 files changed, 402 insertions(+), 839 deletions(-) diffs (truncated from 1583 to 500 lines): diff -r 4b93725a1f29 -r 3b87e44598ea CMakeLists.txt --- a/CMakeLists.txt Sun Mar 17 08:08:09 2013 +0100 +++ b/CMakeLists.txt Sun Mar 17 18:55:57 2013 +0100 @@ -205,7 +205,6 @@ set(pano13_res pano13.rc - pano13vc.def ) set(pano13_src @@ -268,6 +267,7 @@ else() IF(BUILD_DLL) # Create and install shared library + ADD_DEFINITIONS(-DPANO13_DLL) add_library(pano13 SHARED ${pano13_hdr} ${pano13_res} ${pano13_src}) target_link_libraries(pano13 ${_common_libs}) set_target_properties(pano13 PROPERTIES VERSION "2.0.0" SOVERSION "2") diff -r 4b93725a1f29 -r 3b87e44598ea ColourBrightness.h --- a/ColourBrightness.h Sun Mar 17 08:08:09 2013 +0100 +++ b/ColourBrightness.h Sun Mar 17 18:55:57 2013 +0100 @@ -66,27 +66,27 @@ } calla_struct; -histograms_struct*ReadHistograms (fullPath *fullPathImages, int counterImages); -int ComputeColourBrightnessCorrection(calla_struct *calla); -int CorrectFileColourBrightness(fullPath *inPath, fullPath *outPath, magnolia_struct *magnolia, int parm3); -int FindNextCandidate(int candidates[], calla_struct *calla); +PANO13_IMPEX histograms_struct*ReadHistograms (fullPath *fullPathImages, int counterImages); +PANO13_IMPEX int ComputeColourBrightnessCorrection(calla_struct *calla); +PANO13_IMPEX int CorrectFileColourBrightness(fullPath *inPath, fullPath *outPath, magnolia_struct *magnolia, int parm3); +PANO13_IMPEX int FindNextCandidate(int candidates[], calla_struct *calla); -magnolia_struct *InitializeMagnolia(int numberImages, int size, calla_function parm2); -void ColourBrightness( fullPath *fullPathImages, fullPath *outFullPathImages, int counterImages, int indexReferenceImage, int parm3,int createCurvesType); -void CorrectImageColourBrigthness(Image *image, magnolia_struct *magnolia, int parm3); -void FreeHistograms(histograms_struct *ptrHistograms, int count); -void RemapHistogram(int *histogram, double *array, magnolia_struct *magnolia, int channel); -void ComputeAdjustmentCurve(double *sourceHistogram, double *targetHistogram, double *curve) ; +PANO13_IMPEX magnolia_struct *InitializeMagnolia(int numberImages, int size, calla_function parm2); +PANO13_IMPEX void ColourBrightness( fullPath *fullPathImages, fullPath *outFullPathImages, int counterImages, int indexReferenceImage, int parm3,int createCurvesType); +PANO13_IMPEX void CorrectImageColourBrigthness(Image *image, magnolia_struct *magnolia, int parm3); +PANO13_IMPEX void FreeHistograms(histograms_struct *ptrHistograms, int count); +PANO13_IMPEX void RemapHistogram(int *histogram, double *array, magnolia_struct *magnolia, int channel); +PANO13_IMPEX void ComputeAdjustmentCurve(double *sourceHistogram, double *targetHistogram, double *curve) ; unsigned char Unknown47(unsigned char parm0, unsigned char parm1, unsigned char parm2); unsigned char Unknown48(unsigned char parm0, unsigned char parm1, unsigned char parm2); unsigned char Unknown49(unsigned char parm0, unsigned char parm1, unsigned char parm2); -double MapFunction(double p[], double x, int n); -int RemapPoint(int value, double mapTable[]) ; +PANO13_IMPEX double MapFunction(double p[], double x, int n); +PANO13_IMPEX int RemapPoint(int value, double mapTable[]) ; -unsigned char panoColourComputeHue(unsigned char red, unsigned char green, unsigned char blue); -unsigned char panoColourComputeIntensity(unsigned char red, unsigned char green, unsigned char blue); -unsigned char panoColourComputeSaturation (unsigned char red, unsigned char green, unsigned char blue); +PANO13_IMPEX unsigned char panoColourComputeHue(unsigned char red, unsigned char green, unsigned char blue); +PANO13_IMPEX unsigned char panoColourComputeIntensity(unsigned char red, unsigned char green, unsigned char blue); +PANO13_IMPEX unsigned char panoColourComputeSaturation (unsigned char red, unsigned char green, unsigned char blue); /* The parameter createCurvesType indicates the type of output format: arbitrary map (.amp) or smooth map (.acv). diff -r 4b93725a1f29 -r 3b87e44598ea PTcommon.h --- a/PTcommon.h Sun Mar 17 08:08:09 2013 +0100 +++ b/PTcommon.h Sun Mar 17 18:55:57 2013 +0100 @@ -48,40 +48,38 @@ } pt_tiff_parms; -extern int ptQuietFlag; +PANO13_IMPEX extern int ptQuietFlag; -int panoVerifyTiffsAreCompatible(fullPath *tiffFiles, int filesCount, int optionalCheck); -int panoAddStitchingMasks(fullPath *inputFiles, fullPath *outputFiles, int numberImages, int featherSize); +PANO13_IMPEX int panoVerifyTiffsAreCompatible(fullPath *tiffFiles, int filesCount, int optionalCheck); +PANO13_IMPEX int panoAddStitchingMasks(fullPath *inputFiles, fullPath *outputFiles, int numberImages, int featherSize); /* defined in ptpicker.c, but never exported */ -int panoFlattenTIFF(fullPath *fullPathImages, int counterImageFiles, fullPath *outputFileName, int removeOriginals); - - +PANO13_IMPEX int panoFlattenTIFF(fullPath *fullPathImages, int counterImageFiles, fullPath *outputFileName, int removeOriginals); extern int quietFlag; -int panoPSDCreate( fullPath *fullPathImages, int, fullPath*, pano_flattening_parms*); -int panoCreateLayeredPSD( fullPath *fullPathImages, int, fullPath*, pano_flattening_parms*); +PANO13_IMPEX int panoPSDCreate( fullPath *fullPathImages, int, fullPath*, pano_flattening_parms*); +PANO13_IMPEX int panoCreateLayeredPSD( fullPath *fullPathImages, int, fullPath*, pano_flattening_parms*); -int panoCreatePanorama(fullPath ptrImageFileNames[], int counterImageFiles, fullPath *panoFileName, fullPath *scriptFileName); -void ARGtoRGBAImage(Image *im); -void panoReplaceExt(char* filename, char *extension); -int panoUnCropTiff(char *inputFile, char *outputFile); +PANO13_IMPEX int panoCreatePanorama(fullPath ptrImageFileNames[], int counterImageFiles, fullPath *panoFileName, fullPath *scriptFileName); +PANO13_IMPEX void ARGtoRGBAImage(Image *im); +PANO13_IMPEX void panoReplaceExt(char* filename, char *extension); +PANO13_IMPEX int panoUnCropTiff(char *inputFile, char *outputFile); -int StringtoFullPath (fullPath *path, char *filename); -void InsertFileName( fullPath *fp, char *fname ); -int ApplyFeather(fullPath * inputFile, fullPath * outputFile, +PANO13_IMPEX int StringtoFullPath(fullPath *path, char *filename); +PANO13_IMPEX void InsertFileName( fullPath *fp, char *fname ); +PANO13_IMPEX int ApplyFeather(fullPath * inputFile, fullPath * outputFile, int featherSize); /*****************/ #define PANO_CROPPING_UNCROP 1 #define PANO_CROPPING_CROP 2 -int panoCroppingMain(int argc,char *argv[], int operation, char *version,char *usage, char *defaultPrefix); +PANO13_IMPEX int panoCroppingMain(int argc,char *argv[], int operation, char *version,char *usage, char *defaultPrefix); -void panoPrintImage(char *msg, Image *im); +PANO13_IMPEX void panoPrintImage(char *msg, Image *im); #ifndef min #define min(a,b) ((a) <= (b) ? (a) : (b)) diff -r 4b93725a1f29 -r 3b87e44598ea ZComb.h --- a/ZComb.h Sun Mar 17 08:08:09 2013 +0100 +++ b/ZComb.h Sun Mar 17 18:55:57 2013 +0100 @@ -15,11 +15,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -void ZCombSetDisabled(void); -void ZCombSetEnabled(void); -void ZCombSetMaskType(int mt); -void ZCombSetFocusWindowHalfwidth(int fwh); -void ZCombSetSmoothingWindowHalfwidth(int swh); -void ZCombSetMaskFromFocusData(Image *im); -void ZCombSetGreenTo255(Image *im); -int ZCombSeeImage(Image *im, char *filename); +PANO13_IMPEX void ZCombSetDisabled(void); +PANO13_IMPEX void ZCombSetEnabled(void); +PANO13_IMPEX void ZCombSetMaskType(int mt); +PANO13_IMPEX void ZCombSetFocusWindowHalfwidth(int fwh); +PANO13_IMPEX void ZCombSetSmoothingWindowHalfwidth(int swh); +PANO13_IMPEX void ZCombSetMaskFromFocusData(Image *im); +PANO13_IMPEX void ZCombSetGreenTo255(Image *im); +PANO13_IMPEX int ZCombSeeImage(Image *im, char *filename); diff -r 4b93725a1f29 -r 3b87e44598ea file.h --- a/file.h Sun Mar 17 08:08:09 2013 +0100 +++ b/file.h Sun Mar 17 18:55:57 2013 +0100 @@ -32,17 +32,17 @@ #define __FILE_H__ // these are defined in file.c -int panoImageRead(Image * im, fullPath * sfile); -int panoFileMakeTemp(fullPath * path); +PANO13_IMPEX int panoImageRead(Image * im, fullPath * sfile); +PANO13_IMPEX int panoFileMakeTemp(fullPath * path); // and these are defined in bmp.c, jpeg.c, hdrfile.c, png.c, and ppm.c // but there is no point in creating a file for each one of them -int panoBMPRead(Image *im, fullPath *sfile ); -int panoJPEGRead(Image * im, fullPath * sfile); -int panoHDRRead(Image *im, fullPath *sfile ); -int panoPNGRead(Image *im, fullPath *sfile ); -int panoPPMRead(Image * im, fullPath * sfile); +PANO13_IMPEX int panoBMPRead(Image *im, fullPath *sfile ); +PANO13_IMPEX int panoJPEGRead(Image * im, fullPath * sfile); +PANO13_IMPEX int panoHDRRead(Image *im, fullPath *sfile ); +PANO13_IMPEX int panoPNGRead(Image *im, fullPath *sfile ); +PANO13_IMPEX int panoPPMRead(Image * im, fullPath * sfile); typedef struct { @@ -79,17 +79,16 @@ -extern char *psdBlendingModesNames[PSD_NUMBER_BLENDING_MODES]; +PANO13_IMPEX extern char *psdBlendingModesNames[PSD_NUMBER_BLENDING_MODES]; -extern char *psdBlendingModesInternalName[PSD_NUMBER_BLENDING_MODES]; +PANO13_IMPEX extern char *psdBlendingModesInternalName[PSD_NUMBER_BLENDING_MODES]; -int panoFileOutputNamesCreate(fullPath *ptrOutputFiles, int filesCount, char* outputPrefix); +PANO13_IMPEX int panoFileOutputNamesCreate(fullPath *ptrOutputFiles, int filesCount, char* outputPrefix); -char *panoFileExists(fullPath *ptrFiles, int filesCount); +PANO13_IMPEX char *panoFileExists(fullPath *ptrFiles, int filesCount); -int panoSingleFileExists(char * filename); +PANO13_IMPEX int panoSingleFileExists(char * filename); -int panoFileDeleteMultiple(fullPath* files, int filesCount); - +PANO13_IMPEX int panoFileDeleteMultiple(fullPath* files, int filesCount); #endif diff -r 4b93725a1f29 -r 3b87e44598ea filter.h --- a/filter.h Sun Mar 17 08:08:09 2013 +0100 +++ b/filter.h Sun Mar 17 18:55:57 2013 +0100 @@ -20,7 +20,6 @@ #ifndef FILTER_H #define FILTER_H - #include <math.h> #include <stdio.h> #include <stdarg.h> @@ -89,7 +88,7 @@ #define MAX_FISHEYE_FOV 179.0 extern int JavaUI; // Flag to indicate use of java dialogs -void JPrintError( char* text ); +PANO13_IMPEX void JPrintError( char* text ); #define FAST_TRANSFORM_STEP_NORMAL 40 #define FAST_TRANSFORM_STEP_MORPH 6 @@ -478,7 +477,7 @@ -void filter_main( TrformStr *TrPtr, sPrefs *spref); +PANO13_IMPEX void filter_main( TrformStr *TrPtr, sPrefs *spref); // Transformation function type (we have only one...) @@ -558,11 +557,11 @@ //---------------------------------- Functions identical in all platforms ------------------------ -void dispatch (TrformStr *TrPtr, sPrefs *s); // Entry into platform independent code -void DoTransForm (TrformStr *TrPtr, panoPrefs *p ); +PANO13_IMPEX void dispatch (TrformStr *TrPtr, sPrefs *s); // Entry into platform independent code +PANO13_IMPEX void DoTransForm (TrformStr *TrPtr, panoPrefs *p ); -void setLibToResFile ( void ); // MacOS: Get resources from shared lib -void unsetLibToResFile( void ); // MacOS: Don't get resources from shared lib +PANO13_IMPEX void setLibToResFile ( void ); // MacOS: Get resources from shared lib +PANO13_IMPEX void unsetLibToResFile( void ); // MacOS: Don't get resources from shared lib enum{ // Enumerates used by Progress and infoDlg _initProgress, // display message "argument" @@ -571,113 +570,112 @@ _idleProgress // do nothing; on Mac: call waitnextevent; }; -void PT_setProgressFcn(int (*ptr)(int, char *)); // set custom progress callback -int Progress( int command, char* argument ); // Progress Reporting -void PT_setInfoDlgFcn(int (*ptr)(int, char *)); // set custom info callback -int infoDlg ( int command, char* argument ); // Display info: same argumenmts as progress -void PT_setErrorFcn( void (*ptr)( char* , va_list va)); // set custom error function -void PrintError( char* fmt, ...); // Error Reporting -void dieWithError(char*fmt, ...); +PANO13_IMPEX void PT_setProgressFcn(int (*ptr)(int, char *)); // set custom progress callback +PANO13_IMPEX int Progress( int command, char* argument ); // Progress Reporting +PANO13_IMPEX void PT_setInfoDlgFcn(int (*ptr)(int, char *)); // set custom info callback +PANO13_IMPEX int infoDlg ( int command, char* argument ); // Display info: same argumenmts as progress +PANO13_IMPEX void PT_setErrorFcn( void (*ptr)( char* , va_list va)); // set custom error function +PANO13_IMPEX void PrintError( char* fmt, ...); // Error Reporting +PANO13_IMPEX void dieWithError(char*fmt, ...); -int ccommand( char ***argvPtr); // Shell for standalone programs +PANO13_IMPEX int ccommand( char ***argvPtr); // Shell for standalone programs // Panorama Tool functions -void perspective (TrformStr *TrPtr, pPrefs *p); -void correct (TrformStr *TrPtr, cPrefs *c); -void remap (TrformStr *TrPtr, rPrefs *r); -void adjust (TrformStr *TrPtr, aPrefs *a); -void pan (TrformStr *TrPtr, panControls *pc); - - - +PANO13_IMPEX void perspective (TrformStr *TrPtr, pPrefs *p); +PANO13_IMPEX void correct (TrformStr *TrPtr, cPrefs *c); +PANO13_IMPEX void remap (TrformStr *TrPtr, rPrefs *r); +PANO13_IMPEX void adjust (TrformStr *TrPtr, aPrefs *a); +PANO13_IMPEX void pan (TrformStr *TrPtr, panControls *pc); // Set Struct defaults -void SetPrefDefaults (panoPrefs *prPtr, int selector); -void SetCorrectDefaults ( cPrefs *p ); -void SetAdjustDefaults ( aPrefs *p ); -void SetRemapDefaults ( rPrefs *p ); -void SetPerspectiveDefaults ( pPrefs *p ); -void SetImageDefaults ( Image *im); -void SetOptDefaults ( optVars *opt ); -void SetPanDefaults ( panControls *pc); -void SetSizeDefaults ( sPrefs *pref); -void SetStitchDefaults ( stBuf *sbuf); -void SetVRPanoOptionsDefaults( VRPanoOptions *v); -void SettMatrixDefaults ( tMatrix *t ); -void SetCoordDefaults ( CoordInfo *c, int num); +PANO13_IMPEX void SetPrefDefaults (panoPrefs *prPtr, int selector); +PANO13_IMPEX void SetCorrectDefaults ( cPrefs *p ); +PANO13_IMPEX void SetAdjustDefaults ( aPrefs *p ); +PANO13_IMPEX void SetRemapDefaults ( rPrefs *p ); +PANO13_IMPEX void SetPerspectiveDefaults ( pPrefs *p ); +PANO13_IMPEX void SetImageDefaults ( Image *im); +PANO13_IMPEX void SetOptDefaults ( optVars *opt ); +PANO13_IMPEX void SetPanDefaults ( panControls *pc); +PANO13_IMPEX void SetSizeDefaults ( sPrefs *pref); +PANO13_IMPEX void SetStitchDefaults ( stBuf *sbuf); +PANO13_IMPEX void SetVRPanoOptionsDefaults( VRPanoOptions *v); +PANO13_IMPEX void SettMatrixDefaults ( tMatrix *t ); +PANO13_IMPEX void SetCoordDefaults ( CoordInfo *c, int num); -int SetAlignParams ( double *x ); -int SetLMParams ( double *x ); -void SetGlobalPtr ( AlignInfo *p ); +PANO13_IMPEX int SetAlignParams ( double *x ); +PANO13_IMPEX int SetLMParams ( double *x ); +PANO13_IMPEX void SetGlobalPtr ( AlignInfo *p ); +PANO13_IMPEX int CheckParams( AlignInfo *g ); +PANO13_IMPEX void setFcnPanoHuberSigma(double sigma); // Dialogs -int SetPrefs ( panoPrefs *p ); -int SetPanPrefs ( panControls *p ); -int SetCorrectPrefs ( cPrefs *p ); -int SetRadialOptions ( cPrefs *p ); -int SetHorizontalOptions ( cPrefs *p ); -int SetVerticalOptions ( cPrefs *p ); -int SetShearOptions ( cPrefs *p ); -int SetScaleOptions ( cPrefs *p ); -int SetLumOptions ( cPrefs *p ); -int setSizePrefs ( sPrefs *p, int can_resize ); -int SetRemapPrefs ( rPrefs *p ); -int SetPerspectivePrefs ( pPrefs *p ); -int SetAdjustPrefs ( aPrefs *p ); -int SetInterpolator ( sPrefs *p ); -int SetCreateOptions ( aPrefs *p ); -int SetCutOptions ( cPrefs *p ); -int SetFourierOptions ( cPrefs *p ); +PANO13_IMPEX int SetPrefs ( panoPrefs *p ); +PANO13_IMPEX int SetPanPrefs ( panControls *p ); +PANO13_IMPEX int SetCorrectPrefs ( cPrefs *p ); +PANO13_IMPEX int SetRadialOptions ( cPrefs *p ); +PANO13_IMPEX int SetHorizontalOptions ( cPrefs *p ); +PANO13_IMPEX int SetVerticalOptions ( cPrefs *p ); +PANO13_IMPEX int SetShearOptions ( cPrefs *p ); +PANO13_IMPEX int SetScaleOptions ( cPrefs *p ); +PANO13_IMPEX int SetLumOptions ( cPrefs *p ); +PANO13_IMPEX int setSizePrefs ( sPrefs *p, int can_resize ); +PANO13_IMPEX int SetRemapPrefs ( rPrefs *p ); +PANO13_IMPEX int SetPerspectivePrefs ( pPrefs *p ); +PANO13_IMPEX int SetAdjustPrefs ( aPrefs *p ); +PANO13_IMPEX int SetInterpolator ( sPrefs *p ); +PANO13_IMPEX int SetCreateOptions ( aPrefs *p ); +PANO13_IMPEX int SetCutOptions ( cPrefs *p ); +PANO13_IMPEX int SetFourierOptions ( cPrefs *p ); // File I/O -int readPrefs (char* p, int selector ); // Preferences, same selector as dispatch -void writePrefs (char* p, int selector ); // Preferences, same selector as dispatch +PANO13_IMPEX int readPrefs (char* p, int selector ); // Preferences, same selector as dispatch +PANO13_IMPEX void writePrefs (char* p, int selector ); // Preferences, same selector as dispatch -int LoadBufImage ( Image *image, char *fname, int mode); -int SaveBufImage ( Image *image, char *fname ); -int writeCroppedTIFF ( Image *im, fullPath *sfile, CropInfo *crop_info); -int writeTIFF ( Image *im, fullPath *fname); // On Mac: fname is FSSpec* -void SaveOptions ( struct correct_Prefs * thePrefs ); -int LoadOptions ( struct correct_Prefs * thePrefs ); -void FindScript ( struct adjust_Prefs *thePrefs ); -char* LoadScript ( fullPath* scriptFile ); -int WriteScript ( char* res, fullPath* scriptFile, int launch ); +PANO13_IMPEX int LoadBufImage ( Image *image, char *fname, int mode); +PANO13_IMPEX int SaveBufImage ( Image *image, char *fname ); +PANO13_IMPEX int writeCroppedTIFF ( Image *im, fullPath *sfile, CropInfo *crop_info); +PANO13_IMPEX int writeTIFF ( Image *im, fullPath *fname); // On Mac: fname is FSSpec* +PANO13_IMPEX void SaveOptions ( struct correct_Prefs * thePrefs ); +PANO13_IMPEX int LoadOptions ( struct correct_Prefs * thePrefs ); +PANO13_IMPEX void FindScript ( struct adjust_Prefs *thePrefs ); +PANO13_IMPEX char* LoadScript ( fullPath* scriptFile ); +PANO13_IMPEX int WriteScript ( char* res, fullPath* scriptFile, int launch ); // Write PSB and PSD files -int writePS ( Image *im, fullPath* fname, Boolean bBig ); // On Mac: fname is FSSpec* -int writePSD ( Image *im, fullPath* fname ); -int readPSD ( Image *im, fullPath* fname, int mode); // Can handle both PSD and PSB -int writePSwithLayer ( Image *im, fullPath *fname, Boolean bBig); -int writePSDwithLayer ( Image *im, fullPath *fname); -int addLayerToFile ( Image *im, fullPath* sfile, fullPath* dfile, stBuf *sB); //works with PSD & PSB -int readPSDMultiLayerImage( MultiLayerImage *mim, fullPath* sfile); -int FindFile ( fullPath *fname ); -int SaveFileAs ( fullPath *fname, char *prompt, char *name ); -void ConvFileName ( fullPath *fname,char *string); -void showScript ( fullPath* scriptFile ); -void MakeTempName ( fullPath *fspec, char *fname ); -void makePathForResult ( fullPath *path ); -int makePathToHost ( fullPath *path ); -void open_selection ( fullPath *path ); -int GetFullPath (fullPath *path, char *filename); // Somewhat confusing, for compatibility easons -int StringtoFullPath (fullPath *path, char *filename); -int IsTextFile ( char* fname ); -int readPositions ( char* script, transformCoord *tP ); -int readJPEG ( Image *im, fullPath *sfile ); -int readTIFF ( Image *im, fullPath *sfile ); -int writeJPEG ( Image *im, fullPath *sfile, int quality, int progressive ); -int writePNG ( Image *im, fullPath *sfile ); -int readPNG ( Image *im, fullPath *sfile ); -int LaunchAndSendScript(char* application, char* script); -aPrefs* readAdjustLine( fullPath *theScript ); +PANO13_IMPEX int writePS ( Image *im, fullPath* fname, Boolean bBig ); // On Mac: fname is FSSpec* +PANO13_IMPEX int writePSD ( Image *im, fullPath* fname ); +PANO13_IMPEX int readPSD ( Image *im, fullPath* fname, int mode); // Can handle both PSD and PSB +PANO13_IMPEX int writePSwithLayer ( Image *im, fullPath *fname, Boolean bBig); +PANO13_IMPEX int writePSDwithLayer ( Image *im, fullPath *fname); +PANO13_IMPEX int addLayerToFile ( Image *im, fullPath* sfile, fullPath* dfile, stBuf *sB); //works with PSD & PSB +PANO13_IMPEX int readPSDMultiLayerImage( MultiLayerImage *mim, fullPath* sfile); +PANO13_IMPEX int FindFile ( fullPath *fname ); +PANO13_IMPEX int SaveFileAs ( fullPath *fname, char *prompt, char *name ); +PANO13_IMPEX void ConvFileName ( fullPath *fname,char *string); +PANO13_IMPEX void showScript ( fullPath* scriptFile ); +PANO13_IMPEX void MakeTempName ( fullPath *fspec, char *fname ); +PANO13_IMPEX void makePathForResult ( fullPath *path ); +PANO13_IMPEX int makePathToHost ( fullPath *path ); +PANO13_IMPEX void open_selection ( fullPath *path ); +PANO13_IMPEX int GetFullPath (fullPath *path, char *filename); // Somewhat confusing, for compatibility easons +PANO13_IMPEX int StringtoFullPath (fullPath *path, char *filename); +PANO13_IMPEX int IsTextFile ( char* fname ); +PANO13_IMPEX int readPositions ( char* script, transformCoord *tP ); +PANO13_IMPEX int readJPEG ( Image *im, fullPath *sfile ); +PANO13_IMPEX int readTIFF ( Image *im, fullPath *sfile ); +PANO13_IMPEX int writeJPEG ( Image *im, fullPath *sfile, int quality, int progressive ); +PANO13_IMPEX int writePNG ( Image *im, fullPath *sfile ); +PANO13_IMPEX int readPNG ( Image *im, fullPath *sfile ); +PANO13_IMPEX int LaunchAndSendScript(char* application, char* script); +PANO13_IMPEX aPrefs* readAdjustLine( fullPath *theScript ); #ifdef __Mac__ @@ -687,232 +685,232 @@ #endif //int readtif(Image *im, TIFF* tif); -void getCropInformation(char *filename, CropInfo *c); +PANO13_IMPEX void getCropInformation(char *filename, CropInfo *c); // Read and Write Radiance HDR files -int writeHDR ( Image *im, fullPath *sfile ); -int readHDR ( Image *im, fullPath *sfile ); +PANO13_IMPEX int writeHDR ( Image *im, fullPath *sfile ); +PANO13_IMPEX int readHDR ( Image *im, fullPath *sfile ); #define FullPathtoString( path, string ) GetFullPath( path, string) -int ReadMorphPoints( char *script, AlignInfo *gl, int nIm ); +PANO13_IMPEX int ReadMorphPoints( char *script, AlignInfo *gl, int nIm ); // Image manipulation -void addAlpha ( Image *im ); -void transForm ( TrformStr *TrPtr, fDesc *fD, int color); -void transFormEx ( TrformStr *TrPtr, fDesc *fD, fDesc *finvD, int color, int imageNum); -void filter ( TrformStr *TrPtr, flfn func, flfn16 func16, void* params, int color); -void CopyImageData ( Image *dest, Image *src ); -void laplace ( Image *im ); -void blurr ( Image *im ); -void MakePano ( TrformStr *TrPtr, aPrefs *aP); -void MyMakePano ( TrformStr *TrPtr, aPrefs *aP, int imageNum ); -void ExtractStill ( TrformStr *TrPtr , aPrefs *p ); -int HaveEqualSize ( Image *im1, Image *im2 ); -int merge ( Image *dst, Image *src, int feather, int showprogress, int seam ); -void mergeAlpha ( Image *im, unsigned char *alpha, int feather, PTRect *theRect ); -void SetEquColor ( cPrefs *p ); -void CopyPosition ( Image *to, Image *from ); -int isColorSpecific ( cPrefs *p ); -void ThreeToFourBPP ( Image *im ); -void FourToThreeBPP ( Image *im ); -int SetUpGamma ( double pgamma, unsigned int psize); -int cutTheFrame ( Image *dest, Image *src, int width, int height, int showprogress ); -int PositionCmp ( Image *im1, Image *im2 ); -int MorphImage ( Image *src, Image *dst, PTTriangle *ts, PTTriangle *td, int nt ); -int MorphImageFile ( fullPath *sfile, fullPath *dfile, AlignInfo *g,int nIm ); -int blendImages ( fullPath *f0, fullPath *f1, fullPath *result, double s ); -int InterpolateImage ( Image *src, Image *dst, PTTriangle *ts, PTTriangle *td, int nt ); -int InterpolateTrianglesPerspective( AlignInfo *g, int nIm, double s, PTTriangle** t ); -int InterpolateImageFile( fullPath *sfile, fullPath *dfile, AlignInfo *g,int nIm ); -void OneToTwoByte ( Image *im ); -void TwoToOneByte ( Image *im ); -void SetMakeParams ( struct fDesc *stack, struct MakeParams *mp, Image *im , Image *pn, int color ); -void SetInvMakeParams ( struct fDesc *stack, struct MakeParams *mp, Image *im , Image *pn, int color ); +PANO13_IMPEX void addAlpha ( Image *im ); +PANO13_IMPEX void transForm ( TrformStr *TrPtr, fDesc *fD, int color); +PANO13_IMPEX void transFormEx ( TrformStr *TrPtr, fDesc *fD, fDesc *finvD, int color, int imageNum); +PANO13_IMPEX void filter ( TrformStr *TrPtr, flfn func, flfn16 func16, void* params, int color); +PANO13_IMPEX void CopyImageData ( Image *dest, Image *src ); |
From: <pan...@li...> - 2013-03-17 07:08:26
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/4b93725a1f29 changeset: 781:4b93725a1f29 user: tmodes date: Sun Mar 17 08:08:09 2013 +0100 description: Moved test parameter 0 and 1 to Tpy and Tpr diffstat: PTcommon.c | 2 ++ adjust.c | 32 ++++++++++++++++++++++++++++---- correct.c | 4 +++- dump.c | 2 ++ filter.h | 4 +++- math.c | 12 ++++++------ panorama.h | 3 ++- parser.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 8 files changed, 98 insertions(+), 14 deletions(-) diffs (308 lines): diff -r 253c1bcde35e -r 4b93725a1f29 PTcommon.c --- a/PTcommon.c Sun Mar 17 08:06:20 2013 +0100 +++ b/PTcommon.c Sun Mar 17 08:08:09 2013 +0100 @@ -1956,6 +1956,8 @@ printf(">>>im->cP.trans_x %f\n", im->cP.trans_x); printf(">>>im->cP.trans_y %f\n", im->cP.trans_y); printf(">>>im->cP.trans_z %f\n", im->cP.trans_z); + printf(">>>im->cP.trans_yaw %n", im->cP.trans_yaw); + printf(">>>im->cP.trans_pitch %f\n", im->cP.trans_pitch); printf(">>>im->cP.test %d\n", im->cP.test); printf(">>>im->cP.test parm1 %f\n", im->cP.test_p0); diff -r 253c1bcde35e -r 4b93725a1f29 adjust.c --- a/adjust.c Sun Mar 17 08:06:20 2013 +0100 +++ b/adjust.c Sun Mar 17 08:08:09 2013 +0100 @@ -87,6 +87,8 @@ printf("trans[0] %f\n", mp->trans[0]); printf("trans[1] %f\n", mp->trans[1]); printf("trans[2] %f\n", mp->trans[2]); + printf("trans[3] %f\n", mp->trans[3]); + printf("trans[4] %f\n", mp->trans[4]); printf("test[0] %f\n", mp->test[0]); printf("test[1] %f\n", mp->test[1]); @@ -853,7 +855,8 @@ mp->trans[0] = im->cP.trans_x; mp->trans[1] = im->cP.trans_y; mp->trans[2] = im->cP.trans_z; - + mp->trans[3] = DEG_TO_RAD(im->cP.trans_yaw); + mp->trans[4] = DEG_TO_RAD(im->cP.trans_pitch); mp->test[0] = im->cP.test_p0; mp->test[1] = im->cP.test_p1; @@ -1309,6 +1312,8 @@ mp->trans[0] = im->cP.trans_x; mp->trans[1] = im->cP.trans_y; mp->trans[2] = im->cP.trans_z; + mp->trans[3] = DEG_TO_RAD(im->cP.trans_yaw); + mp->trans[4] = DEG_TO_RAD(im->cP.trans_pitch); mp->test[0] = im->cP.test_p0; mp->test[1] = im->cP.test_p1; @@ -2677,6 +2682,18 @@ if( k == 1 ){ optInfo->im[i].cP.trans_z = x[j++]; }else{ optInfo->im[i].cP.trans_z = optInfo->im[k-2].cP.trans_z;} } + if( (k = optInfo->opt[i].transYawOpt) > 0 ){ + if( k == 1 ) { optInfo->im[i].cP.trans_yaw = x[j++]; //NORM_ANGLE(optInfo->im[i].cP.trans_yaw); + while( optInfo->im[i].cP.trans_yaw > optInfo->im[i].yaw + 80) optInfo->im[i].cP.trans_yaw -= 180.0; + while( optInfo->im[i].cP.trans_yaw < optInfo->im[i].yaw - 80) optInfo->im[i].cP.trans_yaw += 180.0; + } else { optInfo->im[i].cP.trans_yaw = optInfo->im[k-2].cP.trans_yaw;} + } + if( (k = optInfo->opt[i].transPitchOpt) > 0 ){ + if( k == 1 ){ optInfo->im[i].cP.trans_pitch = x[j++]; //NORM_ANGLE(optInfo->im[i].cP.trans_pitch); + while( optInfo->im[i].cP.trans_pitch > optInfo->im[i].pitch + 80) optInfo->im[i].cP.trans_pitch -= 180.0; + while( optInfo->im[i].cP.trans_pitch < optInfo->im[i].pitch - 80) optInfo->im[i].cP.trans_pitch += 180.0; + }else{ optInfo->im[i].cP.trans_pitch = optInfo->im[k-2].cP.trans_pitch;} + } // test if( (k = optInfo->opt[i].testP0opt) > 0 ){ if( k == 1 ){ optInfo->im[i].cP.test_p0 = x[j++]; @@ -2775,12 +2792,19 @@ if(optInfo->opt[i].transXopt == 1) { // optimize trans_x? 0-no 1-yes x[j++] = optInfo->im[i].cP.trans_x ; } - if(optInfo->opt[i].transYopt == 1) // optimize trans_y? 0-no 1-yes + if(optInfo->opt[i].transYopt == 1) { // optimize trans_y? 0-no 1-yes x[j++] = optInfo->im[i].cP.trans_y ; - + } if(optInfo->opt[i].transZopt == 1) { // optimize trans_Z? 0-no 1-yes x[j++] = optInfo->im[i].cP.trans_z ; } + if(optInfo->opt[i].transYawOpt == 1) { // optimize trans_yaw? 0-no 1-yes + x[j++] = optInfo->im[i].cP.trans_yaw ; + } + if(optInfo->opt[i].transPitchOpt == 1) { // optimize trans_pitch? 0-no 1-yes + x[j++] = optInfo->im[i].cP.trans_pitch ; + } + // Test if(optInfo->opt[i].testP0opt == 1) { x[j++] = optInfo->im[i].cP.test_p0; ; @@ -2935,7 +2959,7 @@ opt->hfov = opt->yaw = opt->pitch = opt->roll = 0; opt->a = opt->b = opt->c = opt->d = opt->e = 0; opt->tiltXopt = opt->tiltYopt = opt->tiltZopt = opt->tiltScaleOpt = 0; - opt->transXopt = opt->transYopt = opt->transZopt = 0; + opt->transXopt = opt->transYopt = opt->transZopt = opt->transYawOpt = opt->transPitchOpt = 0; opt->testP0opt = opt->testP1opt = opt->testP2opt = opt->testP3opt = 0; opt->shear_x = opt->shear_y = 0; } diff -r 253c1bcde35e -r 4b93725a1f29 correct.c --- a/correct.c Sun Mar 17 08:06:20 2013 +0100 +++ b/correct.c Sun Mar 17 08:08:09 2013 +0100 @@ -915,7 +915,9 @@ prefs->trans_x = 0; prefs->trans_y = 0; prefs->trans_z = 0; - + prefs->trans_yaw = 0; + prefs->trans_pitch = 0; + prefs->test = FALSE; prefs->test_p0 = 0; prefs->test_p1 = 0; diff -r 253c1bcde35e -r 4b93725a1f29 dump.c --- a/dump.c Sun Mar 17 08:06:20 2013 +0100 +++ b/dump.c Sun Mar 17 08:08:09 2013 +0100 @@ -134,6 +134,8 @@ PRINT_F(trans_x); PRINT_F(trans_y); PRINT_F(trans_z); + PRINT_F(trans_yaw); + PRINT_F(trans_pitch); } if (cP->test) { diff -r 253c1bcde35e -r 4b93725a1f29 filter.h --- a/filter.h Sun Mar 17 08:06:20 2013 +0100 +++ b/filter.h Sun Mar 17 08:08:09 2013 +0100 @@ -187,6 +187,8 @@ int transXopt; int transYopt; int transZopt; + int transYawOpt; + int transPitchOpt; int testP0opt; int testP1opt; @@ -370,7 +372,7 @@ // Tilt double tilt[4]; // 0 around x, 1 around y, 2 around z, 3 scaling factor // Translation of camera plane - double trans[3]; + double trans[5]; // 0 x, 1 y, 2 z, 3 yaw, 4 pitch // For testing new projections double test[4]; diff -r 253c1bcde35e -r 4b93725a1f29 math.c --- a/math.c Sun Mar 17 08:06:20 2013 +0100 +++ b/math.c Sun Mar 17 08:08:09 2013 +0100 @@ -2133,7 +2133,7 @@ cart_erect(x_dest, y_dest, &p2[0], mp->distance); // compute plane description - cart_erect(DEG_TO_RAD(mp->test[0]), -DEG_TO_RAD(mp->test[1]), + cart_erect(mp->trans[3], -mp->trans[4], &plane_coeff[0], 1.0); // plane_coeff[0..2] is both the normal and a point @@ -2144,7 +2144,7 @@ /* printf("Plane: y:%f p:%f coefficients: %f %f %f %f, ray direction: %f %f %f\n", - mp->test[0], mp->test[1], plane_coeff[0], plane_coeff[1], plane_coeff[2], plane_coeff[3], + mp->trans[3], mp->trans[4], plane_coeff[0], plane_coeff[1], plane_coeff[2], plane_coeff[3], p2[0],p2[1],p2[2]); */ @@ -2165,7 +2165,7 @@ /* printf("pano->plane->cam(%.1f, %.1f, %.1f, y:%1f,p:%1f): %8.5f %8.5f -> %8.5f %8.5f %8.5f -> %8.5f %8.5f\n", - mp->trans[0], mp->trans[1], mp->trans[2], mp->test[0], mp->test[1], + mp->trans[0], mp->trans[1], mp->trans[2], mp->trans[3], mp->trans[4], x_dest, y_dest, intersection[0], intersection[1], intersection[2], *x_src, *y_src); @@ -2202,7 +2202,7 @@ // compute plane description - cart_erect(DEG_TO_RAD(mp->test[0]), -DEG_TO_RAD(mp->test[1]), + cart_erect(mp->trans[3], -mp->trans[4], &plane_coeff[0], 1.0); // plane_coeff[0..2] is both the normal and a point @@ -2213,7 +2213,7 @@ /* printf("Plane: y:%f p:%f coefficients: %f %f %f %f, ray direction: %f %f %f\n", - mp->test[0], mp->test[1], plane_coeff[0], plane_coeff[1], plane_coeff[2], plane_coeff[3], + mp->trans[3], mp->trans[4], plane_coeff[0], plane_coeff[1], plane_coeff[2], plane_coeff[3], p2[0],p2[1],p2[2]); */ @@ -2232,7 +2232,7 @@ /* printf("cam->plane->pano(%.1f, %.1f, %.1f, y:%1f,p:%1f): %8.5f %8.5f -> %8.5f %8.5f %8.5f -> %8.5f %8.5f\n", - mp->trans[0], mp->trans[1], mp->trans[2], mp->test[0], mp->test[1], + mp->trans[0], mp->trans[1], mp->trans[2], mp->trans[3], mp->trans[4], x_dest, y_dest, intersection[0], intersection[1], intersection[2], *x_src, *y_src); diff -r 253c1bcde35e -r 4b93725a1f29 panorama.h --- a/panorama.h Sun Mar 17 08:06:20 2013 +0100 +++ b/panorama.h Sun Mar 17 08:08:09 2013 +0100 @@ -190,7 +190,8 @@ double trans_x; // x component of translation vector double trans_y; // y component of translation vector double trans_z; // z component of translation vector - + double trans_yaw; // yaw of remapping plane for translation + double trans_pitch; // pitch of remapping plane for translation int test; // these parameters are for testing new projections double test_p0; // and make it easier for others to experiment diff -r 253c1bcde35e -r 4b93725a1f29 parser.c --- a/parser.c Sun Mar 17 08:06:20 2013 +0100 +++ b/parser.c Sun Mar 17 08:08:09 2013 +0100 @@ -415,6 +415,21 @@ im->cP.trans = TRUE; } break; + case 'p': // Translation remap plane + li++; + switch (*li) { + case 'y': + li = panoParseVariable(buf, li, lineNum, &(opt->transYawOpt), &(im->cP.trans_yaw)); + break; + case 'p': + li = panoParseVariable(buf, li, lineNum, &(opt->transPitchOpt), &(im->cP.trans_pitch)); + break; + default: + PrintError("Unknown translation parameter Tp%c in script: Line %d", *li, lineNum); + return -1; + } + if (li == NULL) return -1; + break; case 'e': // test parameters li++; switch (*li) { @@ -606,6 +621,20 @@ return -1; } break; + case 'p': + li++; + switch (*li) { + case 'y': + READ_OPT_VAR(transYawOpt); + break; + case 'p': + READ_OPT_VAR(transPitchOpt); + break; + default: + PrintError("Unknown variable name to optimize Tp%c in script: Line %d", *li, lineNum); + return -1; + } + break; case 'e': li++; switch (*li) { @@ -852,6 +881,12 @@ k = gl->opt[i].transZopt - 2; if( k >= 0 ) gl->im[i].cP.trans_z = gl->im[ k ].cP.trans_z; + k = gl->opt[i].transYawOpt - 2; + if( k >= 0 ) gl->im[i].cP.trans_yaw = gl->im[ k ].cP.trans_yaw; + + k = gl->opt[i].transPitchOpt - 2; + if( k >= 0 ) gl->im[i].cP.trans_pitch = gl->im[ k ].cP.trans_pitch; + // test variables ---------------------------------------------------------------------- k = gl->opt[i].testP0opt - 2; @@ -1013,6 +1048,8 @@ g->im[i].cP.trans_x, (g->opt[i].transXopt ? '*':'p'), g->im[i].cP.trans_y, (g->opt[i].transYopt ? '*':'p'), g->im[i].cP.trans_z, (g->opt[i].transZopt ? '*':'p'), + g->im[i].cP.trans_yaw, (g->opt[i].transYawOpt ? '*':'p'), + g->im[i].cP.trans_pitch, (g->opt[i].transPitchOpt ? '*':'p'), // test parameters g->im[i].cP.test_p0, (g->opt[i].testP0opt ? '*':'p'), g->im[i].cP.test_p1, (g->opt[i].testP1opt ? '*':'p'), @@ -1040,7 +1077,7 @@ line += sprintf( line, "TiX%f TiY%f TiZ%f TiS%f ", g->im[i].cP.tilt_x, g->im[i].cP.tilt_y, g->im[i].cP.tilt_z, g->im[i].cP.tilt_scale); } if( g->im[i].cP.trans ) { - line += sprintf( line, "TrX%f TrY%f TrZ%f ", g->im[i].cP.trans_x, g->im[i].cP.trans_y, g->im[i].cP.trans_z); + line += sprintf( line, "TrX%f TrY%f TrZ%f Tpy%f Tpp%f", g->im[i].cP.trans_x, g->im[i].cP.trans_y, g->im[i].cP.trans_z, g->im[i].cP.trans_yaw, g->im[i].cP.trans_pitch); } if( g->im[i].cP.test ) { line += sprintf( line, "Te0%f Te1%f Te2%f Te3%f ", g->im[i].cP.test_p0, g->im[i].cP.test_p1, g->im[i].cP.test_p2, g->im[i].cP.test_p3 ); @@ -1775,6 +1812,20 @@ im.cP.trans = TRUE; } break; + case 'p': + ch++; + switch (*ch) { + case 'y': + READ_VAR("%lf",&(im.cP.trans_yaw)); + break; + case 'p': + READ_VAR("%lf",&(im.cP.trans_pitch)); + break; + default: + PrintError("Unknown variable name Tp%c in script", *ch); + return -1; + } + break; case 'e': ch++; switch (*ch) { |
From: <pan...@li...> - 2013-03-17 07:08:25
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/c2a40aad1b51 changeset: 779:c2a40aad1b51 user: tmodes date: Sun Mar 17 08:06:02 2013 +0100 description: Update bootstrap for automake 1.12 (Patch by Terry Duell) [11561269] diffstat: bootstrap | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r b1e1204fe014 -r c2a40aad1b51 bootstrap --- a/bootstrap Sat Mar 16 08:38:29 2013 +0100 +++ b/bootstrap Sun Mar 17 08:06:02 2013 +0100 @@ -60,7 +60,7 @@ automake_version=`$AUTOMAKE --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'` # echo automake version: $automake_version case $automake_version in - 1.7*|1.8*|1.9*|1.10*|1.11*) + 1.7*|1.8*|1.9*|1.10*|1.11*|1.12*) have_automake=true ;; esac |
From: <pan...@li...> - 2013-03-17 07:08:25
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/253c1bcde35e changeset: 780:253c1bcde35e user: tmodes date: Sun Mar 17 08:06:20 2013 +0100 description: Bump version number diffstat: configure.ac | 2 +- version.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diffs (32 lines): diff -r c2a40aad1b51 -r 253c1bcde35e configure.ac --- a/configure.ac Sun Mar 17 08:06:02 2013 +0100 +++ b/configure.ac Sun Mar 17 08:06:20 2013 +0100 @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.5) -AC_INIT([pano13], [2.9.18], BUG-REPORT-ADDRESS) +AC_INIT([pano13], [2.9.19], BUG-REPORT-ADDRESS) AC_CONFIG_SRCDIR([PTDialogs.c]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config.h]) diff -r c2a40aad1b51 -r 253c1bcde35e version.h --- a/version.h Sun Mar 17 08:06:02 2013 +0100 +++ b/version.h Sun Mar 17 08:06:20 2013 +0100 @@ -29,13 +29,13 @@ #define VERS2 0x00 //version of preferences file, used to verify data -#define PREF_VERSION "2.9.18 " +#define PREF_VERSION "2.9.19 " // String style of global version -#define VERSION "2.9.18 " +#define VERSION "2.9.19 " // Numeric style of global version, same as VERSION with more precision -#define PTVERSION_FILEVERSIONNUMBER 2,9,18,0 +#define PTVERSION_FILEVERSIONNUMBER 2,9,19,0 #define PTVERSION_NAME_LONG "LongVersion" #define LONGVERSION VERSION ", Copyright (c) 1998-2006, H. Dersch, de...@fh..." |
From: <pan...@li...> - 2013-03-16 07:37:50
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/531cd379005d changeset: 776:531cd379005d user: tmodes date: Sat Mar 16 07:45:12 2013 +0100 description: Added Hammer projection diffstat: adjust.c | 20 +++++++++++++++++++- filter.h | 2 ++ math.c | 43 ++++++++++++++++++++++++++++++++++++++++++- panorama.h | 4 +++- parser.c | 7 +++++++ queryfeature.c | 6 ++++++ 6 files changed, 79 insertions(+), 3 deletions(-) diffs (214 lines): diff -r 6e390e07eac5 -r 531cd379005d adjust.c --- a/adjust.c Sun Mar 03 08:32:00 2013 +0100 +++ b/adjust.c Sat Mar 16 07:45:12 2013 +0100 @@ -752,6 +752,11 @@ lambertazimuthal_erect(b/2.0, 0.0, &tx, &ty, & tpara); mp->distance = pn->width/(2.0*tx); break; + case _hammer: + tpara = 1; + hammer_erect(b/2.0, 0.0, &tx, &ty, & tpara); + mp->distance = pn->width/(2.0*tx); + break; case _stereographic: tpara = 1; stereographic_erect(b/2.0, 0.0, &tx, &ty, & tpara); @@ -959,6 +964,10 @@ { SetDesc(stack[i], erect_lambertazimuthal, &(mp->distance) ); i++; // Convert lambert to equirect } + else if(pn->format == _hammer) + { + SetDesc(stack[i], erect_hammer, &(mp->distance) ); i++; // Convert hammer to equirect + } else if(pn->format == _trans_mercator) { SetDesc(stack[i], erect_transmercator, &(mp->distance) ); i++; // Convert transverse mercator to equirect @@ -1184,6 +1193,11 @@ lambertazimuthal_erect(b/2.0, 0.0, &tx, &ty, & tpara); mp->distance = pn->width/(2.0*tx); break; + case _hammer: + tpara = 1; + hammer_erect(b/2.0, 0.0, &tx, &ty, & tpara); + mp->distance = pn->width/(2.0*tx); + break; case _panini: tpara = 1; panini_erect(b/2.0, 0.0, &tx, &ty, & tpara); @@ -1458,6 +1472,10 @@ { SetDesc(stack[i], lambertazimuthal_erect, &(mp->distance) ); i++; // Convert equirectangular to lambert azimuthal } + else if(pn->format == _hammer) + { + SetDesc(stack[i], hammer_erect, &(mp->distance) ); i++; // Convert equirectangular to hammer + } else if(pn->format == _trans_mercator) { SetDesc(stack[i], transmercator_erect, &(mp->distance) ); i++; // Convert equirectangular to transverse mercator @@ -3035,7 +3053,7 @@ g->pano.format != _equisolid && g->pano.format != _equipanini && g->pano.format != _biplane && g->pano.format != _triplane && g->pano.format != _panini_general && g->pano.format != _thoby && - g->pano.format != _orthographic + g->pano.format != _orthographic && g->pano.format != _hammer ) err=11; // Check Control Points diff -r 6e390e07eac5 -r 531cd379005d filter.h --- a/filter.h Sun Mar 03 08:32:00 2013 +0100 +++ b/filter.h Sat Mar 16 07:45:12 2013 +0100 @@ -863,6 +863,8 @@ int erect_lambert ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); int erect_lambertazimuthal( double x_dest,double y_dest, double* x_src, double* y_src, void* params); int lambertazimuthal_erect( double x_dest,double y_dest, double* x_src, double* y_src, void* params); +int erect_hammer( double x_dest,double y_dest, double* x_src, double* y_src, void* params); +int hammer_erect( double x_dest,double y_dest, double* x_src, double* y_src, void* params); int transmercator_erect ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); int erect_transmercator ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); int sinusoidal_erect ( double x_dest,double y_dest, double* x_src, double* y_src, void* params ); diff -r 6e390e07eac5 -r 531cd379005d math.c --- a/math.c Sun Mar 03 08:32:00 2013 +0100 +++ b/math.c Sat Mar 16 07:45:12 2013 +0100 @@ -874,7 +874,48 @@ return 1; } - +/** convert from erect to hammer */ +int hammer_erect( double x_dest,double y_dest, double* x_src, double* y_src, void* params) +{ + if(lambertazimuthal_erect(x_dest/2.0, y_dest, x_src, y_src, params)) + { + *x_src *= 2.0; + return 1; + } + else + { + *x_src=0; + *y_src=0; + return 0; + }; +} + +/** convert from hammer to erect */ +int erect_hammer( double x_dest,double y_dest, double* x_src, double* y_src, void* params) +{ + double x, y, z; + x = x_dest/distanceparam; + y = y_dest/distanceparam; + z = 1.0 - (x * x / 16.0) - (y * y / 4.0); + if(z<0) + { + *x_src=0; + *y_src=0; + return 0; + }; + z = sqrt(z); + *x_src = 2.0 * atan2(z*x, 2.0*(2.0*z*z-1.0)); + *y_src = asin(y*z); + if(fabs(*x_src) > PI || fabs(*y_src) > HALF_PI) + { + *x_src=0; + *y_src=0; + return 0; + }; + *x_src *= distanceparam; + *y_src *= distanceparam; + return 1; +} /** convert from erect to mercator FORWARD */ int mercator_erect( double x_dest,double y_dest, double* x_src, double* y_src, void* params) diff -r 6e390e07eac5 -r 531cd379005d panorama.h --- a/panorama.h Sun Mar 03 08:32:00 2013 +0100 +++ b/panorama.h Sat Mar 16 07:45:12 2013 +0100 @@ -270,6 +270,7 @@ _panini_general = 25, _thoby = 26, // generalizes the model found in modern fisheye lenses. It is // parametrizable but it defaults to the Nikkor 10.5 fisheye lens + _hammer = 27, }; enum @@ -295,9 +296,10 @@ PANO_FORMAT_TRIPLANE = 18, PANO_FORMAT_PANINI_GENERAL = 19, PANO_FORMAT_THOBY = 20, + PANO_FORMAT_HAMMER = 21, }; -#define PANO_FORMAT_COUNT 21 +#define PANO_FORMAT_COUNT 22 enum { // Enumerates external number of image f<index> diff -r 6e390e07eac5 -r 531cd379005d parser.c --- a/parser.c Sun Mar 03 08:32:00 2013 +0100 +++ b/parser.c Sat Mar 16 07:45:12 2013 +0100 @@ -690,6 +690,9 @@ case PANO_FORMAT_LAMBERT_AZIMUTHAL: gl->pano.format = _lambertazimuthal; break; + case PANO_FORMAT_HAMMER: + gl->pano.format = _hammer; + break; case PANO_FORMAT_ALBERS_EQUAL_AREA_CONIC: gl->pano.format = _albersequalareaconic; break; @@ -920,6 +923,7 @@ case _sinusoidal: format = PANO_FORMAT_SINUSOIDAL; break; case _lambert: format = PANO_FORMAT_LAMBERT_EQUAL_AREA_CONIC; break; case _lambertazimuthal: format = PANO_FORMAT_LAMBERT_AZIMUTHAL; break; + case _hammer: format = PANO_FORMAT_HAMMER; break; case _albersequalareaconic: format = PANO_FORMAT_ALBERS_EQUAL_AREA_CONIC; break; case _millercylindrical: format = PANO_FORMAT_MILLER_CYLINDRICAL; break; case _panini: format = PANO_FORMAT_PANINI; break; @@ -1285,6 +1289,9 @@ case PANO_FORMAT_LAMBERT_AZIMUTHAL: p->pano.format = _lambertazimuthal; break; + case PANO_FORMAT_HAMMER: + p->pano.format = _hammer; + break; case PANO_FORMAT_ALBERS_EQUAL_AREA_CONIC: p->pano.format = _albersequalareaconic; break; diff -r 6e390e07eac5 -r 531cd379005d queryfeature.c --- a/queryfeature.c Sun Mar 03 08:32:00 2013 +0100 +++ b/queryfeature.c Sat Mar 16 07:45:12 2013 +0100 @@ -96,6 +96,9 @@ {"PanoType16","Equirectangular Panini"}, {"PanoType17","Biplane"}, {"PanoType18","Triplane"}, + {"PanoType19","Panini General"}, + {"PanoType20", "Thoby Projection"}, + {"PanoType21", "Hammer-Aitoff Equal Area"}, // Filter Types @@ -344,6 +347,7 @@ "Triplane", "Panini General", "Thoby Projection", + "Hammer-Aitoff Equal Area", }; static int panoFormatID[] = { @@ -368,6 +372,7 @@ _triplane, _panini_general, _thoby, + _hammer, }; @@ -465,6 +470,7 @@ case PANO_FORMAT_SINUSOIDAL: case PANO_FORMAT_LAMBERT_EQUAL_AREA_CONIC: case PANO_FORMAT_LAMBERT_AZIMUTHAL: + case PANO_FORMAT_HAMMER: break; case PANO_FORMAT_ALBERS_EQUAL_AREA_CONIC: features->numberOfParameters = 2; |
From: <pan...@li...> - 2013-03-16 07:37:50
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/b1e1204fe014 changeset: 778:b1e1204fe014 user: tmodes date: Sat Mar 16 08:38:29 2013 +0100 description: Fixes for architectural projection * correctly report success of transformation * check if values are in valid ranges diffstat: math.c | 54 ++++++++++++++++++++++++++++++------------------------ 1 files changed, 30 insertions(+), 24 deletions(-) diffs (102 lines): diff -r 8bf958d04557 -r b1e1204fe014 math.c --- a/math.c Sat Mar 16 08:19:47 2013 +0100 +++ b/math.c Sat Mar 16 08:38:29 2013 +0100 @@ -940,12 +940,17 @@ int millercylindrical_erect( double x_dest,double y_dest, double* x_src, double* y_src, void* params) { // params: distanceparam - double phi; + double phi, tanPhi; *x_src = x_dest; phi = y_dest/distanceparam; - - *y_src = distanceparam*log(tan(PI/4 +0.4 * phi))/0.8; + tanPhi = tan(PI/4 +0.4 * phi); + if (tanPhi < 0) { + *x_src = 0; + *y_src = 0; + return 0; + }; + *y_src = distanceparam*log(tanPhi)/0.8; return 1; } @@ -953,46 +958,40 @@ int arch_erect( double x_dest,double y_dest, double* x_src, double* y_src, void* params) { // params: distanceparam - double phi; - - phi = y_dest/distanceparam; - if (phi < 0) { - millercylindrical_erect(x_dest, y_dest, x_src, y_src, params); + if (y_dest < 0) { + return millercylindrical_erect(x_dest, y_dest, x_src, y_src, params); } else { - lambert_erect(x_dest, y_dest, x_src, y_src, params); + return lambert_erect(x_dest, y_dest, x_src, y_src, params); } - - return 1; } /** convert from erect to miller */ int erect_arch( double x_dest,double y_dest, double* x_src, double* y_src, void* params) { // params: distanceparam - double y; - - y = y_dest/distanceparam; - if (y < 0) { - erect_millercylindrical(x_dest, y_dest, x_src, y_src, params); + if (y_dest < 0) { + return erect_millercylindrical(x_dest, y_dest, x_src, y_src, params); } else { - erect_lambert(x_dest, y_dest, x_src, y_src, params); + return erect_lambert(x_dest, y_dest, x_src, y_src, params); } - - return 1; } -/** convert from mercator to erect */ +/** convert from miller cylindrical to erect */ int erect_millercylindrical( double x_dest,double y_dest, double* x_src, double* y_src, void* params) { double y; *x_src = x_dest; y = y_dest/distanceparam; - - *y_src = 1.25 * atan(sinh(4 * y /5.0)); - *y_src *= distanceparam; + y = 1.25 * atan(sinh(4 * y /5.0)); + if ( fabs(y) > HALF_PI) { + *x_src = 0; + *y_src = 0; + return 0; + }; + *y_src = distanceparam * y; return 1; } @@ -1336,8 +1335,15 @@ int erect_lambert( double x_dest,double y_dest, double* x_src, double* y_src, void* params) { // params: distanceparam + double y; *x_src = x_dest; - *y_src = distanceparam*asin(y_dest/distanceparam); + y = y_dest / distanceparam; + if (fabs(y) > 1) { + *x_src = 0; + *y_src = 0; + return 0; + }; + *y_src = distanceparam*asin(y); return 1; } |
From: <pan...@li...> - 2013-03-16 07:37:50
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/8bf958d04557 changeset: 777:8bf958d04557 user: tmodes date: Sat Mar 16 08:19:47 2013 +0100 description: Removed unused variables diffstat: math.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diffs (20 lines): diff -r 531cd379005d -r 8bf958d04557 math.c --- a/math.c Sat Mar 16 07:45:12 2013 +0100 +++ b/math.c Sat Mar 16 08:19:47 2013 +0100 @@ -395,7 +395,7 @@ double m_tilt[3][3]; // tilt matrix double m_rotate[3][3]; // tilt matrix double xmax = mp->im->width/2; // maximum y value is image width divided by 2 - double z0, z1; + double z0; double FOV = DEG_TO_RAD(mp->im->hfov/scale); double m_slant[3][3]; // slant matrix @@ -2173,7 +2173,6 @@ int plane_transfer_from_camera( double x_dest, double y_dest, double * x_src, double * y_src, void * params) { - double phi, theta; double plane_coeff[4]; double p1[3]; double p2[3]; |
From: <pan...@li...> - 2013-03-03 07:31:22
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/6e390e07eac5 changeset: 775:6e390e07eac5 user: tmodes date: Sun Mar 03 08:32:00 2013 +0100 description: Prevent division by zero [791473] diffstat: math.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 1b78f71b2c32 -r 6e390e07eac5 math.c --- a/math.c Sun Mar 03 08:31:17 2013 +0100 +++ b/math.c Sun Mar 03 08:32:00 2013 +0100 @@ -329,7 +329,7 @@ ((double*)params)[1]) * rs + ((double*)params)[0]) * rs; } - scale = rs / rd; + scale = (rd!=0.0) ? rs / rd : 1.0f; // printf("scale = %lg iter = %d\n", scale,iter); *x_src = x_dest * scale ; |
From: <pan...@li...> - 2013-03-03 07:31:22
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/1b78f71b2c32 changeset: 774:1b78f71b2c32 user: tmodes date: Sun Mar 03 08:31:17 2013 +0100 description: Fixes a typo in version string diffstat: CMakeLists.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r c251644f9866 -r 1b78f71b2c32 CMakeLists.txt --- a/CMakeLists.txt Sun Mar 03 08:30:58 2013 +0100 +++ b/CMakeLists.txt Sun Mar 03 08:31:17 2013 +0100 @@ -397,7 +397,7 @@ STRING(REGEX REPLACE "\n" ";" LIBPANO_TIP_LINES ${LIBPANO_TIP_OUT}) foreach(_v_l ${LIBPANO_TIP_LINES}) if(_v_l MATCHES ".*:[ ]+\([0-9]+\):[0-9a-f]+ tip$") - set(CPACK_PACKAGE_VERSION_PATCH "${LIBPANO_PATCH_VERSION}-${CMAKE_MATCH_1}hg") + set(CPACK_PACKAGE_VERSION_PATCH "${PANO_PATCH_VERSION}-${CMAKE_MATCH_1}hg") break() endif() endforeach() |
From: <pan...@li...> - 2013-03-03 07:31:21
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/c251644f9866 changeset: 773:c251644f9866 user: tmodes date: Sun Mar 03 08:30:58 2013 +0100 description: Fixes compilation with MinGW compiler diffstat: CMakeLists.txt | 8 ++++++++ ColourBrightness.c | 5 +++-- sys_compat_win.c | 12 +++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diffs (78 lines): diff -r 489ef38b776c -r c251644f9866 CMakeLists.txt --- a/CMakeLists.txt Sat Mar 02 13:18:41 2013 +0100 +++ b/CMakeLists.txt Sun Mar 03 08:30:58 2013 +0100 @@ -161,6 +161,11 @@ ) ENDIF(NOT BUILD_DLL) ENDIF(MSVC) + IF(MINGW) + IF(NOT BUILD_WINGUI) + ADD_DEFINITIONS(/D__Ansi__) + ENDIF() + ENDIF(MINGW) ENDIF(UNIX) ## @@ -266,6 +271,9 @@ add_library(pano13 SHARED ${pano13_hdr} ${pano13_res} ${pano13_src}) target_link_libraries(pano13 ${_common_libs}) set_target_properties(pano13 PROPERTIES VERSION "2.0.0" SOVERSION "2") + IF(MINGW) + set_target_properties(pano13 PROPERTIES PREFIX "") + ENDIF() install(TARGETS pano13 RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) ELSE(BUILD_DLL) #create and install static library diff -r 489ef38b776c -r c251644f9866 ColourBrightness.c --- a/ColourBrightness.c Sat Mar 02 13:18:41 2013 +0100 +++ b/ColourBrightness.c Sun Mar 03 08:30:58 2013 +0100 @@ -38,12 +38,13 @@ #include "pttiff.h" - +#ifdef WIN32 #ifdef _MSC_VER // MSVC doesn't support round() //#define round(x) ( (int) (x+0.5) ) #define round(x) (int)(x) +#endif // _MSC_VER // MSVC wants htons() to be a library function // here we define it as a macro instead @@ -68,7 +69,7 @@ #error "Either BIG_ENDIAN or LITTLE_ENDIAN must be #defined, but not both." #endif -#endif //def _MSC_VER +#endif //def WIN32 diff -r 489ef38b776c -r c251644f9866 sys_compat_win.c --- a/sys_compat_win.c Sat Mar 02 13:18:41 2013 +0100 +++ b/sys_compat_win.c Sun Mar 03 08:30:58 2013 +0100 @@ -52,7 +52,7 @@ return name; } - +#ifdef _MSC_VER int panoTimeToStrWithTimeZone(char *sTime, int len, struct tm *time) { char sZone[20]; @@ -70,3 +70,13 @@ } else return 0; } +#else +#ifdef __MINGW32__ +int panoTimeToStrWithTimeZone(char *sTime, int len, struct tm *time) +{ + assert(len >= 11); + return strftime(sTime, len, "%H%M%S%z", time); + +} +#endif +#endif |
From: <pan...@li...> - 2013-03-02 12:18:14
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/489ef38b776c changeset: 772:489ef38b776c user: tmodes date: Sat Mar 02 13:18:41 2013 +0100 description: Use mercurial instead of subversion in CMake build diffstat: CMakeLists.txt | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diffs (37 lines): diff -r e4a5489e244d -r 489ef38b776c CMakeLists.txt --- a/CMakeLists.txt Sat Mar 02 13:14:32 2013 +0100 +++ b/CMakeLists.txt Sat Mar 02 13:18:41 2013 +0100 @@ -378,17 +378,25 @@ # This way we may omit the otherwise needed "--force" parameter when # installing from that rpm package. # ... Disabled for the moment, because configure.ac supplies a value -find_program(_svnversion svnversion) -message(STATUS "svnversion = ${_svnversion}") -if(NOT ${_svnversion} MATCHES "-NOTFOUND") - execute_process(COMMAND ${_svnversion} WORKING_DIRECTORY "${TOP_SRC_DIR}" OUTPUT_VARIABLE CPACK_RPM_PACKAGE_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE) - # We use this value also to set the package-patch-value - if(CPACK_RPM_PACKAGE_RELEASE MATCHES "^\([0-9]+\)") - #set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_MATCH_1}) +IF(EXISTS ${PROJECT_SOURCE_DIR}/.hg) + FIND_PROGRAM(_hg hg) + if(_hg) + execute_process(COMMAND ${_hg} summary + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE LIBPANO_TIP_OUT + ERROR_VARIABLE LIBPANO_TIP_ERROR + OUTPUT_STRIP_TRAILING_WHITESPACE) + STRING(REGEX REPLACE "\n" ";" LIBPANO_TIP_LINES ${LIBPANO_TIP_OUT}) + foreach(_v_l ${LIBPANO_TIP_LINES}) + if(_v_l MATCHES ".*:[ ]+\([0-9]+\):[0-9a-f]+ tip$") + set(CPACK_PACKAGE_VERSION_PATCH "${LIBPANO_PATCH_VERSION}-${CMAKE_MATCH_1}hg") + break() + endif() + endforeach() endif() endif() -set(CPACK_SOURCE_PACKAGE_FILE_NAME "libpano13-${PACKAGE_VERSION}") +set(CPACK_SOURCE_PACKAGE_FILE_NAME "libpano13-${PANO_MAJOR_VERSION}.${PANO_MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}") # Use dpkg-shlibdeps to get the needed dependences SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) |
From: <pan...@li...> - 2013-03-02 12:18:13
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/e4a5489e244d changeset: 771:e4a5489e244d user: tmodes date: Sat Mar 02 13:14:32 2013 +0100 description: Fixes some typos diffstat: filter.h | 2 +- panorama.h | 2 +- parser.c | 25 ++++++++++++------------- 3 files changed, 14 insertions(+), 15 deletions(-) diffs (75 lines): diff -r 1299ba47658f -r e4a5489e244d filter.h --- a/filter.h Thu Jan 31 18:14:13 2013 +0100 +++ b/filter.h Sat Mar 02 13:14:32 2013 +0100 @@ -369,7 +369,7 @@ // Tilt double tilt[4]; // 0 around x, 1 around y, 2 around z, 3 scaling factor - // Translation of cmaera plane + // Translation of camera plane double trans[3]; // For testing new projections double test[4]; diff -r 1299ba47658f -r e4a5489e244d panorama.h --- a/panorama.h Thu Jan 31 18:14:13 2013 +0100 +++ b/panorama.h Sat Mar 02 13:14:32 2013 +0100 @@ -186,7 +186,7 @@ double tilt_z; // tilt on z values double tilt_scale; // scale for tilting - int trans; // traslation of camera plane requested? + int trans; // translation of camera plane requested? double trans_x; // x component of translation vector double trans_y; // y component of translation vector double trans_z; // z component of translation vector diff -r 1299ba47658f -r e4a5489e244d parser.c --- a/parser.c Thu Jan 31 18:14:13 2013 +0100 +++ b/parser.c Sat Mar 02 13:14:32 2013 +0100 @@ -409,12 +409,11 @@ if (li == NULL) return -1; // Make sure that we only apply trans when these parameters are not zero // Otherwise images are not rendered beyond 180 degrees FOV - if (im->cP.trans_x != 0.0 || - im->cP.trans_y != 0.0 || - im->cP.trans_z != 0.0) - { - im->cP.trans = TRUE; - } + if (im->cP.trans_x != 0.0 || + im->cP.trans_y != 0.0 || + im->cP.trans_z != 0.0) { + im->cP.trans = TRUE; + } break; case 'e': // test parameters li++; @@ -603,7 +602,7 @@ READ_OPT_VAR(transZopt); break; default: - PrintError("Unknown variable name to optimize Ti%c in script: Line %d", *li, lineNum); + PrintError("Unknown variable name to optimize Tr%c in script: Line %d", *li, lineNum); return -1; } break; @@ -1760,14 +1759,14 @@ READ_VAR("%lf",&(im.cP.trans_z)); break; default: - PrintError("Unknown variable name Ti%c in script", *ch); + PrintError("Unknown variable name Tr%c in script", *ch); return -1; } - if (im.cP.trans_x != 0.0 || - im.cP.trans_y != 0.0 || - im.cP.trans_z != 0.0) { - im.cP.trans = TRUE; - } + if (im.cP.trans_x != 0.0 || + im.cP.trans_y != 0.0 || + im.cP.trans_z != 0.0) { + im.cP.trans = TRUE; + } break; case 'e': ch++; |
From: <pan...@li...> - 2013-02-21 21:22:56
|
branch: mosaicMode details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/a399f79ca50f changeset: 770:a399f79ca50f user: Dev Ghosh <dg...@no...> date: Thu Feb 21 15:18:06 2013 -0600 description: Intuitive mosaic parameters based on tilt/spin Use by optimizing TrX, TrY, TrZ, Te0, Te1, Te2 instead of roll, pitch, yaw, TrX, TrY, TrZ diffstat: adjust.c | 25 ++- adjust.h | 1 + correct.c | 2 +- math.c | 559 +++++++++++++++++++++++++++++++++++++++++++++++++------------ parser.c | 28 ++- 5 files changed, 488 insertions(+), 127 deletions(-) diffs (truncated from 717 to 500 lines): diff -r 0c73d8794377 -r a399f79ca50f adjust.c --- a/adjust.c Fri Mar 02 23:19:11 2012 +0000 +++ b/adjust.c Thu Feb 21 15:18:06 2013 -0600 @@ -2653,21 +2653,40 @@ } // test if( (k = optInfo->opt[i].testP0opt) > 0 ){ - if( k == 1 ){ optInfo->im[i].cP.test_p0 = x[j++]; + if( k == 1 ){ + optInfo->im[i].cP.test_p0 = x[j++]; + NORM_ANGLE( optInfo->im[i].cP.test_p0 ); }else{ optInfo->im[i].cP.test_p0 = optInfo->im[k-2].cP.test_p0;} } if( (k = optInfo->opt[i].testP1opt) > 0 ){ - if( k == 1 ){ optInfo->im[i].cP.test_p1 = x[j++]; + if( k == 1 ){ + optInfo->im[i].cP.test_p1 = x[j++]; + NORM_ANGLE( optInfo->im[i].cP.test_p1 ); }else{ optInfo->im[i].cP.test_p1 = optInfo->im[k-2].cP.test_p1;} } if( (k = optInfo->opt[i].testP2opt) > 0 ){ - if( k == 1 ){ optInfo->im[i].cP.test_p2 = x[j++]; + if( k == 1 ){ optInfo->im[i].cP.test_p2 = x[j++]; NORM_ANGLE( optInfo->im[i].cP.test_p2 ); }else{ optInfo->im[i].cP.test_p2 = optInfo->im[k-2].cP.test_p2;} } if( (k = optInfo->opt[i].testP3opt) > 0 ){ if( k == 1 ){ optInfo->im[i].cP.test_p3 = x[j++]; }else{ optInfo->im[i].cP.test_p3 = optInfo->im[k-2].cP.test_p3;} } + // Dev: if optimizing both tilt and spin: + // force tilt to be between -90 and 90. also force spin to be between -90 and 90 + if (( (k = optInfo->opt[i].testP0opt) > 0 ) & ( (k = optInfo->opt[i].testP1opt) > 0 )){ + if ((optInfo->im[i].cP.test_p0 > 90.0) & (optInfo->im[i].cP.test_p1 < 90.0) & (optInfo->im[i].cP.test_p1 > -90)) + { + optInfo->im[i].cP.test_p0 = optInfo->im[i].cP.test_p0 - 180.0; + optInfo->im[i].cP.test_p1 = -optInfo->im[i].cP.test_p1; + } + if ((optInfo->im[i].cP.test_p0 < -90.0) & (optInfo->im[i].cP.test_p1 < 90.0) & (optInfo->im[i].cP.test_p1 > -90)) + { + optInfo->im[i].cP.test_p0 = optInfo->im[i].cP.test_p0 + 180.0; + optInfo->im[i].cP.test_p1 = -optInfo->im[i].cP.test_p1; + } + } + //shear if( (k = optInfo->opt[i].shear_x) > 0 ){ diff -r 0c73d8794377 -r a399f79ca50f adjust.h --- a/adjust.h Fri Mar 02 23:19:11 2012 +0000 +++ b/adjust.h Thu Feb 21 15:18:06 2013 -0600 @@ -27,3 +27,4 @@ void setFcnPanoHuberSigma(double sigma); int EvaluateControlPointErrorAndComponents (int num, double *errptr, double errComponent[2]); +int sphere2plane( double x_dest, double y_dest, double * xyz_plane, double distance); diff -r 0c73d8794377 -r a399f79ca50f correct.c --- a/correct.c Fri Mar 02 23:19:11 2012 +0000 +++ b/correct.c Thu Feb 21 15:18:06 2013 -0600 @@ -914,7 +914,7 @@ prefs->trans = FALSE; prefs->trans_x = 0; prefs->trans_y = 0; - prefs->trans_z = 0; + prefs->trans_z = 0; // Dev: should be 1?? prefs->test = FALSE; prefs->test_p0 = 0; diff -r 0c73d8794377 -r a399f79ca50f math.c --- a/math.c Fri Mar 02 23:19:11 2012 +0000 +++ b/math.c Thu Feb 21 15:18:06 2013 -0600 @@ -2065,65 +2065,237 @@ return 1; } - +// transfer point from panosphere of radius distance to plane at z0 = distance from origin +int sphere2plane( double x_dest, double y_dest, double * xyz_plane, double distance) +{ + + + + // phi is azimuth (negative angle around y axis, starting at the z axis) + double phi = x_dest / distance; + double theta_zenith = M_PI/2.0 - (y_dest / distance); + // compute cartesian coordinates.. + //pos[2] = cos(-phi)*sin(theta_zenith); //pablo + //pos[0] = sin(-phi)*sin(theta_zenith); //pablo + //pos[1] = cos(theta_zenith); //pablo + // if pablo is correct that phi must be measured as a negative angle, + // sign may be wrong below! + + double z0 = distance; + + // xplane = z0 * x1/z1 = z0 * (sin(theta)sin(phi)) / (sin(theta)cos(phi)) = z0*tan(phi) + // yplane = z0 * y1/z1 = z0 * cos(theta) / (sin(theta)cos(phi)) + // zplane = z0 + //xyz_plane[0] = z0 * tan(phi); + xyz_plane[0] = (z0 * sin(theta_zenith) * sin(phi)) / (sin(theta_zenith) * cos(phi)); + xyz_plane[1] = (z0 * cos(theta_zenith)) / (sin(theta_zenith) * cos(phi)); + xyz_plane[2] = z0; + //printf("In sphere2plane: (%f,%f,%f)\n",xyz_plane[0],xyz_plane[1],xyz_plane[2]); + + + + return 1; +} + +// transfer point from plane at z0 = distance to panosphere of radius "distance" +int plane2sphere(double * xyz, double *x_sphere, double *y_sphere, double distance) +{ + + *x_sphere = atan2(xyz[0],xyz[2]) * distance; + *y_sphere = distance * (M_PI/2.0 - atan2(1.0,(xyz[1]/xyz[2])*cos(*x_sphere/distance))); + + + + return 1; +} + + +int unspinfunc(double theta, double * v) +{ + // unspinfunc is passed a spin angle, theta and vector, v and returns an "un-spun" + // vector, v + double unspin[3][3]; + + unspin[0][0] = cos(theta); unspin[0][1] = -sin(theta); unspin[0][2] = 0; + unspin[1][0] = sin(theta); unspin[1][1] = cos(theta); unspin[1][2] = 0; + unspin[2][0] = 0; unspin[2][1] = 0; unspin[2][2] = 1; + + matrix_mult(unspin,v); + + return 1; + +} + +int spinfunc(double theta, double * v) +{ + // unspinfunc is passed a spin angle, theta and vector, v and returns an "un-spun" + // vector, v + double spin[3][3]; + + spin[0][0] = cos(-theta); spin[0][1] = -sin(-theta); spin[0][2] = 0; + spin[1][0] = sin(-theta); spin[1][1] = cos(-theta); spin[1][2] = 0; + spin[2][0] = 0; spin[2][1] = 0; spin[2][2] = 1; + + matrix_mult(spin,v); + + return 1; +} + + +// Pablo's forward transformation from PANO to IMAGE /** transfer a point from the master camera through a plane into camera * at TrX, TrY, TrZ using the plane located at Te0 (yaw), Te1 (pitch) */ int plane_transfer_to_camera( double x_dest, double y_dest, double * x_src, double * y_src, void * params) { - // params: distance, x1,y1,z1 - - double plane_coeff[4]; - double p1[3]; - double p2[3]; - double intersection[3]; - - // compute ray of sight for the current pixel in - // the master panorama camera. - // camera point - p1[0] = p1[1] = p1[2] = 0; - // point on sphere. - cart_erect(x_dest, y_dest, &p2[0], mp->distance); - - // compute plane description - cart_erect(DEG_TO_RAD(mp->test[0]), -DEG_TO_RAD(mp->test[1]), - &plane_coeff[0], 1.0); - - // plane_coeff[0..2] is both the normal and a point - // on the plane. - plane_coeff[3] = - plane_coeff[0]*plane_coeff[0] - - plane_coeff[1]*plane_coeff[1] - - plane_coeff[2]*plane_coeff[2]; - - /* - printf("Plane: y:%f p:%f coefficients: %f %f %f %f, ray direction: %f %f %f\n", - mp->test[0], mp->test[1], plane_coeff[0], plane_coeff[1], plane_coeff[2], plane_coeff[3], - p2[0],p2[1],p2[2]); - */ - - // perform intersection. - - if (!line_plane_intersection(plane_coeff, p1, p2, &intersection[0])) { - // printf("No intersection found, %f %f %f\n", p2[0], p2[1], p2[2]); - return 0; - } - - // compute ray leading to the camera. - intersection[0] -= mp->trans[0]; - intersection[1] -= mp->trans[1]; - intersection[2] -= mp->trans[2]; - - // transform into erect - erect_cart(&intersection[0], x_src, y_src, mp->distance); - - /* - printf("pano->plane->cam(%.1f, %.1f, %.1f, y:%1f,p:%1f): %8.5f %8.5f -> %8.5f %8.5f %8.5f -> %8.5f %8.5f\n", - mp->trans[0], mp->trans[1], mp->trans[2], mp->test[0], mp->test[1], - x_dest, y_dest, - intersection[0], intersection[1], intersection[2], - *x_src, *y_src); - */ - +// ********************************* + // ***** Begin Dev's code here ***** + // ********************************* + // plane_transfer_to_camera() gets spherical output image coordinates on the panosphere + // (x_dest,ydest). Convert those coords to planar coordinates on the output image plane + // (xplane, yplane, zplane) using sphere_to_plane() + + // Now we have planar image coordinates ranging from -(xmax-1)/2 to (xmax-1)/2. + // For example, for a 499x499 image, the ranges are: -249 <= xplane <= 249 and + // -249 <= yplane <= 249. + // The output is an image of a UNTILTED object. The TILT matrix maps points from the + // untilted destination image to the tilted source image. + // In an equation, [x_tilt y_tilt z_tilt]' = M_tilt * [xplane y_uplane zplane]' + + // We'll divide the procedure into two steps. First, we scale and translate the object. + // Next we'll "untilt" the image of the object plane + // This is done by 1) spinning by theta + // 2) untilting by phi (multiply by TILT matrix) + // 3) spinning by negative theta + // Just like Pablo, we need five parameters. + // Let's assign them as follows: + // 1) Te0 = theta, spin angle (in radians) mp->test[0] + // 2) Te1 = phi, untilt angle (in radians) mp->test[1] + // 3) TrX = translation in X (in pixels) mp->trans[0] + // 4) TrY = translation in Y (in pixels) mp->trans[1] + // 5) TrZ = scale factor (1: no scaling) mp->trans[2] + + + //printf("Entered plane_transfer_TO_camera function\n"); + + // Step 0 - spherical coordinates are left-handed. y increases downwards. all our code is + // right-handed. convert + y_dest = -y_dest; + + // Step 1 - spin, tilt, unspin + //mp->test[1] = 45; mp->test[0] = 0; mp->test[2] = 0; + /*mp->test[0] = fmod(mp->test[0],360.0); + mp->test[1] = fmod(mp->test[1],360.0); + mp->test[2] = fmod(mp->test[2],360.0);*/ + + double theta, phi, rot; +// Dev: 1/27/2012 - force spin, tilt, and rotate to fall between -90 and 90 + /*if (mp->test[0] > 90.0) {mp->test[0] = 90.0;} + + if (mp->test[0] < -90.0) {mp->test[0] = -90.0;} + + if (mp->test[1] > 90.0) {mp->test[1] = 90.0;} + + if (mp->test[1] < -90.0) {mp->test[1] = -90.0;}*/ + + /*if (mp->test[2] > 90.0) {rot = DEG_TO_RAD(90.0);} + else {rot = DEG_TO_RAD(mp->test[2]);} + + if (mp->test[2] < -90.0) {rot = DEG_TO_RAD(-90.0);} + else {rot = DEG_TO_RAD(mp->test[2]);}*/ + + phi = DEG_TO_RAD(mp->test[1]); + theta = DEG_TO_RAD(mp->test[0]); + rot = DEG_TO_RAD(mp->test[2]); // rotation angle + double tilt[3][3]; + double v[3]; // 3D projective coordinate vector + + double z0; + double xyz_plane[3]; + + // Convert spherical coords (xdest,ydest) to planar coords (xplane,yplane,zplane) + sphere2plane(x_dest, y_dest, &xyz_plane[0], mp->distance); + double xplane, yplane, zplane; + xplane = xyz_plane[0]; + yplane = xyz_plane[1]; + zplane = xyz_plane[2]; + +// static int count_tilt=0; +// count_tilt++; +// // Write source pixels to file and plot them in MATLAB +// FILE *out2; +// out2 = fopen("SourcePixels.txt","a"); +// if (out2 != NULL) +// { +// fprintf(out2, "%d, %f, %f, %f, %f, %f\n",count_tilt,x_dest, y_dest, xplane, yplane, zplane); +// fflush(out2); +// } +// fclose(out2); +// //printf("UNTILT: count = %d\n",count_tilt); +// fflush(stdout); + + //printf("TrX: %8.5f\n", mp->trans[0]); + + // Translate PANO pixels here xyz_plane here, not at the end! (Image pixels) + // Step 2 - translate and scale + // first translate... + xplane = xplane - mp->trans[0] * mp->scale[0]; + yplane = yplane - mp->trans[1] * mp->scale[1]; + // ... then scale + xplane = xplane / mp->trans[2]; + yplane = yplane / mp->trans[2]; + + v[0] = xplane; + v[1] = yplane; +// v[0] = -101.5212; +// v[1] = -143.5726; +// v[2] = zplane; + // place camera view of planar surface at focal distance of camera + v[2] = (double) mp->im->width / (2.0 * tan(DEG_TO_RAD( mp->im->hfov )/2.0)); + z0 = v[2]; + //printf("+++ forward: z0 = %f, mp->distance = %f, tilt = %f\n",z0,mp->distance,mp->test[1]); +// z0 = zplane; + + tilt[0][0] = 1; tilt[0][1] = 0; tilt[0][2] = 0; + tilt[1][0] = 0; tilt[1][1] = cos(phi); tilt[1][2] = 0; + tilt[2][0] = 0; tilt[2][1] = -sin(phi); tilt[2][2] = 1; + + //printf("Input coords: (x,y,z) = (%f,%f,%f)\n",v[0],v[1],v[2]); + + unspinfunc(theta+rot, v); + + //printf("After spin: (x,y,z) = (%f,%f,%f)\n",v[0],v[1],v[2]); + matrix_mult(tilt,v); + //printf("After tilt transform: (x,y,z) = (%f,%f,%f)\n",v[0],v[1],v[2]); + // After untilting, project on to x-y plane: + double x = v[0]* z0 /v[2]; + double y = v[1]* z0 /v[2]; + + v[0] = x; + v[1] = y; + v[2] = z0; + //printf("After projecting onto image plane: (x,y,z) = (%f,%f,%f)\n\n",v[0],v[1],v[2]); + + spinfunc(theta,v); + + //printf("After projecting onto image plane: (x,y,z) = (%f,%f,%f)\n\n",v[0],v[1],v[2]); + + x = v[0]; + y = v[1]; + + double planar_pt[3]; + planar_pt[0] = x; planar_pt[1] = y; planar_pt[2] = z0; + // take planar point and put it back on panosphere + plane2sphere(&planar_pt[0], x_src, y_src, mp->distance); + + //printf("Forward Transform: image dest (%f,%f) --> pano src (%f,%f)\n",x_dest,y_dest,*x_src,*y_src); + + // Last step - spherical coordinates are left-handed. y increases downwards. all our code + // above is right-handed. convert + y_dest = -y_dest; + // We've computed y_src in right-handed coordinates. Convert to left-handed: + *y_src = -*y_src; + // **** END of Dev's code ***** return 1; } @@ -2131,69 +2303,226 @@ /** transfer a point from a camera centered at x1,y1,z1 into the camera at x2,y2,z2 */ int plane_transfer_from_camera( double x_dest, double y_dest, double * x_src, double * y_src, void * params) { - - double phi, theta; - double plane_coeff[4]; - double p1[3]; - double p2[3]; - double intersection[3]; - - // params: MakeParams - - // compute ray of sight for the current pixel in - // the master panorama camera. - // camera point - p1[0] = mp->trans[0]; - p1[1] = mp->trans[1]; - p1[2] = mp->trans[2]; - - // point on sphere (direction vector in camera coordinates) - cart_erect(x_dest, y_dest, &p2[0], mp->distance); - // add camera position to get point on ray - p2[0] += p1[0]; - p2[1] += p1[1]; - p2[2] += p1[2]; - - - // compute plane description - cart_erect(DEG_TO_RAD(mp->test[0]), -DEG_TO_RAD(mp->test[1]), - &plane_coeff[0], 1.0); - - // plane_coeff[0..2] is both the normal and a point - // on the plane. - plane_coeff[3] = - plane_coeff[0]*plane_coeff[0] - - plane_coeff[1]*plane_coeff[1] - - plane_coeff[2]*plane_coeff[2]; - - /* - printf("Plane: y:%f p:%f coefficients: %f %f %f %f, ray direction: %f %f %f\n", - mp->test[0], mp->test[1], plane_coeff[0], plane_coeff[1], plane_coeff[2], plane_coeff[3], - p2[0],p2[1],p2[2]); - */ - - - // compute intersection - if (!line_plane_intersection(plane_coeff, p1, p2, &intersection[0])) { - //printf("No intersection found, %f %f %f\n", p2[0], p2[1], p2[2]); - return 0; + // **************************** + // ***** Begin Dev's code ***** + // **************************** + + // Optimizer passes points on sphere. Scale our points by scale factor necessary to + // put points on sphere of size mp->distance + // print make parameters +// panoAdjustPrintMakeParams("plane_transfer_from_camera", mp, mp->pn); +// printf("var0 = %f, var1 = %f \n",var0, var1); +// printf("mp->scale[0] = %f, mp->scale[1]=%f\n",mp->scale[0],mp->scale[1]); +// printf("source image format: %d, output pano format: %d\n",mp->im->format,mp->pn->format); +// printf("input fov = %f, output fov = %f\n", mp->im->hfov, mp->pn->hfov); + // apply scale factor to coordinates +// x_dest = (1/var0) * x_dest; +// y_dest = (1/var1) * y_dest; +// printf("x_dest = %f, y_dest = %f\n",x_dest,y_dest); + + // Step 0 - spherical coordinates are left-handed. y increases downwards. all our code is + // right-handed. convert + y_dest = -y_dest; + + + double x = x_dest; + double y = y_dest; + + + double xyz_plane[3]; + sphere2plane(x_dest, y_dest, &xyz_plane[0], mp->distance); + double xplane, yplane, zplane; + xplane = xyz_plane[0]; + yplane = xyz_plane[1]; + //xplane = 0; yplane = 0; + zplane = xyz_plane[2]; + + /* static int count=0; + //count++; + // Write destination pixels to file and plot them in MATLAB + //FILE *out; + //out = fopen("DestPixels.txt","a"); + //if (out != NULL) + //{ + // fprintf(out, "%d, %f, %f, %f, %f, %f\n",count,x_dest, y_dest,xplane,yplane,zplane); + // fflush(out); + //} + //fclose(out); */ + + + + // Now reverse step 1: unspin, tilt, and spin + //mp->test[1] = 45.0; mp->test[0] = 0; mp->test[2] = 0; + /*mp->test[0] = fmod(mp->test[0],360.0); + mp->test[1] = fmod(mp->test[1],360.0); + mp->test[2] = fmod(mp->test[2],360.0);*/ + + double theta, phi, rot; +// Dev: 1/27/2012 - force spin, tilt, and rotate to fall between -90 and 90 + /*if (mp->test[0] > 90.0) {mp->test[0] = 90.0;} + + if (mp->test[0] < -90.0) {mp->test[0] = -90.0;} + + if (mp->test[1] > 90.0) {mp->test[1] = 90.0;} + + if (mp->test[1] < -90.0) {mp->test[1] = -90.0;}*/ + + /*if (mp->test[2] > 90.0) {rot = DEG_TO_RAD(90.0);} + else {rot = DEG_TO_RAD(mp->test[2]);} + + if (mp->test[2] < -90.0) {rot = DEG_TO_RAD(-90.0);} + else {rot = DEG_TO_RAD(mp->test[2]);}*/ + + + phi = DEG_TO_RAD(mp->test[1]); + theta = DEG_TO_RAD(mp->test[0]); + + // rotation angle + rot = DEG_TO_RAD(mp->test[2]); + + double untilt[3][3]; + + double v[3]; // 3D projective coordinate vector + //double piv[3]; + + //double xmax = mp->pn->width/2; // maximum x value is image width divided by 2 + //double ymax = mp->pn->height/2; + + double z0, z1, s; + //double FOV = DEG_TO_RAD(mp->im->hfov/scale); // German/Gat approach + //double FOV = DEG_TO_RAD(mp->pn->hfov); + |
From: <bru...@us...> - 2013-01-31 21:31:30
|
Revision: 1356 http://panotools.svn.sourceforge.net/panotools/?rev=1356&view=rev Author: brunopostle Date: 2013-01-31 21:31:23 +0000 (Thu, 31 Jan 2013) Log Message: ----------- Allow setting XYZ translation parameters in CSV file Modified Paths: -------------- trunk/Panotools-Script/bin/match-n-shift Modified: trunk/Panotools-Script/bin/match-n-shift =================================================================== --- trunk/Panotools-Script/bin/match-n-shift 2013-01-29 21:20:58 UTC (rev 1355) +++ trunk/Panotools-Script/bin/match-n-shift 2013-01-31 21:31:23 UTC (rev 1356) @@ -91,6 +91,9 @@ $image->{y} = $csv[$id]->[1] if (defined $csv[$id] and defined $csv[$id]->[1]); $image->{p} = $csv[$id]->[2] if (defined $csv[$id] and defined $csv[$id]->[2]); $image->{r} = $csv[$id]->[3] if (defined $csv[$id] and defined $csv[$id]->[3]); + $image->{TrX} = $csv[$id]->[4] if (defined $csv[$id] and defined $csv[$id]->[4]); + $image->{TrY} = $csv[$id]->[5] if (defined $csv[$id] and defined $csv[$id]->[5]); + $image->{TrZ} = $csv[$id]->[6] if (defined $csv[$id] and defined $csv[$id]->[6]); if ($photos_all->Bracketed) { @@ -224,6 +227,13 @@ DSC_0003.JPG,180,20,90 DSC_0004.JPG,-180,-20,90 +..or optionally specify XYZ translation parameters as well: + + DSC_0001.JPG, 0, 20, 0, 0.5, 0.0, 1.0 + DSC_0002.JPG, 0, 20, 0, 1.4, 0.0, 1.0 + DSC_0003.JPG, 0, 20, 0, 2.3, 0.0, 1.0 + DSC_0004.JPG, 0, 20, 0, 3.2, 0.0, 1.0 + If the roll field is ommitted then it will be set to zero or any value obtainable from EXIF data, similarly if the pitch field is ommitted then pitch will be set to zero. So this should also work: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@li...> - 2013-01-31 17:13:51
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/1299ba47658f changeset: 769:1299ba47658f user: tmodes date: Thu Jan 31 18:14:13 2013 +0100 description: Unified use of path length Check also length before copying [1057012] diffstat: panorama.h | 4 +--- tiff.c | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diffs (34 lines): diff -r b2f10b688fd6 -r 1299ba47658f panorama.h --- a/panorama.h Sat Jan 12 10:21:32 2013 +0100 +++ b/panorama.h Thu Jan 31 18:14:13 2013 +0100 @@ -393,8 +393,6 @@ int bitsPerPixel; // This is a common value to use } pano_ImageMetadata; -#define PANO_PATH_LEN 255 - // THe following constants define the number of parameters used by a projection // THe first is the number provided by the user. In most cases it is @@ -430,7 +428,7 @@ double pitch; double roll; cPrefs cP; // How to correct the image - char name[PANO_PATH_LEN+1]; + char name[MAX_PATH_LENGTH]; PTRect selection; CropInfo cropInformation; // TO BE DEPRECATED diff -r b2f10b688fd6 -r 1299ba47658f tiff.c --- a/tiff.c Sat Jan 12 10:21:32 2013 +0100 +++ b/tiff.c Thu Jan 31 18:14:13 2013 +0100 @@ -1544,8 +1544,7 @@ } //Store name of TIFF file - strncpy(im->name, fileName, PANO_PATH_LEN); - + snprintf(im->name, MAX_PATH_LENGTH, "%s", fileName); //printf("after update metadata tiff\n"); result = TRUE; |
From: <bru...@us...> - 2013-01-29 21:21:05
|
Revision: 1355 http://panotools.svn.sourceforge.net/panotools/?rev=1355&view=rev Author: brunopostle Date: 2013-01-29 21:20:58 +0000 (Tue, 29 Jan 2013) Log Message: ----------- Create a PTO project based on a CSV file specifying yaw, pitch etc... Modified Paths: -------------- trunk/Panotools-Script/Changes trunk/Panotools-Script/bin/match-n-shift Modified: trunk/Panotools-Script/Changes =================================================================== --- trunk/Panotools-Script/Changes 2013-01-13 00:03:54 UTC (rev 1354) +++ trunk/Panotools-Script/Changes 2013-01-29 21:20:58 UTC (rev 1355) @@ -4,6 +4,7 @@ - new tool: nona-svg - stitch a vector panorama image - new tool: pto2gpano - add GPano XMP metadata - ptovariable: support XYZ translation parameters + - match-n-shift: create a project based on a CSV list input file 0.27 - remove linux desktop entries for tif2svg-gui enblend-svg process-masks-gui qtvr2erect-gui Modified: trunk/Panotools-Script/bin/match-n-shift =================================================================== --- trunk/Panotools-Script/bin/match-n-shift 2013-01-13 00:03:54 UTC (rev 1354) +++ trunk/Panotools-Script/bin/match-n-shift 2013-01-29 21:20:58 UTC (rev 1355) @@ -6,8 +6,10 @@ use Pod::Usage; use Panotools::Script; use Panotools::Photos; +use Text::ParseWords; my $path_oto; +my $path_csv; my $pix_max = 1600; my $points = 25; my $noransac = 0; @@ -22,6 +24,7 @@ my $help = 0; GetOptions ('o|output=s' => \$path_oto, + 'i|input=s' => \$path_csv, 's|size=i' => \$pix_max, 'p|points=i' => \$points, 'n|noransac' => \$noransac, @@ -36,12 +39,24 @@ 'h|help' => \$help); # code assumes images are sorted -@ARGV = sort @ARGV; +my @path_photos = sort @ARGV; +# if csv file is specified, parse and replace list of photos +my @csv; +if ($path_csv) +{ + open (CSV, '<'. $path_csv); + my @lines = (<CSV>); + chomp @lines; + close CSV; + @csv = map {[parse_line ('\s*,\s*', 0, $_)]} @lines; + @path_photos = map {$_->[0]} @csv; +} + pod2usage (-verbose => 2) if $help; -pod2usage (2) unless (scalar @ARGV > 1); +pod2usage (2) unless (scalar @path_photos > 1); -my $photos_all = new Panotools::Photos (@ARGV); +my $photos_all = new Panotools::Photos (@path_photos); $deg_fov = 50 unless defined $deg_fov; # decimal separator workaround @@ -52,7 +67,7 @@ my @AverageRGB = $photos_all->AverageRGB; my $sum_Eev; -for my $id (0 .. scalar @ARGV -1) +for my $id (0 .. scalar @path_photos -1) { my $image = new Panotools::Script::Line::Image; my $photo = $photos_all->[$id]; @@ -73,6 +88,9 @@ $sum_Eev += $photos_all->Eev ($id); $image->{Er} = $photo->{exif}->{RedBalance} / $AverageRGB[0] if $photo->{exif}->{RedBalance}; $image->{Eb} = $photo->{exif}->{BlueBalance} / $AverageRGB[2] if $photo->{exif}->{BlueBalance}; + $image->{y} = $csv[$id]->[1] if (defined $csv[$id] and defined $csv[$id]->[1]); + $image->{p} = $csv[$id]->[2] if (defined $csv[$id] and defined $csv[$id]->[2]); + $image->{r} = $csv[$id]->[3] if (defined $csv[$id] and defined $csv[$id]->[3]); if ($photos_all->Bracketed) { @@ -158,13 +176,7 @@ Options: -o | --output name Filename of created panorama project - -s | --size number Downsize images until width and height is - smaller than number, default 1600 - -p | --points number Number of generated control points between, - each pair, default: 25 - -n | --noransac No ransac detection, useful for fisheye images - -r | --refine Refine the found control points using the - original images, delete unrefinable. + -i | --input name Filename of CSV file specifying input images (optional, see below) -f | --projection Panotools style input projection number. Use 0 for rectilinear (default), 2 for circular fisheye and 3 for full-frame fisheye images. Note, this has to be @@ -178,11 +190,49 @@ -a | --align Generate control points (default no). -h | --help Outputs help documentation. + Deprecated options (have no effect when using cpfind): + -s | --size number Downsize images until width and height is + smaller than number, default 1600 + -p | --points number Number of generated control points between, + each pair, default: 25 + -n | --noransac No ransac detection, useful for fisheye images + -r | --refine Refine the found control points using the + original images, delete unrefinable. + =head1 DESCRIPTION B<match-n-shift> takes a list of image files and creates a hugin compatible -project file optionally containing control points linking the images together. +project file (optionally containing control points linking the images together, +though there are better ways of doing this). +As much information as possible is extracted from photo EXIF data. So photo +orientation, exposure, angle of view and white balance will all be initialised +if possible. + +An optional input file can be chosen with the --input option, this can be a +simple list of photo filenames, or full paths, one per line: + + DSC_0001.JPG + DSC_0002.JPG + DSC_0003.JPG + DSC_0004.JPG + +..or a CSV file specifying "filename, yaw, pitch, roll" (in degrees): + + DSC_0001.JPG,0,20,90 + DSC_0002.JPG,90,-20,90 + DSC_0003.JPG,180,20,90 + DSC_0004.JPG,-180,-20,90 + +If the roll field is ommitted then it will be set to zero or any value +obtainable from EXIF data, similarly if the pitch field is ommitted then pitch +will be set to zero. So this should also work: + + DSC_0001.JPG,0 + DSC_0002.JPG,90 + DSC_0003.JPG,180 + DSC_0004.JPG,-180 + =head1 LICENSE This program is free software; you can redistribute it and/or This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bru...@us...> - 2013-01-13 00:04:05
|
Revision: 1354 http://panotools.svn.sourceforge.net/panotools/?rev=1354&view=rev Author: brunopostle Date: 2013-01-13 00:03:54 +0000 (Sun, 13 Jan 2013) Log Message: ----------- support XYZ translation parameters in ptovariable Modified Paths: -------------- trunk/Panotools-Script/Changes trunk/Panotools-Script/bin/ptovariable Modified: trunk/Panotools-Script/Changes =================================================================== --- trunk/Panotools-Script/Changes 2013-01-08 21:27:37 UTC (rev 1353) +++ trunk/Panotools-Script/Changes 2013-01-13 00:03:54 UTC (rev 1354) @@ -3,6 +3,7 @@ 0.28 - new tool: nona-svg - stitch a vector panorama image - new tool: pto2gpano - add GPano XMP metadata + - ptovariable: support XYZ translation parameters 0.27 - remove linux desktop entries for tif2svg-gui enblend-svg process-masks-gui qtvr2erect-gui Modified: trunk/Panotools-Script/bin/ptovariable =================================================================== --- trunk/Panotools-Script/bin/ptovariable 2013-01-08 21:27:37 UTC (rev 1353) +++ trunk/Panotools-Script/bin/ptovariable 2013-01-13 00:03:54 UTC (rev 1354) @@ -13,6 +13,10 @@ my @r; my @p; my @y; +my $translations; +my @TrX; +my @TrY; +my @TrZ; my $view = 0; my $barrel = 0; my $centre = 0; @@ -34,6 +38,10 @@ 'r=i' => \@r, 'p=i' => \@p, 'y=i' => \@y, + 'translations' => \$translations, + 'TrX=i' => \@TrX, + 'TrY=i' => \@TrY, + 'TrZ=i' => \@TrZ, 'vignetting' => \$vignetting, 'vignetting-centre' => \$vignetting_centre, 'response' => \$response, @@ -81,6 +89,10 @@ $variable->{$index}->{p} = $positions || $pitch; $variable->{$index}->{y} = $positions || $yaw; + $variable->{$index}->{TrX} = $translations; + $variable->{$index}->{TrY} = $translations; + $variable->{$index}->{TrZ} = $translations; + $variable->{$index}->{Eev} = $exposure; $variable->{$index}->{Er} = $white_balance; @@ -91,6 +103,10 @@ $variable->{$_}->{p} = 1 for (@p); $variable->{$_}->{y} = 1 for (@y); +$variable->{$_}->{TrX} = 1 for (@TrX); +$variable->{$_}->{TrY} = 1 for (@TrY); +$variable->{$_}->{TrZ} = 1 for (@TrZ); + $pto->Write ($path_output); __END__ @@ -111,6 +127,10 @@ -r <num> <num> <..> Optimise roll for specified images -p <num> <num> <..> Optimise pitch for specified images -y <num> <num> <..> Optimise yaw for specified images + --translations Optimise XYZ mosaic translations for all images except anchor + -TrX <num> <..> Optimise X translation for specified images + -TrY <num> <..> Optimise Y translation for specified images + -TrZ <num> <..> Optimise Z translation for specified images --view Optimise angle of view --barrel Optimise barrel distortion --centre Optimise optical centre This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@li...> - 2013-01-12 09:21:12
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/b2f10b688fd6 changeset: 768:b2f10b688fd6 user: tmodes date: Sat Jan 12 10:21:32 2013 +0100 description: Modified scale calculation for orthographic images This takes into account the issue that the image could also contain a thin black border around the (circular) image. diffstat: adjust.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diffs (29 lines): diff -r 376cc090f008 -r b2f10b688fd6 adjust.c --- a/adjust.c Fri Dec 28 13:39:28 2012 +0100 +++ b/adjust.c Sat Jan 12 10:21:32 2013 +0100 @@ -813,7 +813,11 @@ mp->scale[0] = (double) image_selection_width / (4.0 * sin(a/4.0)) / mp->distance; break; case _orthographic: - mp->scale[0] = (double) image_selection_width / (2.0 * sin(a/2.0)) / mp->distance; + { + //generate monotonic scale function to help optimizer + int t=(int)ceil((a-PI)/(2.0*PI)); + mp->scale[0] = (double) image_selection_width / (2.0 * (2 * t + pow(-1.0, t) * sin(a/2.0))) / mp->distance; + }; break; case _thoby: mp->scale[0] = (double) image_selection_width / (2.0 * THOBY_K1_PARM * sin(a * THOBY_K2_PARM /2.0)) / mp->distance; @@ -1259,7 +1263,11 @@ mp->scale[0] = (double) im->width / (4.0 * sin(a/4.0)) / mp->distance; break; case _orthographic: - mp->scale[0] = (double) im->width / (2.0 * sin(a/2.0)) / mp->distance; + { + //generate monotonic scale function to help optimizer + int t=(int)ceil((a-PI)/(2.0*PI)); + mp->scale[0] = (double) im->width / (2.0 * (2 * t + pow(-1.0, t) * sin(a/2.0))) / mp->distance; + }; break; case _thoby: mp->scale[0] = (double) im->width / (2.0 * THOBY_K1_PARM * sin(a * THOBY_K2_PARM/2.0)) / mp->distance; |
From: <bru...@us...> - 2013-01-08 21:27:43
|
Revision: 1353 http://panotools.svn.sourceforge.net/panotools/?rev=1353&view=rev Author: brunopostle Date: 2013-01-08 21:27:37 +0000 (Tue, 08 Jan 2013) Log Message: ----------- fix stupid bug calculating image offsets Modified Paths: -------------- trunk/Panotools-Script/bin/pto2gpano Modified: trunk/Panotools-Script/bin/pto2gpano =================================================================== --- trunk/Panotools-Script/bin/pto2gpano 2013-01-07 21:24:56 UTC (rev 1352) +++ trunk/Panotools-Script/bin/pto2gpano 2013-01-08 21:27:37 UTC (rev 1353) @@ -20,7 +20,6 @@ $pto->Read ($path_pto) || next; my $format = undef; - $format = 'cylindrical' if $pto->Panorama->{f} == 1; $format = 'equirectangular' if $pto->Panorama->{f} == 2; next unless $format; @@ -43,9 +42,17 @@ if ($pto->Panorama->{v} < 360) { $full_width = int (360 * $full_width / $pto->Panorama->{v}); - $left += int (($full_width - $width) /2); + $left += int (($full_width - $pto->Panorama->{w}) /2); } + my $vfov = $pto->Panorama->{v} * $pto->Panorama->{h} / $pto->Panorama->{w}; + my $full_height = $pto->Panorama->{h}; + if ($vfov < 180) + { + $full_height = int (180 * $full_height / $vfov); + $top += int (($full_height - $pto->Panorama->{h}) /2); + } + my $path_first = $pto->Image->[0]->Path ($path_pto); my $path_last = $pto->Image->[-1]->Path ($path_pto); @@ -58,7 +65,7 @@ $exiftool->SetNewValue ('CroppedAreaImageWidthPixels', $width); $exiftool->SetNewValue ('CroppedAreaImageHeightPixels', $height); $exiftool->SetNewValue ('FullPanoWidthPixels', $full_width); - $exiftool->SetNewValue ('FullPanoHeightPixels', $pto->Panorama->{h}); + $exiftool->SetNewValue ('FullPanoHeightPixels', $full_height); $exiftool->SetNewValue ('FirstPhotoDate', Image::ExifTool::ImageInfo ($path_first)->{DateTimeOriginal}) if -e $path_first; $exiftool->SetNewValue ('LastPhotoDate', Image::ExifTool::ImageInfo ($path_last)->{DateTimeOriginal}) if -e $path_last; $exiftool->SetNewValue ('SourcePhotosCount', scalar @{$pto->Image}); @@ -89,9 +96,9 @@ https://developers.google.com/panorama/metadata/ -This tool assumes that for each project.pto, there is an equivalent project.jpg -that needs updated metadata. It also assumes that the original photos are -available to extract EXIF data info. +This tool assumes that for each project.pto, there is an equivalent +equirectangular project.jpg that needs updated metadata. It also assumes that +the original photos are available to extract EXIF data info. =head1 LICENSE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bru...@us...> - 2013-01-07 21:25:02
|
Revision: 1352 http://panotools.svn.sourceforge.net/panotools/?rev=1352&view=rev Author: brunopostle Date: 2013-01-07 21:24:56 +0000 (Mon, 07 Jan 2013) Log Message: ----------- Maybe deal better with partial panoramas Modified Paths: -------------- trunk/Panotools-Script/bin/pto2gpano Modified: trunk/Panotools-Script/bin/pto2gpano =================================================================== --- trunk/Panotools-Script/bin/pto2gpano 2013-01-07 00:18:13 UTC (rev 1351) +++ trunk/Panotools-Script/bin/pto2gpano 2013-01-07 21:24:56 UTC (rev 1352) @@ -14,7 +14,6 @@ my $path_jpg = $path_pto; $path_jpg =~ s/\.pto/.jpg/; - say "JPEG file: $path_jpg"; next unless -e $path_jpg; my $pto = new Panotools::Script; @@ -40,6 +39,13 @@ $height = $crop[3] - $crop[2]; } + my $full_width = $pto->Panorama->{w}; + if ($pto->Panorama->{v} < 360) + { + $full_width = int (360 * $full_width / $pto->Panorama->{v}); + $left += int (($full_width - $width) /2); + } + my $path_first = $pto->Image->[0]->Path ($path_pto); my $path_last = $pto->Image->[-1]->Path ($path_pto); @@ -51,13 +57,14 @@ $exiftool->SetNewValue ('CroppedAreaTopPixels', $top); $exiftool->SetNewValue ('CroppedAreaImageWidthPixels', $width); $exiftool->SetNewValue ('CroppedAreaImageHeightPixels', $height); - $exiftool->SetNewValue ('FullPanoWidthPixels', $pto->Panorama->{w}); + $exiftool->SetNewValue ('FullPanoWidthPixels', $full_width); $exiftool->SetNewValue ('FullPanoHeightPixels', $pto->Panorama->{h}); - $exiftool->SetNewValue ('FirstPhotoDate', Image::ExifTool::ImageInfo ($path_first)->{DateTimeOriginal}); - $exiftool->SetNewValue ('LastPhotoDate', Image::ExifTool::ImageInfo ($path_last)->{DateTimeOriginal}); + $exiftool->SetNewValue ('FirstPhotoDate', Image::ExifTool::ImageInfo ($path_first)->{DateTimeOriginal}) if -e $path_first; + $exiftool->SetNewValue ('LastPhotoDate', Image::ExifTool::ImageInfo ($path_last)->{DateTimeOriginal}) if -e $path_last; $exiftool->SetNewValue ('SourcePhotosCount', scalar @{$pto->Image}); $exiftool->WriteInfo ($path_jpg); + say "JPEG file: $path_jpg"; } 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <bru...@us...> - 2013-01-07 00:18:22
|
Revision: 1351 http://panotools.svn.sourceforge.net/panotools/?rev=1351&view=rev Author: brunopostle Date: 2013-01-07 00:18:13 +0000 (Mon, 07 Jan 2013) Log Message: ----------- New tool to set XMP GPano metadata in a JPEG panorama. Reads project data from the PTO file and writes XMP to any equivalently named JPEG file, so should reliably work with partial panoramas. Modified Paths: -------------- trunk/Panotools-Script/Changes trunk/Panotools-Script/MANIFEST trunk/Panotools-Script/Makefile.PL Added Paths: ----------- trunk/Panotools-Script/bin/pto2gpano Modified: trunk/Panotools-Script/Changes =================================================================== --- trunk/Panotools-Script/Changes 2012-09-16 21:40:08 UTC (rev 1350) +++ trunk/Panotools-Script/Changes 2013-01-07 00:18:13 UTC (rev 1351) @@ -2,6 +2,7 @@ 0.28 - new tool: nona-svg - stitch a vector panorama image + - new tool: pto2gpano - add GPano XMP metadata 0.27 - remove linux desktop entries for tif2svg-gui enblend-svg process-masks-gui qtvr2erect-gui Modified: trunk/Panotools-Script/MANIFEST =================================================================== --- trunk/Panotools-Script/MANIFEST 2012-09-16 21:40:08 UTC (rev 1350) +++ trunk/Panotools-Script/MANIFEST 2013-01-07 00:18:13 UTC (rev 1351) @@ -20,6 +20,7 @@ bin/panostart bin/process-masks bin/process-masks-gui +bin/pto2gpano bin/pto2mk2 bin/ptoanchor bin/ptobind Modified: trunk/Panotools-Script/Makefile.PL =================================================================== --- trunk/Panotools-Script/Makefile.PL 2012-09-16 21:40:08 UTC (rev 1350) +++ trunk/Panotools-Script/Makefile.PL 2013-01-07 00:18:13 UTC (rev 1351) @@ -7,13 +7,13 @@ 'bin/jpeg2qtvr', 'bin/erect2qtvr', 'bin/enblend-mask', 'bin/match-n-shift', 'bin/ptoset', 'bin/ptodouble', 'bin/process-masks', 'bin/erect2planet', 'bin/ptoget', 'bin/enfuse-mask', 'bin/ptohalve', 'bin/ptomorph', 'bin/ptochain', 'bin/ptobind', 'bin/ptofill', 'bin/gigastart', 'bin/entile', 'bin/gigatile', 'bin/ptoreset', - 'bin/tif2svg', 'bin/enblend-svg', 'bin/ptoinfo', 'bin/ptopath', 'bin/ptodummy', 'bin/ptoanchor', + 'bin/tif2svg', 'bin/enblend-svg', 'bin/ptoinfo', 'bin/ptopath', 'bin/ptodummy', 'bin/ptoanchor', 'bin/pto2gpano', 'bin/qtvr2erect-gui', 'bin/tif2svg-gui', 'bin/ptoinfo-gui', 'bin/ptosort', 'bin/ptovariable', 'bin/nona-svg', 'bin/process-masks-gui', 'bin/enblend-svg-gui', 'bin/erect2qtvr-gui', 'bin/ptoclean', 'bin/gmaptemplate', 'bin/erect2mercator', 'bin/ptosplit', 'bin/ptomerge', 'bin/panostart', 'bin/ptsed', 'bin/ptscluster', 'bin/lens-submit', 'bin/transform-pano', 'bin/nona-mask', 'bin/qtvr2erect', 'bin/ptocentre' ], 'VERSION_FROM' => 'lib/Panotools/Script.pm', # finds $VERSION - 'PREREQ_PM' => {'bytes' => 0.0, 'File::Copy' => 1.0, 'Image::ExifTool' => 6.0, + 'PREREQ_PM' => {'bytes' => 0.0, 'File::Copy' => 1.0, 'Image::ExifTool' => 9.07, 'Getopt::Long' => 2.0, 'Pod::Usage' => 1.0, 'Getopt::Std' => 1.0, 'LWP::UserAgent' => 0.0, 'Test::More' => 0.1, 'Math::Trig' => 0.1, 'File::Temp' => 0.1, 'URI' => 0.0, 'File::Spec' => 0.8, 'Image::Size' => 2.9, 'Storable' => 2.0}, Added: trunk/Panotools-Script/bin/pto2gpano =================================================================== --- trunk/Panotools-Script/bin/pto2gpano (rev 0) +++ trunk/Panotools-Script/bin/pto2gpano 2013-01-07 00:18:13 UTC (rev 1351) @@ -0,0 +1,105 @@ +#!/usr/bin/perl +use strict; +use warnings; +use 5.010; +use Panotools::Script; +use Image::ExifTool; +use Pod::Usage; + +pod2usage (2) unless (scalar @ARGV); + +for my $path_pto (@ARGV) +{ + say "Project file: $path_pto"; + + my $path_jpg = $path_pto; + $path_jpg =~ s/\.pto/.jpg/; + say "JPEG file: $path_jpg"; + next unless -e $path_jpg; + + my $pto = new Panotools::Script; + $pto->Read ($path_pto) || next; + + my $format = undef; + $format = 'cylindrical' if $pto->Panorama->{f} == 1; + $format = 'equirectangular' if $pto->Panorama->{f} == 2; + next unless $format; + + my $left = 0; + my $top = 0; + my $width = $pto->Panorama->{w}; + my $height = $pto->Panorama->{h}; + + if (defined $pto->Panorama->{S}) + { + # S100,600,100,800 Selection(left,right,top,bottom) + my @crop = split ',', $pto->Panorama->{S}; + $left = $crop[0]; + $top = $crop[2]; + $width = $crop[1] - $crop[0]; + $height = $crop[3] - $crop[2]; + } + + my $path_first = $pto->Image->[0]->Path ($path_pto); + my $path_last = $pto->Image->[-1]->Path ($path_pto); + + my $exiftool = new Image::ExifTool; + $exiftool->SetNewValue ('UsePanoramaViewer', 'True'); + $exiftool->SetNewValue ('StitchingSoftware', 'Hugin'); + $exiftool->SetNewValue ('ProjectionType', $format); + $exiftool->SetNewValue ('CroppedAreaLeftPixels', $left); + $exiftool->SetNewValue ('CroppedAreaTopPixels', $top); + $exiftool->SetNewValue ('CroppedAreaImageWidthPixels', $width); + $exiftool->SetNewValue ('CroppedAreaImageHeightPixels', $height); + $exiftool->SetNewValue ('FullPanoWidthPixels', $pto->Panorama->{w}); + $exiftool->SetNewValue ('FullPanoHeightPixels', $pto->Panorama->{h}); + $exiftool->SetNewValue ('FirstPhotoDate', Image::ExifTool::ImageInfo ($path_first)->{DateTimeOriginal}); + $exiftool->SetNewValue ('LastPhotoDate', Image::ExifTool::ImageInfo ($path_last)->{DateTimeOriginal}); + $exiftool->SetNewValue ('SourcePhotosCount', scalar @{$pto->Image}); + + $exiftool->WriteInfo ($path_jpg); +} + +0; + + +__END__ + +=head1 NAME + +pto2gpano - set XMP GPano metadata in a JPEG panorama + +=head1 SYNOPSIS + +pto2gpano project1.pto project2.pto [...] + +Options: None + +=head1 DESCRIPTION + +Sets XMP metadata as described here, panoramas tagged with this metadata will +display in the Google+ panorama viewer: + +https://developers.google.com/panorama/metadata/ + +This tool assumes that for each project.pto, there is an equivalent project.jpg +that needs updated metadata. It also assumes that the original photos are +available to extract EXIF data info. + +=head1 LICENSE + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +=head1 SEE ALSO + +L<http://hugin.sourceforge.net/> +L<http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/XMP.html#GPano> + +=head1 AUTHOR + +Bruno Postle - January 2013. + +=cut Property changes on: trunk/Panotools-Script/bin/pto2gpano ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@li...> - 2012-12-28 12:39:19
|
branch: details: http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/376cc090f008 changeset: 767:376cc090f008 user: tmodes date: Fri Dec 28 13:39:28 2012 +0100 description: Fixes bug in orthographic projection Orthographic projection is limited to fov of 180 degree Higher values were not correctly cropped, instead these coordinates were mirrored inside diffstat: math.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diffs (33 lines): diff -r e63acb0227b7 -r 376cc090f008 math.c --- a/math.c Mon Nov 19 22:37:34 2012 -0400 +++ b/math.c Fri Dec 28 13:39:28 2012 +0100 @@ -2531,6 +2531,13 @@ rho = sqrt( x_dest*x_dest + y_dest*y_dest ); + // orthographic projection is limited to fov of 180 deg + if(rho>((double*)params)[0]) + { + *x_src = 0; + *y_src = 0; + return 0; + }; theta = 1.0 * asin( rho/(1.0*((double*)params)[0]) ); phi = atan2( y_dest , x_dest ); @@ -2549,7 +2556,14 @@ theta = sqrt( x_dest * x_dest + y_dest * y_dest ) / ((double*)params)[0]; phi = atan2( y_dest , x_dest ); - + //orthographic projection is limited to fov of 180 deg + if(fabs(theta)>HALF_PI) + { + *x_src=0; + *y_src=0; + return 0; + }; + rho = 1.0 * ((double*)params)[0] * sin( theta / 1.0 ); *x_src = rho * cos( phi ); |