PanoTools

Over the years I have made some changes and additions to Panotools.  I have also incorporated changes that others have given me.  The best place to look at the code and see all changes is on the PanoTools on SourceForge web site.  This page is being kept for historical reasons only and does not reflect all changes made.


2005/11/24 ver 2.8.0

 Updated version number to reflect completion of milestone, and get rid of extra digits.

Crash
Determined the reason for crash using PTStitcher.exe.  The pano12.dll is called to open the script file with LoadScript() which pano12 allocates memory for that file and passes it back to PTStitcher.  When PTStitcher is done with it it deletes it.  The script is opened very early in the process and then 13000 calls to the dll later it crashes.

Function to allocate and deallocate memory have been updated several times since 2001.  When I build with MSVS.Net I am using a newer version of the allocate function but an older version of the delete function is still called with PTStitcher.  What happens is, the memory does not gets deleted correctly and the program blows up.

To prevent the crashing when using the helper applications like PTStitcher it is necessary to build pano12.dll with the same compiler, MinGW.  This version of the dll is between 25% and 50% slower than the MSVS version.

To gain back the back the speed increase and prevent crashes it is necessary to rewrite PTStitcher, and make further modifications to pano12.dll.  With all the building and testing I have done, I have enough information to recreate PTStitcher, but not enough time right now.  Lesson learned:  Wherever memory is allocated it should be deallocated in case one of the components get updated.  This can not be fixed without rewriting PTStitcher.

Memory leak
Prevented minor memory leak possibilities.


2005/11/16 ver 2.7.0.13

Optimizer bug
Fixed bug with optimizer that would generate improper values for images that are cropped outside image border.

Bounds error
Fix "Bounds error" for the expanded depth of field.  Projects now complete without error message.  

AMD64 machine
Speed increase for AMD64 machines.

No longer using Microsoft's msvcr71.dll.


2005/10/25 ver 2.7.0.11

Faster tCA Correction
Incorporates Robert Pratt's improvement to correcting chromatic distortion.  Only the color channel(s) that need to be processed are processed.  Color channels with the exact same change are processed together.  Instead of three separate passes only one or two may be necessary.

New Antialiasing Filters
Incorporates Thomas Rauscher's antialiasing filters.  Antialiasing is very useful when reducing the size of the image to avoid aliasing.

The beginnings of 32bit Floating Point File support.
Incorporates Thomas Rauscher's additions of 32bit Floating Point File support.  32bit floating point TIFF files can be opened, saved, and processed using one of the antialiasing filters.

BMP file with rows recorded in reverse order.
Fixed bug that now allows to open BMP files that have their rows saved in reverse order.


2005/05/14 ver 2.7.0.10

PNG file fixed
Linked with newer image (TIFF, JPEG, & PNG) librarys.  Fix problems of building projects using or creating PNG files.  Minor bug fixes.


2005/02/15 ver 2.7.0.9

Cropping outside of image
Incorporated Joost Nieuwenhuijse's bug fix for when source images are cropped 'outside' the original image border.  Cropping is done using the C parameter on i and o lines in stitching script files.  This is often handy with almost full frame fisheye images that have some area just in the corners that needs to be cropped away.  This fix allows PTGui version 4.0 or later to no longer create temporary files.  This fix also removes a check and error message for negative control points


2004/11/18 ver 2.7.0.8

Minor bugs fixed
Fixed small memory leak.


2004/10/15 ver 2.7.0.7

JPEG optimization
Implemented JPEG optimization.  Allows higher compression with JPEG files.  Reducing file size by 35% and maintaining quality. Optimization turned on by default.  It can be turned off using the stitching script file.  Some very old applications may have trouble displaying these images.


2004/10/07 ver 2.7.0.6

Official version released.
Version 2.7.0.6 is the same as 2.7.0.5.a1 except for version number.


2004/09/27 ver 2.7.0.5

Updated to work with 16 bit images
   16bit in PhotoShop is actually 15bit+1 (0 to 32768), 32769 discrete values.
   All of PanoTools 16 bit mode is written for *full* 16 bit.
   Images imported from Photoshop to Panotools are converted from 15+1 to 16 bit.
   Images exported from Panotools back to Photoshop are converted from 16 to 15+1 bit.

Incorporates Fulvio Senore's fast code .  Faster transformations by extrapolating values.  Invoked by adding f0 to the m line in the stitching script .  Check out my test, up to 300% faster.

Incorporates Rik Littlefield's changes to Fulvio's fast code to handle morphing points and maintaining low errors.

Incorporates Rik Littlefield's Extended Depth-of-field feature.  Automatically determine, for every point in a picture, which of numerous overlapping images has best focus.  Masks are generated to reveal the best focused parts of each image.  Invoked by adding a z line to the stitching script.

Fixed bug that prevented the creation of very large PSD files.

PTEditor - Fixed bug that would not open any file.

Plug-in - Fixed the dialog names on Windows.  Some dialogs had incorrect names.

Dialogs that prompt for file names ( Fourier, and Setting ) work properly with paths and names that have spaces or umlaut () characters.  Edit file/path controls are now scrollable and edited changes are used.

Thanks to Thomas Niemann's investigation I have changed how often progress bars are updated. A 3750w X 5000h pix image. Running both radial luminance (vignetting) and radial distortion (Chromatic Aberration) correction went from 4:06 down to 1:32 minutes.


2004/06/05

Incorporated Rik Littlefield's Optimizer improvement . This is based on Beta 3.  Changes from beta 2: fixed a bug that would sometimes increase the Field of View (fov) value.

Incorporate Joost Nieuwenhuijse and Rik Littlefield's query feature.

Use this little Windows utility, panoinfo, to display current version and feature information of the pano12.dll.


2004/03/17

Incorporated Kevin Kratzke's Radial Shift fix. 
The Radial Shift, when colors channels have different values and one of the d values is > 1.0 would give incorrect results around the edge of the image.


2003/12/29

Updated reading PSD file to read updated format.
Now usable as plugin with PhotoShop as well as with the various GUI front ends.


2003/11/24

Fixed bug with odd size data structure for Photoshop files.

There is only one pad char at the end of all layer and channel data, if everything was an odd length.


2003/11/21

There are a couple bugs in PanoTools with the creation of multilayer Photoshop files.

Because of the way PanoTools saves multilayer .psd file other programs can not open the files.

A multi-layered psd file regardless if it has a clip mask should both still have a shape mask, that isolates the image from the rest of the layer.  The clip mask, if present should isolate the parts of the image from the rest of the image, using various degrees of transparency.   This allows to modify the mask to hide and show various parts of the image and never reveal the background.

With PanoTools:

In file.c the function writePSDwithlayers is called for both With_Mask and Without_Mask with no difference.  If With_Mask is used the Alpha channel that held the shape mask is replaced with the clip mask data.  It would have been nice if a new channel was created instead, but this is not so and without PTStitcher.exe source code will not be so.

The seam options are ignored by PTStitcher.exe; middle (s0 'blend') and edge (s1 'paste')  should determine if the seam on the clip mask is in either the center of the overlap or at the edge.  Feathering is done only if the With_Mask is used.  Feathering should be allowed at the edge too, but it is not so.

The file format to save Adobes 16bit multilayer PSD files is not known to me and the format is proprietary.

If 16bit input images are passed to PTStitcher to try to create a multilayer PSD file they are reduced to 8bit. 

To create 16 bit multilayer file save result as multi file TIFF.  Import these files into Photoshop. Use Erik Krause PS Action Import TIFF files with alpha channel to masked layers .

What I have done

For both With_Mask and Without_Mask create a shape mask hiding the non image data.

To determine which option was used, With_Mask or Without_Mask I scan the Alpha channel to see if it contains semi transparent pixels.  If the alpha channel is only Black or White then it can be used for both shape mask and clip mask.  This test will fail if the feather was set to 0.

If Alpha channel has feathering create a new shape mask that is totally opaque.

For backward compatibility reasons I continue to create mask for Without_Mask

Create both of the shape mask and clip mask properly.

Changes added to file, file.c in functions, writePSDwithLayer and addLayer with new functions hasFeather and writeTransparentAlpha added.

The result of the changes is that


2003/09/24

Updated Adjust.c so that the options yaw, pitch, and roll ( y, p, & r ) can be made equal to each other like v, a, b, & c can when optimizing.

i f2 r0  p5  y0   v183 a0  b-0.1 c0  mx400 my400
i f2 r=0 p=0 y182 v=0  a=0 b=0   c=0 mx400 my400

This allows to get a general value if you know the camera was level.  But each image should be allowed to calculate separately for best results to compensate for little play or movement in pan head and tripod.


2003/08/25

After A discussion on "What value for radial brightness falloff" and getting an enlargement back from the photo lab where I can see circular banning on the image (this was because I used the Correct filter to fix Luminance Falloff and then some massive levels adjustment.) has prompted me to look at the source code of panotools.


I have made two changes (fixed bug / improvement). 

1 To Eliminate the banning that is caused from the Radial Luminance I introduced a random feathering in the function radlum of math.c here is the changes.  The define is added to filter.h

   // JMW 2003/08/25 randomize a little
   result = result * ( (1 + LUMINANCE_RANDOMIZE/2) - LUMINANCE_RANDOMIZE * rand() / (double)RAND_MAX );


2 To fix the problem that portrait and landscape images require different results I change from using the width of the image to using the shortest dimension.  A similar change was made by Helmut Dersch to the Radial Shift correct prior to July 1999.  see "How to determine suitable Parameters:"

I modified the function correct in correct.c


   int sizesqr;
   if( TrPtr->src->width < TrPtr->src->height )
      sizesqr = (TrPtr->src->width/2.0) * (TrPtr->src->width/2.0);
   else
      sizesqr = (TrPtr->src->height/2.0) * (TrPtr->src->height/2.0);


2003/08/24

Increase the limitation for Field of View for fisheye lens from 160 to 1000 deg.
This change is not available at SourceForge.  And is not compiled into any binaries available from SourceForge.

References, Links, and Notes:




Page last modified July 16, 2006
All content is 1991-2007 All Rights Reserved.
All trademarks are property of their respective owners.