Talk:Smartblend on Mac

From PanoTools.org Wiki
Revision as of 22:00, 18 September 2012 by Erik Krause (talk | contribs) (Created page with "== Copy from google cache == <h1>Running Smartblend with PTGui Natively on OS X</h1><p>Here we are going to discuss how to configure PTGui to run Smartblend natively on OS X</...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Copy from google cache

Running Smartblend with PTGui Natively on OS X

Here we are going to discuss how to configure PTGui to run Smartblend natively on OS X

About Smartblend and PTGui

Smartblend is a panoramic image blending application designed to be used as a plug-in for panorama stitching applications. It is capable of dealing with moving objects and parallax better than other blending solutions.

For example, when you photograph a bridge with heavy traffic, in most cases you are going to end up with ghosts of partially rendered cars. In other situations, you might end up with people's hands or legs cut off in your panorama. Smartblend was designed to keep objects together, or entirely remove them from the picture.

PTGui is an advanced photo stitching software, which can be configured to use Smartblend as a blending application.

Smartblend on OS X

Smartblend is currently only available for the Windows platform. The general consensus is that it cannot be run natively on OS X.

However, there is a workaround. It does not require you to install Windows or run any virtual machine. The solution is based on the 100% free and open-source Wine.

Note: My solution is for Intel Macs only. It does not work on PowerPC hardware.

Wine is a community-developed application for running Windows applications on Unix-like computers with Intel x86 processor. It was developed completely independently from Microsoft, and contains no code from Windows. Wine implements a very thin compatibility layer on top of Linux, BSD, or OS X, which allows Smartblend to execute natively on an Intel Mac.

Note that Wine is completely legal and has nothing to do with Microsoft. It does not require that you purchase Microsoft Windows. Wine is a very small and lightweight package. It is not an operating system, just a thin interface that translates Windows operations into OS X. It is a lot faster than VMWare or Parallels, and costs no money at all.

Installation

The following instructions come with no warranty of any kind. Use it at your own risk. I shall not be responsible for any damages that may occur while following these steps.

Here are the steps to install Smartblend on OS X with the purpose of using it from PTGui.

  1. <a href="http://www.kronenberg.org/darwine/">Download Darwine</a>, a special build of Wine designed for Mac OS X. (The regular version of Wine was built for Linux).
  2. Open the Darwine-x86-1.0.1.dmg disk image, and drag and drop the Darwine folder into Applications. That is all you need to install this distribution of Wine.
  3. <img src="InstallDarwine.png">
  4. <a href="http://wiki.panotools.org/wiki/images/3/37/Smartblend_1_2_5.zip">Download Smartblend</a> from <a href="http://wiki.panotools.org/SmartBlend">http://wiki.panotools.org/SmartBlend</a>.
  5. Double click on the Smartblend_1_2_5.zip file to uncompress it.
  6. Optionally, rename "Smartblend_1_2_5.zip Folder" to something simpler, such as Smartblend, and move it to a convenient location where you are going to find it. For example, /Users/yourname/Smartblend. This is not necessary, as you can have it anywhere on your hard drive, as long as you know its location.

Congratulations, you have installed Smartblend on OS X!

Note that you could use other Wine distributions. However, Darwine is so easy to install that it does not require any Linux expertise. If you use a different version of Wine, you know who you are and what you are doing.

Configure PTGui

The next step is to let PTGui know where Smartblend is located. Note that you should use the OS X version of PTGui.

  1. Run PTGui. From the menu bar, select PTGui -> Preferences...
  2. Switch to the Plugins tab, scroll down to the bottom, and specify the following settings:

    Smartblend application: /Applications/Darwine/Wine.bundle/Contents/bin/wine
    Command line parameters: /Users/yourname/Smartblend/smartblend.exe

    (Note: in the second line you must specify the actual path where smartblend.exe is located. Ignore the red warning that tells you it only works on Windows.)
  3. <img src="PTGui1.png">
  4. Close the preferences dialog, and switch PTGui into advanced mode by clicking the "Advanced >>" button in the main window.
  5. <img src="PTGui2.png">
  6. Before you create your panorama, switch to the Create Panorama tab, and select Blend using: Smartblend plugin.
    <img src="PTGui3.png">

You can do all this with the evaluation version of PTGui, just to make sure it works for you before you purchase. Smartblend and Darwine are free of charge.

What About Hugin?

Hugin is a free panorama stitching program. It is much slower than PTGui, but produces very good images. However, it is currently not compatible with Smartblend, as far as I know.

I have attempted to get it to work. The first hurdle was that Hugin passes parameters that Smartblend does not understand. Therefore I wrote a shell script to filter them out:

#!/bin/bash
#
SMARTBLEND=/Users/tamas/Smartblend/smartblend.exe
SMARTBLENDARGS=`echo $* \
| sed "s/--compression NONE //" \
| sed "s/--compression PACKBITS //" \
| sed "s/--compression LZW //" \
| sed "s/--compression DEFLATE //" \
| sed "s/-f *[0-9][0-9]*x[0-9][0-9]* //" \
| sed "s/-l *[0-9][0-9]* //"`
/Applications/Darwine/Wine.bundle/Contents/bin/wine $SMARTBLEND $SMARTBLENDARGS
exit 0

(Credit: <a href="http://www.mail-archive.com/hugin-ptx@googlegroups.com/msg00256.html">Bob Bright</a>)

I saved this to a file called smartblend, and made it executable by running "chmod +x smartblend" from the terminal.

This way Hugin was successfully executing Smartblend. However, this did not work out, because the latest version of Smartblend requires the -xofs -yofs parameters, otherwise the output is complete garbage. I was unable to convince Hugin to generate the offsets. Smartblend currently only works with applications that support it. Someone else might have better luck, or Hugin might include Smartblend support in the future. I'm not saying it's impossible to get Hugin to work with Smartblend, I just couldn't do it myself.