Thomas Sharpless | 15 Apr 2013 22:46
Picon

How can libpano support 3D alignment?

Hi All

I'm getting very serious about camera arrays and 3D stitching -- that is, combining images taken from multiple positions, with general parallax correction.  And I'm trying to make a version of libpano13 to support some experiments.

Given a reasonable array geometry and plenty of overlap between the cameras' fovs, it is perfectly feasible in theory to construct panoramic views on any single center, and to choose that center pretty freely.  Of course the 900 pound gorilla is that in order to correct parallax you need a depth map of the scene.  But assuming that is possible, there are several other matters that need attention.

First, defining the positions and orientations of the cameras.  With TrX, TrY, TrZ, PT  has the means to specify the positions, and with y, p, r the orientations.  The origin of these coordinates would no longer be the pano center -- we haven't chosen one yet --  so let's call it the array center.  To fix the array coordinate system it is enough to designate one camera as having all these parameters zero, (except possibly TrZ) .  Then array X, Y, Z are parallel to the reference camera's axes.

Given the array geometry we can easily compute camera directions and distances with respect to any panocenter, and any rotation of the array as a whole.  The relevant quantities for parallax correction are the direction of the optic axis and the direction and distance of the lens pupil.  With those facts and a depth map we can compute parallax-corrected image coordinates from 'ideal' pano coordinates, and thus do a parallax corrected stitch.

It has to be possible to determine these 6 parameters by optimization, because nobody can build a perfectly rigid array, and because we will surely want to support hand held "pseudo arrays".  I'm assuming this can be done using control points found in the usual way, by  assigning a depth to each control point and optimizing those along with y,p,r,TrX,TrY,TrZ. This optimization could use any hypothetical pano center, for instance the array center.

It would be pointless to try to optimize lens parameters at the same time, as lens distortion is basically indistinguishable from parallax.  So all this assumes excellent prior camera calibration.

That's as far as I want to go now.  Your thoughts, please, on how to insert a true 3D camera / control point model into libpano13's optimization scheme.

-- Tom



 
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
PanoTools-devel mailing list
PanoTools-devel@...
https://lists.sourceforge.net/lists/listinfo/panotools-devel
Kay F. Jahnke | 7 Apr 2013 11:56
Picon
Favicon

supected bug in triplane_erect()

Hi group!

I'm currently wrapping the PT transforms (yet again...), and I've 
stumbled upon strange behaviour: when I call erect_triplane on a set of 
coordinates, and afterwards call triplane_erect on the transformed 
values, the round-trip doesn't land at the initial values. (with the 
other transforms I've tried, this is the case after applying the 
transform and then the reverse transform - e.g. with biplane, which 
seems very similar).

Ignorant of the meaning of the actual parameters, I've made 
reasonable-looking ones up: I feed mp->pn->formatParamCount as 0 (to get 
the default of formatParam[0] = 45), width as 100.0, and b as 1.0 into 
triplane_distance, and then use the MakeParams struct in the actual 
transform, going over a set of a few coordinate pairs in the range of 
+/- 1.0. The values after performing erect_triplane look 'reasonable', 
but triplane_erect seems to go off somehow, producing quite large values 
on the x coordinates.

While this may be a false alert, maybe one of the panotools developers 
could take a look and/or write a quick round-trip in C (or use a pano 
tool to the same effect)? I'm using a very recent checkout of libpano 
(11:00 today), so I doubt anything has changed since that.

And, while I'm at it, is there any documentation on the parameters of 
the various transforms? Some of them take quite elaborate collections of 
values with rather unenlightening names (like, radial() takes double 
coefficients[4], scale, correction_radius... and that's all the docu I 
can find)

With regards
Kay

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
Andreas Metzler | 20 Jan 2013 12:17
X-Face

libpano13 unchecked write to fixed size buffer (LP: #1057012)

Hello,

this was reported on Ubuntu in
<https://bugs.launchpad.net/ubuntu/+source/libpano13/+bug/1057012>, I
am just forwarding, bug reported and diagnosed by Stephane Gourichon:

Running cpfind in a directory with a long path ( > 256 characters for
filename with full path) results in a bugffer overflow:

--------------
[...]
--- Find pair-wise matches ---
*** buffer overflow detected ***: cpfind terminated
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__fortify_fail+0x50)[0xf6b443c0]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0xe92fa)[0xf6b432fa]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0xe8a38)[0xf6b42a38]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(_IO_default_xsputn+0x9e)[0xf6ac947e]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(_IO_vfprintf+0x478a)[0xf6a9e1ea]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__vsprintf_chk+0xa7)[0xf6b42ae7]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(__sprintf_chk+0x2d)[0xf6b42a2d]
/usr/lib/i386-linux-gnu/libpano13.so.2(ParseScript+0x846)[0xf6d1e536]
[...]
--------------

--------------
# Summary

* found the actual bug location, in libpano13.
* bug class : unchecked write to fixed size buffer (buffers have hardcoded size)
* hard-coded limits are inconsistent between files (source buffer 65536, destination buffer 256)
* easy to fix ? There is at least the quick-and-easy by increasing lower limit.

## Additional information

It's in libpano13, file panorama.h, line 413 :

#define PANO_PATH_LEN 255

In a nutshell, ParseScript can parse lines up to 65535 characters long, but Image structure only accepts
full paths up to 256 characters long.

## Investigation details

crash log says :
/lib/x86_64-linux-gnu/libc.so.6(__sprintf_chk+0x7d)[0x2b29d619b22d]
/usr/lib/libpano13.so.2(ParseScript+0x7f6)[0x2b29d51fe536]

ParseScript is therefore a function in libpano13.
apt-get source libpano13
cd libpano13-2.9.18+dfsg/

ParseScript is defined in parser.c.
It calls sprintf on line 448

                    case 'n': // Set filename
                        nextWord( buf, &li );
                        sprintf( im->name, "%s", buf );
                        break;
                    case 'm': // Frame

buf is defined on line 148:

    char *li, line[LINE_LENGTH], *ch ,*lineStart, buf[LINE_LENGTH];

buf is big enough to hold a long filename :

//Increased so more params can be parsed/optimized (MRDL - March 2002)
#define LINE_LENGTH 65536

Now check im->name.

In ParseScript, im is defined on line 142:

Image *im;

Image type is defined in panorama.h on line 430-355:

struct Image
{
    // Pixel data
    pt_int32 width;
    pt_int32 height;
    pt_int32 bytesPerLine;
    pt_int32 bitsPerPixel; // Must be 24 or 32
    size_t dataSize;
    unsigned char **data;
    pt_int32 dataformat; // rgb, Lab etc
    pt_int32 format; // Projection: rectilinear etc
    int formatParamCount; // Number of format parameters.
    double formatParam[PANO_PROJECTION_MAX_PARMS]; // Parameters for format.
    int precomputedCount; // number of values precomputed for a given pano
    double precomputedValue[PANO_PROJECTION_PRECOMPUTED_VALUES]; // to speed up pano creation
    double hfov;
    double yaw;
    double pitch;
    double roll;
    cPrefs cP; // How to correct the image
    char name[PANO_PATH_LEN+1];
    PTRect selection;
    CropInfo cropInformation; // TO BE DEPRECATED

    pano_ImageMetadata metadata;
};

typedef struct Image Image;

field "name" is on line 455:

    char name[PANO_PATH_LEN+1];

PANO_PATH_LEN is defined on panorama.h, line 413:

#define PANO_PATH_LEN 255

Crash is explained.
--------------

cu Andreas

--

-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
info percept | 17 Jan 2013 09:36

Try to compile hugin on mac lion mountain

After typing cmake ../hugin-2012.0.0 on my Terminal, I get : 

[...]

-- WARNING: you are using the obsolete 'PKGCONFIG' macro, use FindPkgConfig

[...]

-- libpano13 version: 2.9.18 major 2 minor 9 patch 18

[...]

-- ZThread library not found. falling back to included copy

-- flann library not found. falling back to included copy

-- Found Lensfun: /opt/local/include

*** Will install application bundles in /usr/local/Applications, set INSTALL_OSX_BUNDLE_DIR to change the location

-- Using shared internal libraries

-- Python libs version: 2.7.2

-- Install Python libs into /Library/Python/2.7/site-packages

-- Current source dir = /Users/[username]/hugin

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/[username]/hugin-2012.0.0


I don't know how to set INSTALL_OSX_BUNDLE_DIR, how to install flann-1.8.3 and how to install Python libs into /Library/Python/2.7/site-packages (what package with easy_install ?). When I compile ZThread-2.3.2, after make instruction, I get :


[…]

make[3]: *** [AtomicCount.lo] Error 1

make[2]: *** [all-recursive] Error 1

make[1]: *** [all] Error 2

make: *** [all-recursive] Error 1


After the make instruction, in hugin-2012.0.0, I get an error concerning hugin-2012.0.0/src/foreign/zthread/include/zthread/Guard.h. I solved the problem by defining the function createScope as a static bool instead of a static void function. Nonetheless I still have errors after the make instruction and I actually get :

[…]


make[2]: *** [src/tools/CMakeFiles/hugin_hdrmerge.dir/hugin_hdrmerge.cpp.o] Error 1

make[1]: *** [src/tools/CMakeFiles/hugin_hdrmerge.dir/all] Error 2

make: *** [all] Error 2


Thanks a lot for your help.


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
PanoTools-devel mailing list
PanoTools-devel@...
https://lists.sourceforge.net/lists/listinfo/panotools-devel
Toprak | 27 Nov 2012 10:44
Picon
Favicon

Here is a working link to Helmut Dersch Homepag...

Ahoi Boys and Girls,

The link to Mr. Dersch's website is broken (on panotools.sourceforge.net).
Here is the working one:
http://webuser.hs-furtwangen.de/~dersch/

Kind regards,
Toprak

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Thomas Sharpless | 3 Nov 2012 23:27
Picon

Re: Need PanoTools panoCreatePanorama Help- Panoramas Generated Only Contain Last Image

Hmmm.  Same here.  With scripts generated by the current PtGui (9.1.5) both PTmender and the original PTStitcher produce 'layer' files but do not blend them into a panorama.  However I am sure they both can.  I am not a PT script expert so I can't spot the problem.  I'm copying this to a real expert (Bruno). Let's see what he says.


-- Tom


On Fri, Nov 2, 2012 at 10:48 PM, Nkosi Dean <nko12 <at> comcast.net> wrote:

Looking at the command line for PTMender, I do not see any option to get it to blend the images together like I thought it was supposed to. I can’t do anything with the script options because those are generated by PTGui, which correctly outputs the panorama when I have it create it. But I need either my program or PTMender to do that, and PTMender does not appear to have the ability to blend the images. How can I use my script file to generate a blended panorama, since PTMender doesn’t seem to have this ability.

 

 

Also, here is my script file in case this is of any use.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

# script file for ptStitcher created by ptGui

 

p w2418 h1249 f0 v103 u20 n"JPEG g0 q100"

m g1 i0 f0

i n"ImageSave 1.jpg" w1296 h962 f0 y-33.70353260222235 r2.9921 p0.2775035026319206 v63.62965753363729 a0 b0 c0 d0 e0 g0 t0

o n"ImageSave 1.jpg" w1296 h962 f0 y-33.70353260222235 r2.9921 p0.2775035026319206 v63.62965753363729 a0 b0 c0 d0 e0 g0 t0

i n"ImageSave 2.jpg" w1296 h962 f0 y-0.5014896503082921 r1.3014 p-0.5391411047778966 v63.62965753363729 a0 b0 c0 d0 e0 g0 t0

o n"ImageSave 2.jpg" w1296 h962 f0 y-0.5014896503082921 r1.3014 p-0.5391411047778966 v63.62965753363729 a0 b0 c0 d0 e0 g0 t0

i n"ImageSave 3.jpg" w1296 h962 f0 y27.40126406201642 r10.41278266367476 p-2.864858562827357 v63.62965753363729 a0 b0 c0 d0 e0 g0 t0

o n"ImageSave 3.jpg" w1296 h962 f0 y27.40126406201642 r10.41278266367476 p-2.864858562827357 v63.62965753363729 a0 b0 c0 d0 e0 g0 t0

i n"ImageSave 4.jpg" w1296 h962 f0 y58.66342194005436 r15.5259534530212 p-10.09557633508655 v63.62965753363729 a0 b0 c0 d0 e0 g0 t0

o n"ImageSave 4.jpg" w1296 h962 f0 y58.66342194005436 r15.5259534530212 p-10.09557633508655 v63.62965753363729 a0 b0 c0 d0 e0 g0 t0

 

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

 

From: Thomas Sharpless [mailto:tksharpless-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
Sent: Friday, November 2, 2012 5:06 PM
To: Nkosi Dean


Subject: Re: [PanoTools-devel] Need PanoTools panoCreatePanorama Help- Panoramas Generated Only Contain Last Image

 

Nkosi, this is one of the many things ptmender is designed to do (output each warped image, with mask, as a separate file, so you can blend them with Photoshop or enblend, for example).  But it can also blend them into a single pano, you just have to ask it right.  Look up the ptmender (or ptStitcher, they are equivalent) command line and script file options in the Wiki, and try again.  -- Tom

 

 

 

On Fri, Nov 2, 2012 at 3:19 PM, Nkosi Dean <nko12-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote:

I tried using PTMender directly with the following command line prompt:

 

PTmender  Panorama_Four_v1.0.txt "ImageSave 1.tiff" "ImageSave 2.tiff" "ImageSave 3.tiff" "ImageSave 4.tiff"

 

Where Panorama_Four_v1.0.txt is the script file and the ImageSave n.tiff are the image files for the script. What PTMender does is create 4 files which contain each separate image that it was supposed to stitch together into one panorama photo, and each image is in the position it is supposed to be in the full panorama.

 

Here is what PTMender actually put out.

 

 

 

Here is an example of what PTMender did changing ImageSave 1.tiff to panoTest0000.tif

 

 

So using PTMender does not appear to work either. What am I doing wrong?

From: Thomas Sharpless [mailto:tksharpless-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
Sent: Friday, November 2, 2012 10:13 AM
To: Nkosi Dean
Cc: Panotools developers
Subject: Re: [PanoTools-devel] Need PanoTools panoCreatePanorama Help- Panoramas Generated Only Contain Last Image

 

Hi Nkosi

 

I agree with Dan German, you will  be much better off to use the Panotools programs rather than try to build an app directly on libpano.  There is no way we could teach you how to do that,  indeed I for one could not build such an app today.  But  the PanoTools command line programs are very capable of doing anything you might want -- that is what they were made for.   Using a language such as Perl or Python to generate control scripts and call the PT progtrams, I would think you could reach your goal.  The PanoTools Wiki has some information on this, and Bruno Postle's collection of Perl scripts has many excellent examples of using PanoTools for all kinds of purposes -- highly receommended.

 

Good Luck,

-- Tom

 

On Fri, Nov 2, 2012 at 12:52 AM, Nkosi Dean <nko12-Wuw85uim5zDR7s880joybQ@public.gmane.org> wrote:

I need some serious help with the PanoTools library pano13.dll. I am a high school student in an internship trying to do some camera work (I know nothing about cameras by the way). I have compiled the pano13.dll library and am using it in a C++ project so that I can generate panoramas with it using a provided list of images a client program will provide to it. I am having a problem where the function called panoCreatePanorama in the pano13.dll file does not appear to be working properly. I use the program PTGui to create the PTMender/PTStitcher script file so that I can use the PanoTools library to stitch together images generated by the camera assembly into a panorama. However, whenever I plug in the image paths, script name and output file name into the panoCreatePanorama function, it appears to work as the function returns 0 but generates a panorama that is missing all images except the last image. How can I fix this?

 

Sent from my Verizon Wireless 4G LTE DROID


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
PanoTools-devel mailing list
PanoTools-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/panotools-devel

 

 


------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
PanoTools-devel mailing list
PanoTools-devel@...
https://lists.sourceforge.net/lists/listinfo/panotools-devel
D M German | 2 Nov 2012 21:03
Picon
Picon
Favicon

Re: Need PanoTools panoCreatePanorama Help- Panoramas Generated Only Contain Last Image


then show us your scripts the input images and the results. We can then
help.

-d-mg

 Nkosi> The same thing happens when I use PTMender itself.
 Nkosi> Sent from my Verizon Wireless 4G LTE DROID

 Nkosi> dmg <dmg@...> wrote:

 >> Why not just run ptmender or nona instead of creating your own program?
 >> 
 >> On Thu, Nov 1, 2012 at 9:52 PM, Nkosi Dean <nko12@...> wrote:
 >>> I need some serious help with the PanoTools library pano13.dll. I am a high
 >>> school student in an internship trying to do some camera work (I know
 >>> nothing about cameras by the way). I have compiled the pano13.dll library
 >>> and am using it in a C++ project so that I can generate panoramas with it
 >>> using a provided list of images a client program will provide to it. I am
 >>> having a problem where the function called panoCreatePanorama in the
 >>> pano13.dll file does not appear to be working properly. I use the program
 >>> PTGui to create the PTMender/PTStitcher script file so that I can use the
 >>> PanoTools library to stitch together images generated by the camera assembly
 >>> into a panorama. However, whenever I plug in the image paths, script name
 >>> and output file name into the panoCreatePanorama function, it appears to
 >>> work as the function returns 0 but generates a panorama that is missing all
 >>> images except the last image. How can I fix this?
 >>> 
 >>> Sent from my Verizon Wireless 4G LTE DROID
 >>> 
 >>> ------------------------------------------------------------------------------
 >>> LogMeIn Central: Instant, anywhere, Remote PC access and management.
 >>> Stay in control, update software, and manage PCs from one command center
 >>> Diagnose problems and improve visibility into emerging IT issues
 >>> Automate, monitor and manage. Do more in less time with Central
 >>> http://p.sf.net/sfu/logmein12331_d2d
 >>> _______________________________________________
 >>> PanoTools-devel mailing list
 >>> PanoTools-devel@...
 >>> https://lists.sourceforge.net/lists/listinfo/panotools-devel
 >>> 
 >> 
 >> 
 >> 
 >> -- 
 >> --dmg
 >> 
 >> ---
 >> Daniel M. German
 >> http://turingmachine.org

--

-- 
--
Daniel M. German                  
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with  <at>  and (dot) with .

------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
Nkosi Dean | 2 Nov 2012 05:52
Picon

Need PanoTools panoCreatePanorama Help- Panoramas Generated Only Contain Last Image

I need some serious help with the PanoTools library pano13.dll. I am a high school student in an internship trying to do some camera work (I know nothing about cameras by the way). I have compiled the pano13.dll library and am using it in a C++ project so that I can generate panoramas with it using a provided list of images a client program will provide to it. I am having a problem where the function called panoCreatePanorama in the pano13.dll file does not appear to be working properly. I use the program PTGui to create the PTMender/PTStitcher script file so that I can use the PanoTools library to stitch together images generated by the camera assembly into a panorama. However, whenever I plug in the image paths, script name and output file name into the panoCreatePanorama function, it appears to work as the function returns 0 but generates a panorama that is missing all images except the last image. How can I fix this?

Sent from my Verizon Wireless 4G LTE DROID
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
PanoTools-devel mailing list
PanoTools-devel@...
https://lists.sourceforge.net/lists/listinfo/panotools-devel
Bruno Postle | 17 Sep 2012 23:51
X-Face

Re: [panotools-cvs] SF.net SVN: panotools:[1349] trunk/libpano/adjust.c

On Mon 17-Sep-2012 at 11:13 +0200, Kornel Benko wrote:
>Am Sonntag, 16. September 2012 um 21:37:30, schrieb brunopostle@...
>> Revision: 1349
>>           http://panotools.svn.sourceforge.net/panotools/?rev=1349&view=rev

>What happened here? I am totally confused about use of subversion.
>Until now, I thought we would use mercurial for this project. Could please
>some kind soul enlighten me?

It was me that was totally confused, yes I should have committed to 
HG not SVN.

--

-- 
Bruno

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Philippe Le Roux | 20 Apr 2012 19:06
Picon

C++ panorama code sample

Hi,

I'am looking for c++ code sample running under Linux.
At the moment, I didn't fine yet any code sample that really works....
Thanks,

Pierre
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
PanoTools-devel mailing list
PanoTools-devel@...
https://lists.sourceforge.net/lists/listinfo/panotools-devel
D M German | 5 Mar 2012 20:07
Picon
Picon
Favicon

Re: [panotools-cvs] /hgroot/panotools/libpano: merged PSD branch


Hi everybody,

Last week I was completely without an Internet connection.  I am glad
you decided to merge the branch. I suspect (almost) nobody bothered to
check it out.

I compiled under ubuntu 11.10 and it passed the tests. We will have to
wait and see what people thing.

I suspect not many people know that we can convert to PSD from tiff.

by the way, people should be warned that the algorithm used for it is
O(n^2) in terms of I/O. Reaaaaallly slow for multiple layers with big
images.

--dmg

 panotools-cvs> branch:     
 panotools-cvs> details:    http://panotools.hg.sourceforge.net/hgweb/panotools/panotools/hgroot/panotools/libpano/rev/0c73d8794377
 panotools-cvs> changeset:  761:0c73d8794377
 panotools-cvs> user:       Bruno Postle <bruno <at> postle.net>
 panotools-cvs> date:       Fri Mar 02 23:19:11 2012 +0000
 panotools-cvs> description:

 panotools-cvs> merged PSD branch

 panotools-cvs> diffstat:

 CMakeLists.txt                                                     |     1 +
 LocalDefs.props                                                    |    15 +
 PTcommon.c                                                         |   375 +-
 PTcommon.h                                                         |     4 +
 ZComb.c                                                            |    18 +-
 adjust.c                                                           |    38 +-
 correct.c                                                          |     6 +-
 file.c                                                             |  2338 +++++----
 file.h                                                             |     2 +
 filter.c                                                           |   112 +-
 filter.h                                                           |    97 +-
 libpano.sln                                                        |    61 +-
 libpano.vcxproj                                                    |   533 ++
 pano13vc.def                                                       |     2 +
 png.c                                                              |    12 +-
 pteditor.c                                                         |     6 +-
 resample.c                                                         |     4 +-
 sys_ansi.c                                                         |    16 +
 sys_compat.h                                                       |    30 +
 sys_win.c                                                          |    55 +
 tests/CMakeLists.txt                                               |    10 +
 tests/panoAutomatePSDtest.pl                                       |    31 +
 tests/simpleTiff2psd/CMakeLists.txt                                |    28 +
 tests/simpleTiff2psd/reference/simpleStitch_crop_1_layer.psd       |     0 
 tests/simpleTiff2psd/reference/simpleStitch_crop_2_layer.psd       |     0 
 tests/simpleTiff2psd/reference/simpleStitch_uncrop_1_layer.psd     |     0 
 tests/simpleTiff2psd/reference/simpleStitch_uncrop_2_layer.psd     |     0 
 tests/simpleTiff2psd/reference/simpleTiff16-16-_uncrop_1_layer.psd |     0 
 tests/simpleTiff2psd/reference/simpleTiff16-16-_uncrop_2_layer.psd |     0 
 tests/simpleTiff2psd/tests/simpleStitch_crop_1_layer.psd           |     0 
 tests/simpleTiff2psd/tests/simpleStitch_crop_2_layer.psd           |     0 
 tests/simpleTiff2psd/tests/simpleStitch_uncrop_1_layer.psd         |     0 
 tests/simpleTiff2psd/tests/simpleStitch_uncrop_2_layer.psd         |     0 
 tests/simpleTiff2psd/tests/simpleTiff16-16-_uncrop_1_layer.psd     |     0 
 tests/simpleTiff2psd/tests/simpleTiff16-16-_uncrop_2_layer.psd     |     0 
 tests/tiff2psdTest.bat                                             |     9 +
 tiff.c                                                             |    36 +-
 tools/PTAInterpolate.vcxproj                                       |   233 +
 tools/PTOptimizer.vcxproj                                          |   249 +
 tools/PTblender.vcxproj                                            |   234 +
 tools/PTcrop.vcxproj                                               |   233 +
 tools/PTinfo.vcxproj                                               |   233 +
 tools/PTmasker.vcxproj                                             |   233 +
 tools/PTmender.vcxproj                                             |   233 +
 tools/PTroller.vcxproj                                             |   233 +
 tools/PTtiff2psd.c                                                 |    19 +-
 tools/PTtiff2psd.vcxproj                                           |   233 +
 tools/PTtiffdump.vcxproj                                           |   233 +
 tools/PTuncrop.vcxproj                                             |   233 +
 49 files changed, 5134 insertions(+), 1304 deletions(-)

 panotools-cvs> diffs (truncated from 8602 to 500 lines):

 panotools-cvs> diff -r 20a9b820aba0 -r 0c73d8794377 CMakeLists.txt
 panotools-cvs> --- a/CMakeLists.txt	Wed Jan 11 10:27:02 2012 +1100
 panotools-cvs> +++ b/CMakeLists.txt	Fri Mar 02 23:19:11 2012 +0000
 panotools-cvs>  <at>  <at>  -173,6 +173,7  <at>  <at> 
 	f2c.h
 	fftn.h
 	rgbe.h
 panotools-cvs> +        sys_compat.h
 	sys_ansi.h
 	sys_win.h
 	ZComb.h
 panotools-cvs> diff -r 20a9b820aba0 -r 0c73d8794377 LocalDefs.props
 panotools-cvs> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 panotools-cvs> +++ b/LocalDefs.props	Fri Mar 02 23:19:11 2012 +0000
 panotools-cvs>  <at>  <at>  -0,0 +1,15  <at>  <at> 
 panotools-cvs> +<?xml version="1.0" encoding="utf-8"?>
 panotools-cvs> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 panotools-cvs> +  <PropertyGroup Label="UserMacros">
 panotools-cvs> +    <WXWIDGETS_HOME>D:\source\wxWidgets-2.8.10</WXWIDGETS_HOME>
 panotools-cvs> +  </PropertyGroup>
 panotools-cvs> +  <PropertyGroup>
 panotools-cvs> +    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
 panotools-cvs> +  </PropertyGroup>
 panotools-cvs> +  <ItemGroup>
 panotools-cvs> +    <BuildMacro Include="WXWIDGETS_HOME">
 panotools-cvs> +      <Value>$(WXWIDGETS_HOME)</Value>
 panotools-cvs> +      <EnvironmentVariable>true</EnvironmentVariable>
 panotools-cvs> +    </BuildMacro>
 panotools-cvs> +  </ItemGroup>
 panotools-cvs> +</Project>
 panotools-cvs> \ No newline at end of file
 panotools-cvs> diff -r 20a9b820aba0 -r 0c73d8794377 PTcommon.c
 panotools-cvs> --- a/PTcommon.c	Wed Jan 11 10:27:02 2012 +1100
 panotools-cvs> +++ b/PTcommon.c	Fri Mar 02 23:19:11 2012 +0000
 panotools-cvs>  <at>  <at>  -56,7 +56,7  <at>  <at> 

 
 // Uncomment following line to enable testing of inverses in getROI
 panotools-cvs> -#define PANO_TEST_INVERSE
 panotools-cvs> +//#define PANO_TEST_INVERSE

 
 int panoFlattenTIFF(fullPath * fullPathImages, int counterImageFiles,
 panotools-cvs>  <at>  <at>  -89,6 +89,8  <at>  <at> 
     fullPath tempFile;
     char tempString[128];
     Image image;
 panotools-cvs> +    Boolean bBig = FALSE;
 panotools-cvs> +

     assert(numberImages > 0);
     assert(fullPathImages != NULL);
 panotools-cvs>  <at>  <at>  -112,6 +114,9  <at>  <at> 
         return -1;
     }

 panotools-cvs> +    // Check to see if we need to create PSB instead of PSD file
 panotools-cvs> +    if(image.height > 30000 || image.width > 30000 || flatteningParms->forceBig == 1)
 panotools-cvs> +      bBig = TRUE;

     if (!(image.bitsPerPixel == 64 || image.bitsPerPixel == 32)) {
         PrintError("Image type not supported (%d bits per pixel)\n",
 panotools-cvs>  <at>  <at>  -119,29 +124,33  <at>  <at> 
         return -1;
     }

 panotools-cvs> +    // New versions of Photoshop can handle multilayer 16bit files
 panotools-cvs> +    // Add an option to down sample to 8bit only if user request
     if (numberImages > 1 && image.bitsPerPixel != 32) {
 panotools-cvs> -        if (image.bitsPerPixel == 64) {
 panotools-cvs> -            PrintError
 panotools-cvs> -                ("Panotools is not able to save 16bit PSD images. Downsampling to 8 bit");
 panotools-cvs> +        if (image.bitsPerPixel == 64 && flatteningParms->force8bit == 1) {
 panotools-cvs> +            //PrintError
 panotools-cvs> +            //    ("Panotools is not able to save 16bit PSD images. Downsampling to 8 bit");
             TwoToOneByte(&image);       //we need to downsample to 8 bit if we are provided 16 bit images
         }
     }

     if (numberImages == 1) {
 panotools-cvs> -	if (writePSD(&image, outputFileName) != 0) {
 panotools-cvs> -	    PrintError("Could not write PSD-file");
 panotools-cvs> -	    if (ptQuietFlag != 0)
 panotools-cvs> -		Progress(_disposeProgress, tempString);
 panotools-cvs> -	    return -1;
 panotools-cvs> -	}
 panotools-cvs> -	return 0;
 panotools-cvs> +        if (writePS(&image, outputFileName, bBig) != 0) {
 panotools-cvs> +            PrintError("Could not write PSD-file");
 panotools-cvs> +            if (ptQuietFlag != 0)
 panotools-cvs> +            Progress(_disposeProgress, tempString);
 panotools-cvs> +            return -1;
 panotools-cvs> +        }
 panotools-cvs> +        return 0;
     }

     //////////////////////////////////////////////////////////////////////
 panotools-cvs> +    //current algorithm is O(n2) which means it will take _forever_ to  create 
 panotools-cvs> +    // a huge Photoshop files with many layers.

     //Write out the first image as the base layer in the PSD file

 panotools-cvs> -    if (writePSDwithLayer(&image, outputFileName) != 0) {
 panotools-cvs> +    if (writePSwithLayer(&image, outputFileName,bBig) != 0) {
         PrintError("Could not write PSD-file");
         if (ptQuietFlag != 0)
             Progress(_disposeProgress, tempString);
 panotools-cvs>  <at>  <at>  -171,7 +180,7  <at>  <at> 
         }

         // We can't process 16 bit TIFFs. We have to downsample to 8 bit if necessary
 panotools-cvs> -        if (image.bitsPerPixel == 64)
 panotools-cvs> +        if (image.bitsPerPixel == 64 && flatteningParms->force8bit == 1)
             TwoToOneByte(ptrImage);

         // Create a new file with the result PSD, then delete the current one
 panotools-cvs>  <at>  <at>  -190,10 +199,10  <at>  <at> 
           stitchInfo.psdOpacity = (unsigned char) (255.0/ (i + 1));
         else
           stitchInfo.psdOpacity = 255;
 panotools-cvs> -	stitchInfo.psdBlendingMode = flatteningParms->psdBlendingMode;

 panotools-cvs> -        if (addLayerToFile(ptrImage, outputFileName, &tempFile, &stitchInfo)
 panotools-cvs> -            != 0) {
 panotools-cvs> +        stitchInfo.psdBlendingMode = flatteningParms->psdBlendingMode;
 panotools-cvs> +
 panotools-cvs> +        if (addLayerToFile(ptrImage, outputFileName, &tempFile, &stitchInfo) != 0) {
             PrintError("Could not write Panorama File");
             return -1;
         }
 panotools-cvs>  <at>  <at>  -201,7 +210,7  <at>  <at> 
         remove(outputFileName->name);
         rename(tempFile.name, outputFileName->name);

 panotools-cvs> -	panoImageDispose(ptrImage);
 panotools-cvs> +        panoImageDispose(ptrImage);
     }

     if (!ptQuietFlag) {
 panotools-cvs>  <at>  <at>  -300,7 +309,6  <at>  <at> 

     if (right == 0)
         right = image->width;
 panotools-cvs> -    

     if (image->bitsPerPixel == 32) {
         bytesPerPixel = 4;
 panotools-cvs>  <at>  <at>  -309,81 +317,80  <at>  <at> 
         bytesPerPixel = 8;
     }
     else {
 panotools-cvs> -	PrintError("Invalid bits per pixel in image %d", image->bitsPerPixel);
 panotools-cvs> +        PrintError("Invalid bits per pixel in image %d", image->bitsPerPixel);
         exit(1);
     }

 
     if (image->format == _fisheye_circ || image->format == _thoby) {

 panotools-cvs> +        // TODO
 panotools-cvs> +        // This routine works only in fisheyes in portrait mode
 panotools-cvs> +        // it probably fails in landscape mode
 panotools-cvs> +    
 panotools-cvs> +        int horCenter, verCenter;
 panotools-cvs> +        int horRadious;
 panotools-cvs> +        int horRadious2;

 panotools-cvs> -	// TODO
 panotools-cvs> -	// This routine works only in fisheyes in portrait mode
 panotools-cvs> -	// it probably fails in landscape mode
 panotools-cvs> -	
 panotools-cvs> -	int horCenter, verCenter;
 panotools-cvs> -	int horRadious;
 panotools-cvs> -	int horRadious2;
 panotools-cvs> +        horCenter = (left + right) / 2;
 panotools-cvs> +        verCenter = (top + bottom) / 2;

 panotools-cvs> -	horCenter = (left + right) / 2;
 panotools-cvs> -	verCenter = (top + bottom) / 2;
 panotools-cvs> -	
 panotools-cvs> -	// Compute the horizontal width divided by 2, 
 panotools-cvs> -	// let us call it horizontal radios
 panotools-cvs> +        // Compute the horizontal width divided by 2, 
 panotools-cvs> +        // let us call it horizontal radios

 panotools-cvs> -	horRadious = (right - left) / 2;
 panotools-cvs> -	// Square it, so we don't have to compute this 
 panotools-cvs> -	// every time
 panotools-cvs> -	horRadious2 = horRadious * horRadious;
 panotools-cvs> -	
 panotools-cvs> -	dataPtr = *(image->data);
 panotools-cvs> -	
 panotools-cvs> -	// Scan the image from top to bottom
 panotools-cvs> -	for (currentRow = 0; currentRow < image->height; currentRow++) {
 panotools-cvs> -	    int verDistance;
 panotools-cvs> -	    int verDistance2;
 panotools-cvs> +        horRadious = (right - left) / 2;
 panotools-cvs> +        // Square it, so we don't have to compute this 
 panotools-cvs> +        // every time
 panotools-cvs> +        horRadious2 = horRadious * horRadious;

 panotools-cvs> -	    // The algorith it simple. Find the distance of each from from the 
 panotools-cvs> -	    // center of the image. If the point is farther than horRadious
 panotools-cvs> -	    // then set mask to zero
 panotools-cvs> -	    
 panotools-cvs> -	    currentColumn = 0;
 panotools-cvs> -	    pixelPtr = dataPtr;
 panotools-cvs> -	    
 panotools-cvs> -	    // Compute the square of the vertical distance to this row from center
 panotools-cvs> -	    verDistance = (currentRow - verCenter);
 panotools-cvs> -	    verDistance2 = verDistance * verDistance;
 panotools-cvs> -	    
 panotools-cvs> -	    for (currentColumn = 0; currentColumn < image->width; currentColumn ++) {
 panotools-cvs> -		int horDistance;
 panotools-cvs> -		int horDistance2;
 panotools-cvs> +        dataPtr = *(image->data);

 panotools-cvs> -		// Compute square of distance of this point to center 
 panotools-cvs> -		// the old Pythagoras way
 panotools-cvs> -		// distance^2 = horDistance^2  + verDistance^2
 panotools-cvs> -		
 panotools-cvs> -		horDistance = (currentColumn - horCenter);
 panotools-cvs> -		horDistance2 = horDistance * horDistance;
 panotools-cvs> -		
 panotools-cvs> -		if (horDistance2 + verDistance2 > horRadious2) {
 panotools-cvs> +        // Scan the image from top to bottom
 panotools-cvs> +        for (currentRow = 0; currentRow < image->height; currentRow++) {
 panotools-cvs> +            int verDistance;
 panotools-cvs> +            int verDistance2;

 panotools-cvs> -		    // Point falls outside the circle defined its horizontal maximum distance
 panotools-cvs> +            // The algorith it simple. Find the distance of each from from the 
 panotools-cvs> +            // center of the image. If the point is farther than horRadious
 panotools-cvs> +            // then set mask to zero

 panotools-cvs> -		    // Set mask to zero
 panotools-cvs> -		    if (bytesPerPixel == 4)
 panotools-cvs> -			*pixelPtr = 0;     
 panotools-cvs> -		    else if (bytesPerPixel == 8) {
 panotools-cvs> -			*pixelPtr = 0;     
 panotools-cvs> -			*(pixelPtr+1) = 0;     
 panotools-cvs> -		    }
 panotools-cvs> -			
 panotools-cvs> -		}
 panotools-cvs> -		pixelPtr +=  bytesPerPixel;
 panotools-cvs> +            currentColumn = 0;
 panotools-cvs> +            pixelPtr = dataPtr;

 panotools-cvs> -	    } // for column
 panotools-cvs> -	    dataPtr += image->bytesPerLine;
 panotools-cvs> -	}  // for row
 panotools-cvs> -	return;
 panotools-cvs> +            // Compute the square of the vertical distance to this row from center
 panotools-cvs> +            verDistance = (currentRow - verCenter);
 panotools-cvs> +            verDistance2 = verDistance * verDistance;
 panotools-cvs> +
 panotools-cvs> +            for (currentColumn = 0; currentColumn < image->width; currentColumn ++) {
 panotools-cvs> +                int horDistance;
 panotools-cvs> +                int horDistance2;
 panotools-cvs> +
 panotools-cvs> +                // Compute square of distance of this point to center 
 panotools-cvs> +                // the old Pythagoras way
 panotools-cvs> +                // distance^2 = horDistance^2  + verDistance^2
 panotools-cvs> +
 panotools-cvs> +                horDistance = (currentColumn - horCenter);
 panotools-cvs> +                horDistance2 = horDistance * horDistance;
 panotools-cvs> +
 panotools-cvs> +                if (horDistance2 + verDistance2 > horRadious2) {
 panotools-cvs> +
 panotools-cvs> +                    // Point falls outside the circle defined its horizontal maximum distance
 panotools-cvs> +
 panotools-cvs> +                    // Set mask to zero
 panotools-cvs> +                    if (bytesPerPixel == 4)
 panotools-cvs> +                        *pixelPtr = 0;     
 panotools-cvs> +                    else if (bytesPerPixel == 8) {
 panotools-cvs> +                        *pixelPtr = 0;     
 panotools-cvs> +                        *(pixelPtr+1) = 0;     
 panotools-cvs> +                    }
 panotools-cvs> +
 panotools-cvs> +                }
 panotools-cvs> +                pixelPtr +=  bytesPerPixel;
 panotools-cvs> +
 panotools-cvs> +            } // for column
 panotools-cvs> +            dataPtr += image->bytesPerLine;
 panotools-cvs> +        }  // for row
 panotools-cvs> +        return;
     }

 
 panotools-cvs>  <at>  <at>  -476,7 +483,7  <at>  <at> 
     int x, y, x_jump;
     double x_d, y_d;            // Cartesian Coordinates of point in source (i.e. input) image
     double Dx, Dy;              // Coordinates of corresponding point in destination (i.e. output) image
 panotools-cvs> -    double Dx2, Dy2;              // Coordinates of corresponding point in destination (i.e. output) image
 panotools-cvs> +    double Dx2, Dy2;            // Coordinates of corresponding point in destination (i.e. output) image

     double w2 = (double) TrPtr->dest->width / 2.0 - 0.5;        //half destination image width
     double h2 = (double) TrPtr->dest->height / 2.0 - 0.5;       //half destination image height
 panotools-cvs>  <at>  <at>  -787,11 +794,11  <at>  <at> 
     // and maps the pixels in these input images into the output image(s)
     for (loopCounter = 0; loopCounter < counterImageFiles; loopCounter++) {

 panotools-cvs> -	// TODO 
 panotools-cvs> -	
 panotools-cvs> -	// the original PTstitcher logic  is strange
 panotools-cvs> +        // TODO 

 panotools-cvs> -	// It processes a lot of data more than once. This part should really be done once for all images
 panotools-cvs> +        // the original PTstitcher logic  is strange
 panotools-cvs> +
 panotools-cvs> +        // It processes a lot of data more than once. This part should really be done once for all images

 
         currentImagePtr = &image1;
 panotools-cvs>  <at>  <at>  -803,8 +810,8  <at>  <at> 
             goto mainError;
         }

 panotools-cvs> -	//	printf("*********cut frame: should be zero for S and no crop %d\n",  prefs->im.cP.cutFrame);
 panotools-cvs> -	
 panotools-cvs> +        // printf("*********cut frame: should be zero for S and no crop %d\n",  prefs->im.cP.cutFrame);
 panotools-cvs> +
         //New for PTMender...PTMender uses "cropped" TIFFs as its intermediate file 
         //format for all processing.  In contrast, PTStitcher used full-size TIFF
         //images for all intermediate processing.  PTMender can still write "uncropped" 
 panotools-cvs>  <at>  <at>  -871,7 +878,7  <at>  <at> 
         --tempString;           /* nextWord does ++ before testing anything, this guarantess proper execution */
         nextWord(output_file_format, &tempString);

 panotools-cvs> -	if (strcmp(output_file_format, "TIFF_m") == 0 ) {
 panotools-cvs> +        if (strcmp(output_file_format, "TIFF_m") == 0 ) {
             // CHeck if we are suppose to do cropped or uncropped
             croppedTIFFIntermediate = 1;
             if(strcmp(tempString, "") != 0) {
 panotools-cvs>  <at>  <at>  -894,8 +901,8  <at>  <at> 
                 croppedTIFFIntermediate = 0;
             } 
         } else {
 panotools-cvs> -	    PrintError("No support for this ouput image format (%s). Output will be TIFF_m", output_file_format);
 panotools-cvs> -	}
 panotools-cvs> +            PrintError("No support for this ouput image format (%s). Output will be TIFF_m", output_file_format);
 panotools-cvs> +        }
         // enable this to avoid cropped tiffs. usually for testing
         //croppedTIFFIntermediate = 0;

 panotools-cvs>  <at>  <at>  -919,14 +926,14  <at>  <at> 
             goto mainError;
         }

 panotools-cvs> -	// printf("Ended reading INPUT image\n");
 panotools-cvs> +        // printf("Ended reading INPUT image\n");

         //This "masks" the input image so that some pixels are excluded from 
         //transformation routine during pixel remapping/interpolation 
 panotools-cvs> -	
 panotools-cvs> +
         if (prefs->im.cP.cutFrame != 0) {       // remove frame? 0 - no; 1 - yes
 panotools-cvs> -	    // THIS CODE is executed in crop C type only, but not in S type
 panotools-cvs> -	    //	    printf("To crop image\n");
 panotools-cvs> +            // THIS CODE is executed in crop C type only, but not in S type
 panotools-cvs> +            //    printf("To crop image\n");
             if (CropImage(currentImagePtr, &(prefs->im.selection)) == 0) {
                 prefs->im.selection.left = 0;
                 prefs->im.selection.right = 0;
 panotools-cvs>  <at>  <at>  -977,9 +984,9  <at>  <at> 
         panoMetadataResetSize(&metadata,
                               resultPanorama.width,
                               resultPanorama.height);
 panotools-cvs> -        
 panotools-cvs> -	metadata.imageNumber = loopCounter;
 panotools-cvs> -	metadata.imageTotalNumber = counterImageFiles;
 panotools-cvs> +
 panotools-cvs> +        metadata.imageNumber = loopCounter;
 panotools-cvs> +        metadata.imageTotalNumber = counterImageFiles;
         metadata.imageDescription = strdup(regScript);

 
 panotools-cvs>  <at>  <at>  -1018,9 +1025,9  <at>  <at> 
         resultPanorama.bytesPerLine = metadata.bytesPerLine;

         panoMetadataCopy(&resultPanorama.metadata, &metadata);
 panotools-cvs> -        
 panotools-cvs> +
         panoMetadataFree(&metadata);
 panotools-cvs> -        
 panotools-cvs> +
         //////End of set metadata

 
 panotools-cvs>  <at>  <at>  -1099,12 +1106,12  <at>  <at> 
         image1.selection.left = prefs->im.selection.left;
         image1.selection.right = prefs->im.selection.right;

 panotools-cvs> -	/*
 panotools-cvs> -	printf("****** Image selection hfov %f, %d %d %d %d \n", image1.hfov, image1.selection.top,
 panotools-cvs> -	       image1.selection.bottom,
 panotools-cvs> -	       image1.selection.left,
 panotools-cvs> -	       image1.selection.right);
 panotools-cvs> -	*/
 panotools-cvs> +    /*
 panotools-cvs> +        printf("****** Image selection hfov %f, %d %d %d %d \n", image1.hfov, image1.selection.top,
 panotools-cvs> +               image1.selection.bottom,
 panotools-cvs> +               image1.selection.left,
 panotools-cvs> +               image1.selection.right);
 panotools-cvs> +    */

         CopyPosition(&resultPanorama, &(prefs->pano));

 panotools-cvs>  <at>  <at>  -1130,14 +1137,14  <at>  <at> 

             // Call the main pixel remapping routine...all the interpolation happens here

 panotools-cvs> -	    /*
 panotools-cvs> -	    printf("Prefs: %f\n", prefs->pano.hfov);
 panotools-cvs> -	    printf("Prefs im: hvof %f, yaw %f pitch %f, roll %f\n", prefs->im.hfov,
prefs->im.yaw, prefs->im.pitch, prefs->im.roll);
 panotools-cvs> -	    printf("Prefs pano: hvof %f, vfov %f pitch %f, roll %f\n", prefs->pano.hfov,
prefs->pano.yaw, prefs->pano.pitch, prefs->pano.roll);
 panotools-cvs> -	    printf("Prefs Interpolator %d:\n", prefs->interpolator);
 panotools-cvs> -	    printf("Prefs Gamma %d:\n", prefs->gamma);
 panotools-cvs> -        printf("Prefs FastT %d:/n,  prefs->fastStep);
 panotools-cvs> -	    */
 panotools-cvs> +        /*
 panotools-cvs> +            printf("Prefs: %f\n", prefs->pano.hfov);
 panotools-cvs> +            printf("Prefs im: hvof %f, yaw %f pitch %f, roll %f\n", prefs->im.hfov, prefs->im.yaw,
prefs->im.pitch, prefs->im.roll);
 panotools-cvs> +            printf("Prefs pano: hvof %f, vfov %f pitch %f, roll %f\n", prefs->pano.hfov,
prefs->pano.yaw, prefs->pano.pitch, prefs->pano.roll);
 panotools-cvs> +            printf("Prefs Interpolator %d:\n", prefs->interpolator);
 panotools-cvs> +            printf("Prefs Gamma %d:\n", prefs->gamma);
 panotools-cvs> +            printf("Prefs FastT %d:/n,  prefs->fastStep);
 panotools-cvs> +        */

             MyMakePano(&transform, prefs, loopCounter);

 panotools-cvs>  <at>  <at>  -1200,25 +1207,25  <at>  <at> 
         }

         panoTiffClose(tiffFile);
 panotools-cvs> -	
 panotools-cvs> +
 #ifdef UNCROP_FISHEYES
 panotools-cvs> -	if (croppedTIFFIntermediate == 0) {
 panotools-cvs> -	    // We can't process (yet) all files in cropped mode
 panotools-cvs> -	    // To quite the roar from the masses let them think we
 panotools-cvs> -	    // do. I wonder how long it will take for them to notice. Placebo effect?
 panotools-cvs> -	    pano_cropping_parms croppingParms;
 panotools-cvs> -	    bzero(&croppingParms, sizeof(croppingParms));
 panotools-cvs> -	    
 panotools-cvs> -	    if (panoTiffCrop(currentFullPath.name, currentFullPath.name, &croppingParms)
== 0) {
 panotools-cvs> -		PrintError("Unable to write output file %s", currentFullPath.name);
 panotools-cvs> -		remove(tempScriptFile.name);
 panotools-cvs> -		return (-1);
 panotools-cvs> -	    }
 panotools-cvs> -	}
 panotools-cvs> +        if (croppedTIFFIntermediate == 0) {
 panotools-cvs> +            // We can't process (yet) all files in cropped mode
 panotools-cvs> +            // To quite the roar from the masses let them think we
 panotools-cvs> +            // do. I wonder how long it will take for them to notice. Placebo effect?
 panotools-cvs> +            pano_cropping_parms croppingParms;
 panotools-cvs> +            bzero(&croppingParms, sizeof(croppingParms));
 panotools-cvs> +
 panotools-cvs> +            if (panoTiffCrop(currentFullPath.name, currentFullPath.name, &croppingParms) ==
0) {
 panotools-cvs> +                PrintError("Unable to write output file %s", currentFullPath.name);
 panotools-cvs> +                remove(tempScriptFile.name);
 panotools-cvs> +                return (-1);
 panotools-cvs> +            }
 panotools-cvs> +        }
 #endif

         //////////////////////////////////////////////////////////////////////
 panotools-cvs> -	panoImageDispose(&image1);
 panotools-cvs> +        panoImageDispose(&image1);

         // The memory for td and ts was allocated in morpher.c with malloc 
         // (not myMalloc), so we need to use free (not myFree)
 panotools-cvs>  <at>  <at>  -1231,7 +1238,7  <at>  <at> 
         }
         free(prefs);

 panotools-cvs> -	panoImageDispose(&resultPanorama);
 panotools-cvs> +        panoImageDispose(&resultPanorama);

     }                           //End of main image processing loop

 panotools-cvs>  <at>  <at>  -1307,7 +1314,7  <at>  <at> 

     if (ptQuietFlag == 0)
         Progress(_initProgress, "Writing Output Images");
 panotools-cvs> -    
 panotools-cvs> +
     for (loopCounter = 0; loopCounter < counterImageFiles; loopCounter++) {

         if (ptQuietFlag == 0) {
 panotools-cvs>  <at>  <at>  -1317,7 +1324,7  <at>  <at> 
                 return (1);
             }
         }
 panotools-cvs> -        
 panotools-cvs> +
         strcpy(outputFileName, panoFileName->name);
         sprintf(var40, "%04d", loopCounter);
         strcat(outputFileName, var40);
 panotools-cvs>  <at>  <at>  -1328,17 +1335,15  <at>  <at> 
 panotools-cvs> ------------------------------------------------------------------------------
 panotools-cvs> Virtualization & Cloud Management Using Capacity Planning
 panotools-cvs> Cloud computing makes use of virtualization - but cloud computing 
 panotools-cvs> also focuses on allowing computing to be delivered as a service.
 panotools-cvs> http://www.accelacomm.com/jaw/sfnl/114/51521223/

--

-- 
--
Daniel M. German                  
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with  <at>  and (dot) with .

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
PanoTools-devel mailing list
PanoTools-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/panotools-devel

Gmane