Here is a preset generator for the PW. It is mentioned here http://www.autopano.net/forum/p44380-2009-05-04-00-11-14#p44380. If you read that thread you find that moving the Merlin head around 10 degrees interval on both yaw axis and pitch axis is faster. You will benefit from this when you are doing gigapixel mosaic with lots of rows and columns.

1. What is it?This html/javascript program creates a PW preset for a given camera/lens combination with specified rows and columns. This creates a preset and a preview preset that travels on the edge of the mosaic from top-left, top-right, bottom-right, bottom-left to top-left.

2. What is the difference between this and the default PW way of moving the head?The presets generated from this program will save time. This is done by moving the head around 10 degrees increment in both yaw and pitch axis. The default movement in the PW is to move the head by each position by a) on the odd numbered rows from left to right and b) on the even numbered rows from right to left - a zigzag motion. The preset will generate the same movement if the FOV of the lens is greater than 10 degrees so you are not loosing anything. If it is less than 10 degrees then it will try to find matching column/row combination where the movement needed is around 10 degrees. This script is a complementary to what PW already offers.

4. How to install?a) Open notepad or any text editorb) Copy the following code (remove the "Code:" part)c) Paste that in the text editord) Save it with a name (like pw_preset.html)e) Double click on the name. It will be opened in the default browser.f) You can create a shortcut as well (see Picture 1).

4. What is the system requirement?A modern browser - latest version of any browser. I wrote it in html/javascript combination so that it works in most of the browsers. I tested it in IE and Firefox. It works find on these browsers. The javascript needs to be enabled on the browser. The script uses very premitive javascript so it should work in most browsers without any modifications. If you find that it is not running in a browser, please post it in this thread to figure out a solution.

5. What are the fields on the screen?a) Crop Factor: This dropdown box shows all the possible sensor crop for the DSLR currently available.Some example, choose 1.0 for full frame DSLR/film cameras irrespective of camera maker choose 1.3 for Canon 1D series choose 1.5 for Nikon crop cameras like D40 etc choose 1.6 for Canon Rebel series choose 2.0 for 4/3 and micro 4/3 system Note that if you use any point and shoot camera, use the crop factor of 1.0 and its 35mm equivalent focal length. For example, Canon A590 has 140mm (35mm equivalent) at tele end. So use crop factor of 1.0 and focal length of 140mm.b) Aspect Ratio: Choose the maximum sensor aspect ratio for a given camera. Mostly it is 3:2 ration for DSLR.Some camera offer in camera crop of 4:3 and 16:9. It is best to use the native aspect of the sensor.c) Overlap: This is the overlap percentage between the adjustant shots in yaw and pitch axis.d) Orientation: Orientation of the camera when taking the mosaic - Landscape or Portrait.e) Focal Length: The focal length of the lens used. Don't do any conversion here. If you use 50mm lens on a 1.6 crop body, just enter 50 and not 80.f) Rows: Number of rows in the mosaic.g) Columns: Number of columns in the mosaic.h) Width in Pixels: Frame width in pixels of the picturei) Height in Pixels: Frame height in pixels of the picturej) Generate (button): Press this button to generate the preset.k) Preset (text area): The generated preset will be shown here.

6. How to use it?Select a value that matches your camera.Select the correct aspect ratio for your camera.Select an overlap percentage.Select the orientation of the camera.Enter the focal length of the lens.Enter the number of rows (whole number)Enter the number of columns (whole number)Enter the width of the picture in pixels (whole number)Enter the height of the picture in pixels (whole number)Press the "Generate" button.

This creates a preset in the bottom text area. The preset name will be 35<2 digit crop factor><orientation>_<focal length>_<rows>_<columns>. Now copy this to a file same as the preset name with an extension of .xml.For example, you use Canon 450D in portrait with 200 mm lens for 6 rows and 15 columns. The preset name will be 3516P_200_6_15. The preview preset name will be 3516P_200_6_15_preview. Save the preset in a file called 3516P_200_6_15.xml.

Load this preset file into the PW using File->Import Preset File menu.

Set the home position correctly. Select the preview preset (3516P_200_6_15_preview) and see the positions. Note that you have to use the simulation for shutter, otherwise you will take 5 picture of the 4 corners of the mosaic.

Once you set the home position correctly, then select the preset (3516P_200_6_15) and take the mosaic.

7) what is in the tooltip?a) The tooltip has a Source section where the format used, focal length used, rows and columns are mentioned.b) The tooltip also has a Target section which shows the resultant horizontal, vertical FOV and sizes.

<!-- ! This program is to generate preset for the Papywizard ! program. This program can be used for commercial and/or ! non-commercial use for free. ! ! Author: Jones Henry Subbiah (C) 2009. ! ! Disclaimer: The user assumes the responsibility of any ! any demage using the preset. The author is not responsible ! for anything. ! ! The preset generated assumes top-left corner of the pano ! is the home position that is yaw = 0, and pitch = 0. The ! name of the preset will be 35mmformat_focallength_rows_columns-->

/* * This function rounds a number to a single decimal precision. * The trick to is to add 0.05 to the number and truncate at the first * decimal position. */ function round21 ( number ) { nnum = number + 0.05; nums = nnum.toString(); numa = nums.split('.'); return ( numa[0] + '.' + numa[1].charAt(0) ); }

/* * This function initializes all the position of the pano. * The position is of the form "row,col,pitch,yaw". * Each position of the pano is represented here in the String array. */ function initialize_positions ( hfov, vfov, prows, pcols ) { var pos = new Array ( prows * pcols ); var yaw = 0.0; var pitch = 0.0;

Hey Jones, nice !What I miss is the FoV and pixel calculation.Maybe I don't understand it, but to me it's first do a run with the BT/Nokia/PW module from left corner to right under, then to see howmuch rows etc I need, then create a preset......??

Yes. I tried it from 7 degrees to 13 degrees when I did my initial analysis. In my head with wired setup, it always moves faster at 10 degrees. That is why I chose the 10 degrees. If you want to do more experiments, you can change the value in the javascript variable OPTIMUM_DEGREES to desired value.

Please put this script in your site. It will be helpful for many users.

The preset assumes the starting of the pano whether it is a partial pano (mosaic) or a 360 degree that top-left is set to 0 yaw and 0 pitch.

By this, when you do the 360 pano (like the one you generated the preset), then the head needs to be physically in the zenith position - that is camera pointing upwards (90 degrees pitch). Then you set the home position so that position becomes 0 yaw and 0 pitch. That is why all pitch values are in negative with the assumption that the top-left is physically set to 0,0.

The preset assumes the starting of the pano whether it is a partial pano (mosaic) or a 360 degree that top-left is set to 0 yaw and 0 pitch.

By this, when you do the 360 pano (like the one you generated the preset), then the head needs to be physically in the zenith position - that is camera pointing upwards (90 degrees pitch). Then you set the home position so that position becomes 0 yaw and 0 pitch. That is why all pitch values are in negative with the assumption that the top-left is physically set to 0,0.

[...]Please put this script in your site. It will be helpful for many users.

I have a problem to put in on the Papywizard wiki: I can't put anything in the head section, so I can't define the js routines. I made a page with the input parameters, which call an external page, giving all form values using POST mecanism:

It is possible to separate the javascript and html into two different files. Then the external js can be linked as

One more thing. The Generate should be of type button instead of submit. If it is of submit, then it will look for the server side code.

Also regarding the xml output itself, it needs a server side code like php, phython to do it. The reason is that the mime type is by default text/html on the browser. It is not possible to change it to text/xml or application/xml using js so that it will not ask for open or save.

The current script also prints the output horizontal and vertical size as well.

Jones

EDIT: I removed the html plus javascript embedded here. It is easier to deal with one file. I initially split that so that it can be hosted in the Papaywizard site. Sorry for the confusion. Please refer the first thread to see the latest version of the code.

Last edited by sjhenry on Mon Jul 20, 2009 1:15 am, edited 1 time in total.

Frederic,You may want to hold putting it in the papywizard site. I have two more scripts like that I want to share with the others. I'll put them here in the thread and once it is finalized then you can put it on your site.

<!-- ! This program is to generate preset for the Papywizard ! program. This program can be used for commercial and/or ! non-commercial use for free. ! ! Author: Jones Henry Subbiah (C) 2009. ! ! Disclaimer: The user assumes the responsibility of any ! any demage using the preset. The author is not responsible ! for anything. ! ! The preset generated assumes top-left corner of the pano ! is the home position that is yaw = 0, and pitch = 0. The ! name of the preset will be 35mmformat_focallength_rows_columns-->

Yes. You are correct that the script shown as html plus javascript will give error if you have the comment. The comment is only good for the html and not for the javascript. Sorry about confusing everyone.

I have updated the script back to one html file. This has the javascript embedded within it and easier to maintain as one file.

I have updated the code in the first thread and removed the reference to javascript file.

I suggest that you add a comment line in your code snippets indicating a version number and increase the version number when you did a change. That makes it easier to follow the changes and/or additions and checking it again a stored copy/paste on my pc.