ADC Membership Technical Business Join ADC
Search Advanced Search
NOTE: This Technical Note has been retired. Please see the Technical Notes page for current documentation.

Technical Note TN1030
A Technique for Estimating the Total RAM You Need for a QuickTime VR Project

CONTENTS

When using the QTVR Authoring Tools to create a panorama, the most common problems arise from not having enough memory to accomplish the task. If you follow the recommendations in the QTVR Reference Manual, shooting with a 15mm lens and scanning your panoramas to PhotoCD and using the 768 x 512 resolution images, 40 MB of total RAM ought to be enough to get the job done.

But if, like some QTVR producers, you want to use higher resolution images or longer lenses for your project, you may need more RAM. This Technote, which is aimed at QTVR producers, will help you assess how much RAM you'll need and provide you with tips on how to recognize and avoid common memory-related problems.

 [Feb 1 1996]






A Method for Estimating the Minimum RAM

MPW is by far the tool that needs the most RAM. Typically, a QTVR project requires that you allocate at least 30 MB to execute the QTVR tools that MPW calls, specifically stitch, which takes up the lion's share of memory. The other MPW tools, such as p2mv, are not significant in terms of the maximum or total amount of memory you need.

p2mv (PICT to movie) is a tool that dices the panorama PICT which has been stitched into equally-sized tiles and then packages them as a QuickTime Movie. The msnm tool (make single node movie) takes the diced QuickTime Movie and adds the extra parameters that QuickTime VR needs to complete the panorama movie.

The stitcher, running under MPW, requires enough RAM to buffer 3 copies of a panorama in order to stitch, rotate and crop the image.

Because a panorama is technically a series of flat images wrapped into a cylinder, the surface of the cylinder is what determines the amount of memory your project needs.

Steps To Estimate RAM Requirements

To estimate roughly the minimum amount of RAM you'll need, follow these steps:

  1. Decide if you'll be using your camera in portrait mode (recommended) or landscape mode.
  2. Mount your camera accordingly on a tripod.
  3. Looking through the lens, rotate the camera clockwise, aligning the left edge of the frame to the previous frame's right edge.
  4. Count the minimum number of photos you need to complete a 360 degree panorama with no overlap.

    Important:
    Alternatively, if you have the horizontal and vertical field of view angles for the lens you want to use, you can calculate the number of images needed to complete a 360 degree panorama. Using the lens in portrait mode, divide 360 by the vertical angle to get the minimum number of images. If in landscape mode, divide by the horizontal angle.



    Note:
    The number of overlapping images won't change the RAM requirements because the overlapping portions don't increase the size of the cylinder. The advantage of having generous (+50%) overlap is that it allows the stitcher to even out dark and light exposures with the -blend option. Changing the orientation of the camera changes only the height of the cylinder, while the circumference stays the same.


  5. Decide on what resolution you want to use, keeping in mind that a lower resolution image is going to have a smaller panorama and less detail.

    Note:
    Input devices typically offer a multiple resolutions. For example: PhotoCD offers five different resolutions, including 768x512, 384x256, and 1536x1024. The QuickTake 150 camera offers you only two: 640x480 and 320x240, as do most video digitizers.


Steps one through five outline the procedures you need to follow in order to determine the variables in the RAM requirements equation.

The Formula

Here are the factors you need to calculate the RAM requirements equation:

i        (number of images with zero overlap to complete
                            360 degrees)
b = 2        (number of buffers )
w = 1.44    (10% default work border)
t=2        (number of temporary input images)
h        (horizontal input image resolution)
v        (vertical input image resolution)
d = 4        (bit depth in bytes)
k = 1024    (bytes per kilobyte)

((i*b*w) + t)*h*v*d/k = the KB RAM requirements

Note:
To convert kilobytes into megabytes, divide by 1024



Note:
The MPW partition should be set to have at least 1 MB for code and the rest for the image buffers.


Two Sample Calculations

Example #1: If your 18mm lens in portrait format has about 65 of horizontal field of view, and you take 6 images to make a complete rotation, using the 768 x 512 resolution PhotoCD images, your cylinder size will be:

((6x2x1.44)+2)x768x512x4/1024 = 29614 KB

Therefore, you'll need a minimum of 31 MB of RAM for MPW.

Example #2: Using the standard QuickTake 150 digital camera in portrait mode requires a minimum of 14 images to complete a 360 degree panorama.

((14x2x1.44)+2)x640x480x4/1024 = 50784 KB

The irony is that the QuickTake camera, which is perceived as a low-end solution, actually requires more RAM than the 18mm SLR. However, if you use landscape mode with your QuickTake camera, the buffers will only need 38 MB.

Setting the MPW Memory Partition

You can set MPW's Minimum and Preferred size in the Get Info dialog from the Finder.

Unless you have lots of extra memory, you should quit all other applications before launching MPW. A typical Macintosh 7.5 System will need 5-10 MB of RAM -- more if you have extra extensions installed. If you install only a basic system, it's possible to reduce its memory needs to less than 5 MB.

QuickTime loads into the system heap, so you need to make sure there is at least 1 MB for the system to grow when it loads QuickTime. Not having this free space may cause unexpected errors. If you get errors while stitching, use About This Macintosh in the Apple menu to confirm that MPW has enough RAM and that there is still 1 MB of free space.

Back to top

Calculating Total RAM

After figuring the amount of RAM needed for MPW, add the following to your subtotal:

System (10 MB) + Free space (1 MB) + MPW (RAM requirements) = Total RAM

A Practical Configuration: A Personal Example

My camera system with an 18mm lens requires a minimum of 31+11 = 42 MB of RAM. Fortunately, I have 72 MB in my Power Macintosh 8100, and this allows me to stitch images captured with my second camera: the QuickTake 150. This also lets me run multiple tools concurrently, which saves me the time of relaunching whenever I change tasks.

Other Variables That Affect Memory Requirements

These calculations should only be considered estimates. A number of other factors may cause the stitcher to require more memory in order to build a panorama. For example, a hand-held panorama often requires a larger image border to accommodate the "stair-stepping" that occurs when the images are skewed and poorly aligned. To insure proper stitching, you may need to add another 20% memory to handle these worse-case situations.

Increasing or Reducing the Amount of RAM

If you want to increase or reduce the amount of RAM you need, there are three important variables you must take into account:

  • orientation of the camera, i.e., portrait or landscape
  • the field of view of the lens, i.e., wide angle or ultra wide angle
  • the resolution of the images, i.e., hi-res, lo-res.

As an example, I prefer to work with lo-res PhotoCD images. When I'm proofing my work I may use a half-size image, which dramatically speeds up the time it takes to build a panorama and also uses four times less RAM.

Back to top

Memory Requirements for Other QTVR Tools

Although the QTVR dicer (the p2mv MPW tool) requires a lot of memory, it is always proportionally less than the stitcher.

A common problem encountered by QTVR developers is not increasing the partition size of HyperCard to 20 MB required by the Scene Editor.

Object movies require only as much RAM as needed for the Video Capture tools. Five megabytes of free space should be sufficient for most cases.

Back to top

Using Virtual Memory

If you want to work with images requiring more RAM than you have, you can do so by turning on virtual memory. Virtual memory, however, really slows things down, often by as much as a factor of 10. But it may allow you to accomplish things that would otherwise require lots of expensive RAM. Plan on using virtual memory as an exception rather than the rule for your QTVR projects.

A Bench Test

One weekend I ran some timing tests, stitching large panoramas with virtual memory on. The reason I performed the tests was to see if I could push the limits of how large a panorama QuickTime VR could stitch.

I used a Nikon N90, 18mm lens, Kaidan universal pan head to take 12 portrait shots per node. I shot the scene indoors with fluorescent lights. The negatives were scanned onto a PhotoCD and then stitched on a PowerPC 8100/80 with 72 MB of RAM. I ran a benchmark with virtual memory turned off, and then the others with virtual memory set to 480 MB!

I stitched them first in an MPW partition that used all but 10 MB of free space. All Easy Install Macintosh 7.5.1 system extensions were enabled.

For the largest size, I played it safe and turned off the -outWidth, -outHeight parameters and resized the panorama.srcPict with Adobe Photoshop. I thought I could dice it with less virtual memory, but eventually diced them all with 300MB of virtual memory. I wanted to use less than 480 MB because speed was a consideration.


Note:
Perhaps a more realistic test would be one using a 60 MB RAM system compared to a 16 MB + 44 MB (VM) system, but this was not feasible given my time constraints.


Timing Results from the Experiment

Table 1 shows the timing results from the experiment. Note that all times are in Hours: Minutes: Seconds, rounded off.

Resolu-
tion     VM  stitch Time    Output Size       p2mv        msnm
768     off    00: 07: 22    6.3 MB        0: 01: 58       0: 00: 03
192     on    00: 01: 00    0.416 MB     0: 00: 15       0: 00: 04
768     on    00: 13: 00    6.3 MB        0: 07: 30       0: 00: 20
1536     on    04: 45: 00     25 MB        0: 47: 20       0: 00: 45
3072     on    55: 05: 00    100 MB        3: 00: 00       0: 02: 00
Table 1 - Timing results with virtual memory on and off

You can stitch 100MB panoramas if you have lots of time (as I did, for example -- 3 days!) The resulting movie I made was 8.7 MB, so it was not exactly practical for the World Wide Web and displayed about 2 frames/second on the PowerPC 8100, which was unacceptably choppy.

If you have more time than money, it's possible to use virtual memory rather than add RAM and still build big panoramas, with lots of detail.


Note:
This does not change the official QTVR recommended minimum RAM configurations. Proceed at your own risk.


Back to top

Summary

It's possible to estimate your project's RAM requirements using the formula provided in this Technote. Note that these are minimum estimates. The most common problems are caused by not having enough RAM. The choice is clear: invest in the purchase of sufficient RAM to meet your QTVR development needs.


Back to top

References

Technote 1029, "Getting Up to Speed with QuickTime VR: Notes from the Field."

QTVR Authoring Tool Suite


Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (64K).

Download



Back to top


Technical Notes by Date | Number | Technology | Title
Developer Documentation | Technical Q&As | Development Kits | Sample Code




Gray line

Contact ADC |  ADC Site Map |  ADC Advanced Search
For information about Apple Products, please visit Apple.com.
Contact Apple | Privacy Notice
Copyright © 2002 Apple Computer, Inc. All rights reserved.
1-800-MY-APPLE