Smartblend: Potential use with Hugin

267 views
Skip to first unread message

irv

unread,
Sep 22, 2008, 4:05:26 PM9/22/08
to hugin and other free panoramic software, iwei...@comcast.net
I have been a Hugin user for several yearsand must congratulate Pablo
and the team of contributors for their outstanding acheivements. My
primary usage of Hugin is to generate a higher resolution image, from
which I can print large (24"x36") prints. I typically will shoot a
matrix; 2x2, 3x3, 3x5 and higher. I highly recommend the use of a
tripod to minimize image motion, but have often shot handheld when the
shutter speed is relatively fast. The robustness of the algorithms in
Hugin and Ptgui have increased exponentially (at least to me) in the
past years-I whimsically shot a series of images in Yosemite N.P. at
Glacier Pt. of the entire valley. By this I mean I paid little
attention to leveling, overlap in x&y, I think the array was a
"drunken" 4x5! The stitched imaged, however, was quite sober! Very
impressive.

To my question: Are there any plans to permit Smartblend to be used
with Hugin? When Enblend doesnt get the 'sky' just right I find that
Smartblend (with PTgui) does quite better and much faster. The
difference is attributeable to Smartblend, if I use Enblend with Ptgui
the results are similar with Hugin.

Thanks to todays 'Pano' programs I have an adjustable 'infinite wide
angle lens' (my 24-70) without the distortions created by the 10-20,
12-24 ultra wides, plus my normal perspective is maintained.

Keep up the great work!!!

Erik Krause

unread,
Sep 22, 2008, 5:57:54 PM9/22/08
to hugin-ptx
On Monday, September 22, 2008 at 13:05, irv wrote:

> To my question: Are there any plans to permit Smartblend to be used
> with Hugin? When Enblend doesnt get the 'sky' just right I find that
> Smartblend (with PTgui) does quite better and much faster. The
> difference is attributeable to Smartblend, if I use Enblend with Ptgui
> the results are similar with Hugin.

enblend uses a not so optimal number of levels. specify -l 20 at the
enblend command line to increase the number to the maximum and you
get results similar to smartblend. enblend 3 should be almost as fast
as smartblend BTW...

best regards
Erik Krause
http://www.erik-krause.de

Bob Bright

unread,
Sep 22, 2008, 6:47:43 PM9/22/08
to hugi...@googlegroups.com
Yes, smartblend can be used with hugin.  I've also found that smartblend does a better job than enblend in some circumstances (specifically, less patching to do at the zenith), and am now using it for most of my production work.

However, recent hugin builds pass arguments to the blender specified in Preferences which smartblend doesn't understand, so they need to be stripped in order for smartblend to work.  You didn't say what kind of system you're working on.  The instructions below are for linux, but I'm sure something similar will work on other systems.  If you're not sure how to set it up on Windows or Mac, just ask and some of the resident experts can help you out.

1. Install wine if you don't already have it, from your distribution's standard repositories or from http://www.winehq.org/.  (Smartblend.exe runs fine on linux under wine.)

2. Download smartblend from http://wiki.panotools.org/SmartBlend and unzip the archive to a convenient location.  Open a terminal in that location and enter "wine smartblend.exe", just to make sure everything is working so far.  You should get a usage message from smartblend.exe.

3. Save the following script as "smartblend" somewhere in your path, and make it executable.  Edit the third line to point to where you unzipped smartblend.exe in the previous step.  The purpose of the script is to strip out the offending arguments which hugin is passing to the blender.  It also prepends "smartblend-" to the output filename, so you won't inadvertently overwrite a file that you've blended with enblend.

     #!/bin/bash
     #
     SMARTBLEND=/home/bbb/bin/smartblend_1_2_5/smartblend.exe
     SMARTBLENDARGS=`echo $* \
     | sed -r "s/--compression NONE //" \
     | sed -r "s/--compression PACKBITS //" \
     | sed -r "s/--compression LZW //" \
     | sed -r "s/--compression DEFLATE //" \
     | sed -r "s/-f *[0-9]+x[0-9]+ //" \
     | sed -r "s/-l *[0-9]+ //" \
     | sed -r "s/-o +([[:alnum:]]+)/-o smartblend-\1/"`
     echo -e "\nExecuting smartblend.exe $SMARTBLENDARGS\n"
     wine $SMARTBLEND $SMARTBLENDARGS
     exit 0

4. Now start up hugin, select File -> Preferences -> Enblend, and enter "smartblend" as the "Enblend executable".  Leave "Default Arguments" blank.  You should be good to go: generating a blended panorama from the Stitcher tab in hugin should now produce a smartblended panorama.

Cheers,
BBB

Bob Bright

unread,
Sep 22, 2008, 7:04:26 PM9/22/08
to hugi...@googlegroups.com
On Mon, 2008-09-22 at 23:57 +0200, Erik Krause wrote:

enblend uses a not so optimal number of levels. specify -l 20 at the 
enblend command line to increase the number to the maximum and you 
get results similar to smartblend. enblend 3 should be almost as fast 
as smartblend BTW...

I still get fewer blending artifacts around the zenith with smartblend than with enblend, and using enblend's maximum number of blending levels doesn't affect this.  E.g., compare the following two zeniths, the first created by enblend with -l 29, the second by smartblend at default settings:

http://VictoriaVR.ca/test/enblend-zenith.jpg
http://VictoriaVR.ca/test/smartblend-zenith.jpg

There's still a slight artifact in the smartblended example, but it's barely noticeable, and much easier to patch satisfactorily than the enblend example.

Cheers,
BBB

Yuv

unread,
Sep 23, 2008, 6:52:20 AM9/23/08
to hugin and other free panoramic software
Bob Bright wrote:
> Yes, smartblend can be used with hugin.

thanks a lot for that, Bob. I've added it to SVN (r3451) in platforms/
linux.
Yuv

cspiel

unread,
Sep 23, 2008, 9:53:53 AM9/23/08
to hugin and other free panoramic software
Erik Krause wrote:
> enblend uses a not so optimal number of levels. specify -l 20 at the
> enblend command line to increase the number to the maximum and you
> get results similar to smartblend. enblend 3 should be almost as fast
> as smartblend BTW...

Enfuse used to employ exactly one level less than the
maximum allowed number of levels given a particular
kernel and image size. This issue has been fixed in
CVS on 2008-09-13T21:15:02. Please let me know if
any problem related to the levels calculation persists
and I have to rework my patch.

Concerning the performance of Enfuse-3.2: Contrast
weighting is _much_ faster because of the new, O(1)
algorithm. Saturation weighting could have become
slightly faster, too.


/Chris

Harry van der Wolf

unread,
Sep 23, 2008, 10:25:21 AM9/23/08
to hugi...@googlegroups.com
Hi Chris,

Where can I find the Smartblend CVS (it's even hidden for Google) and does it compile on OSX?

Harry


2008/9/23 cspiel <csp...@freenet.de>

cspiel

unread,
Sep 23, 2008, 10:56:18 AM9/23/08
to hugin and other free panoramic software
Hello Harry -

Harry van der Wolf wrote:
> Where can I find the Smartblend CVS (it's even hidden for Google) and does
> it compile on OSX?

I was talking about the Enblend/Enfuse CVS repository,
as Enblend and Enfuse had the "too little levels" problem,
which should be fixed now.

Sorry if I have mislead you! I hack on Enfuse only and don't
know anything about Smartblend.

HTH,
Chris

PS: Correction to my original post: Enfuse's contrast weighting
uses an O(n) algorithm, not O(1), where n is the size of the
contrast-mask window.

Michael Galloway

unread,
Sep 23, 2008, 11:43:56 AM9/23/08
to hugi...@googlegroups.com
On Tue, Sep 23, 2008 at 07:56:18AM -0700, cspiel wrote:
>
> I was talking about the Enblend/Enfuse CVS repository,
> as Enblend and Enfuse had the "too little levels" problem,
> which should be fixed now.
>
> Sorry if I have mislead you! I hack on Enfuse only and don't
> know anything about Smartblend.
>
> HTH,
> Chris
>
> PS: Correction to my original post: Enfuse's contrast weighting
> uses an O(n) algorithm, not O(1), where n is the size of the
> contrast-mask window.
>

is the segfault with enblend cvs resolved?

-- michael

Bob Bright

unread,
Sep 23, 2008, 12:51:29 PM9/23/08
to hugi...@googlegroups.com
Thanks, Yuv.

For the record: I'm not a fan of closed software.  I'm using smartblend (for the time being) only because it makes my production work a little more efficient, and I'm not clever enough to figure out how to make enblend play nicely with the zenith.  But make no mistake: It's Andrew Mihal's work on enblend and enfuse which paved the way for other blenders and fusers.  I want to thank him from the bottom of my heart, and I happily look forward to the day when I can go back to using enblend full time.

Cheers,
BBB

Erik Krause

unread,
Sep 23, 2008, 6:31:58 PM9/23/08
to hugin-ptx
On Monday, September 22, 2008 at 16:04, Bob Bright wrote:

> I still get fewer blending artifacts around the zenith with smartblend
> than with enblend, and using enblend's maximum number of blending levels
> doesn't affect this. E.g., compare the following two zeniths, the first
> created by enblend with -l 29, the second by smartblend at default
> settings:
>
> http://VictoriaVR.ca/test/enblend-zenith.jpg
> http://VictoriaVR.ca/test/smartblend-zenith.jpg

Interesting. I never got anything alike with enblend, but of course I
use a zenith shot.

Did you try the --fine_mask option?

Jim Watters

unread,
Sep 23, 2008, 7:44:03 PM9/23/08
to hugi...@googlegroups.com
I am guessing you are shooting 4 around with a circular fisheye.
You could tilt the whole pan head so one image has dominance for the zenith.
There is nothing that says the camera needs to be level on the tripod.
But this does not help for already shot panos.

-- 
Jim Watters

Yahoo ID: j1vvy ymsgr:sendIM?j1vvy
jwatters @ photocreations . ca
http://photocreations.ca

Tony Gieske

unread,
Sep 23, 2008, 7:49:09 PM9/23/08
to hugi...@googlegroups.com
Sorry to bother you, but I didn't mean to ask for all the messages on this group to be mailed to me. I can't seem to reach the group source itself. Can you help me?
 
Regards,
 
Tony Gieske

cspiel

unread,
Sep 24, 2008, 5:07:57 AM9/24/08
to hugin and other free panoramic software
Michael -

Michael Galloway wrote:
> is the segfault with enblend cvs resolved?

At least I cannot reproduce it with the latest CVS version
on my machine
$ uname -a
Linux beliskner 2.4.36 #3 SMP Thu Feb 14 15:51:55 CET 2008 i686
GNU/Linux
and my compiler
$ gcc --version
gcc (GCC) 4.3.2
However, this doesn't prove the bug went away.

Could you please give it a spin? If you run into a segfault
a backtrace would be helpful.

Cheers,
Chris

Kornel Benko

unread,
Sep 24, 2008, 7:09:15 AM9/24/08
to hugi...@googlegroups.com
Am Wednesday 24 September 2008 schrieb cspiel:
>
> Michael -
>
> Michael Galloway wrote:
> > is the segfault with enblend cvs resolved?
>
> At least I cannot reproduce it with the latest CVS version
> on my machine
> $ uname -a
> Linux beliskner 2.4.36 #3 SMP Thu Feb 14 15:51:55 CET 2008 i686
> GNU/Linux
> and my compiler
> $ gcc --version
> gcc (GCC) 4.3.2
> However, this doesn't prove the bug went away.

On my machine it is
Linux dell64 2.6.22.17-0.1-default #1 SMP 2008/02/10 20:01:04 UTC x86_64 x86_64 x86_64 GNU/Linux

and here enblend still segfaults.

> Could you please give it a spin? If you run into a segfault
> a backtrace would be helpful.

I have a backtrace, but not very helpfull.

....
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /usr/lib64/libXau.so.6...done.
Loaded symbols for /usr/lib64/libXau.so.6
Core was generated by `enblend -o xb0000.tif -v -m 400 -l 20 -w -a --fine-mask --optimize xa0005.tif x'.
Program terminated with signal 11, Segmentation fault.
#0 0x00000000004f676e in enblend::maskBounds<vigra::CachedFileImage<unsigned char> > ()
(gdb) bt
#0 0x00000000004f676e in enblend::maskBounds<vigra::CachedFileImage<unsigned char> > ()
#1 0x000000000063a17e in enblend::enblendMain<vigra::RGBValue<unsigned char, 0u, 1u, 2u> > ()
#2 0x0000000000408d42 in main ()
(gdb)

> Cheers,
> Chris

Kornel
--
Kornel Benko
Kornel...@berlin.de

signature.asc

Michael Galloway

unread,
Sep 24, 2008, 9:51:20 AM9/24/08
to hugi...@googlegroups.com

same for me:

(gdb) set args --compression NONE -f1042x766 -o test.tif test0000.tif test0001.tif
(gdb) run
Starting program: /usr/local/bin/enblend --compression NONE -f1042x766 -o test.tif test0000.tif test0001.tif
[Thread debugging using libthread_db enabled]
Input images to small for coarse mask, switching to fine mask.
Loading next image: test0000.tif
Loading next image: test0001.tif
Creating blend mask: 1/4 2/4 3/4 4/4
Optimizing 1 distinct seam.
Strategy 1, s0: 1/4 2/4 3/4 4/4
Strategy 2: s0
[New Thread 0xb7a476d0 (LWP 5684)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7a476d0 (LWP 5684)]
0x0810a0a6 in enblend::maskBounds<vigra::CachedFileImage<unsigned char> > ()
Current language: auto; currently asm

i'm using opensuse 11.0,

gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux)
==== enblend, version 3.2-cvs ====

hope this helps some.

-- michael

Bart.van.Andel

unread,
Sep 24, 2008, 10:03:55 AM9/24/08
to hugin and other free panoramic software
On Sep 23, 6:51 pm, Bob Bright <bbbri...@gmail.com> wrote:
> For the record: I'm not a fan of closed software.  I'm using smartblend
> (for the time being) only because [...]

Actually I emailed Michael Norel (the author of SmartBlend) about it
earlier this month, asking whether development had stopped at 1.2.5.
In turn, he replied that:
"It is true, the development of SB is freezed. Just because i have
other , very nice projects. At least i'll find time to publicsh
sources."

Sounds like a nice promise! I pointed him to this group for informing
us when he does.

Cheers, Bart

Erik Krause

unread,
Sep 24, 2008, 3:57:55 PM9/24/08
to hugin-ptx
On Wednesday, September 24, 2008 at 7:03, Bart.van.Andel wrote:

> Sounds like a nice promise! I pointed him to this group for informing
> us when he does.

A nice promise indeed. I always wanted to convince him to make it
open source.

I hope he'll use the smartblend page on the wiki to publish the
source...

Yuval Levy

unread,
Sep 24, 2008, 8:07:09 PM9/24/08
to hugi...@googlegroups.com
Erik Krause wrote:
> I hope he'll use the smartblend page on the wiki to publish the
> source...

a wiki is good for documentation. for code it is inadequate. the best
place for soure code is a version control system, like SVN available at
<http://www.sourceforge.net/> or at Google project hosting
<http://code.google.com/hosting/>

Yuv

Bob Bright

unread,
Sep 25, 2008, 5:08:24 AM9/25/08
to hugi...@googlegroups.com
Doh!  Sometimes I can't believe how dense I am!

Erik's comment that he never gets blending artifacts at the zenith got me thinking.  I had assumed they were endemic to enblend, since I get them regularly, and I've seen others complain about them.  So I've been dutifully patching the zeniths of my panos, and more recently using smartblend to minimize the problem.  But if Erik never gets the artifacts....

He mentioned that he uses a zenith shot.  Well, so do I -- two of them, in fact.

I use a Tokina 10-17 lens attached to a RebelXT on top of a NN3.  The FOV of the Tokina at 10mm is about 83 x 125.  I normally shoot 5 images around at -20 pitch (because I'm trying to get as close to the nadir as possible; tilting past -20 puts the NN3 in the bottom of the frame).  This leaves a hole of about 95 degrees at the top, so I take two shots of the zenith for full coverage, one at +90 pitch 0 yaw and the other at +90 pitch +90 yaw.

These two images obviously overlap substantially at the zenith, and therein lies the problem.  Enblend doesn't know how to blend across the zenith, so when it combines the two images it creates the artifacts.

The solution (so obvious in retrospect that I could kick myself!):  punch a hole in the middle of one of the zenith shots.

     convert -size 2306x3466 xc:none -draw "circle 1153,1733 853,1433" miff:- | composite -compose Dst_Out miff:- IMG_0154.tif -matte -depth 8 IMG_0154.tif

Then there's no overlap at the zenith, so there's nothing for enblend to do and hence nothing it can mess up.  Et voila, problem solved:

     http://VictoriaVR.ca/test/enblend-zenith.jpg
     http://VictoriaVR.ca/test/enblend-zenith-no-overlap.jpg

Cheers,
BBB

Erik Krause

unread,
Sep 25, 2008, 11:15:16 AM9/25/08
to hugin-ptx

Most likely Michael won't use any such system. This will be our duty
;-)

best regards
--
Erik Krause
Offenburger Str. 33
79108 Freiburg

cspiel

unread,
Sep 25, 2008, 12:45:06 PM9/25/08
to hugin and other free panoramic software
Michael -

Thanks for the backtrace! As Kornel already suspected
the information was not as helpful as I had wished.

However, the occurrence of "CachedFileImage"
> 0x0810a0a6 in enblend::maskBounds<vigra::CachedFileImage<unsigned char> > ()
points to the change in the image cache. Until Andrew
locates the real problem, you could recompile Enblend with the
image cache *disabled* and see whether this resolves the issue.
Of course (on some machines) switching off the image cache
severlely limits the size of the problems Enblend (and Enfuse)
can tackle.

Sorry that I could not help you more, but not being able to
reproduce the bug on my machines limits my possibilities.

/Chris

Michael Galloway

unread,
Sep 25, 2008, 12:56:54 PM9/25/08
to hugi...@googlegroups.com

i understand, i have a working copy of enblend, so its not a show stopper (and
indeed, sadly, not been generating images very much this summer as well). thanks
for looking into it.

-- michael

Kornel Benko

unread,
Sep 26, 2008, 8:23:09 AM9/26/08
to hugi...@googlegroups.com
Am Thursday 25 September 2008 schrieb cspiel:
>
> Michael -
>
> Thanks for the backtrace! As Kornel already suspected
> the information was not as helpful as I had wished.
>
> However, the occurrence of "CachedFileImage"
> > 0x0810a0a6 in enblend::maskBounds<vigra::CachedFileImage<unsigned char> > ()
> points to the change in the image cache. Until Andrew
> locates the real problem, you could recompile Enblend with the
> image cache *disabled* and see whether this resolves the issue.
> Of course (on some machines) switching off the image cache
> severlely limits the size of the problems Enblend (and Enfuse)
> can tackle.

I tried, with "./configure --enable-image-cache=no", but it is not compilable
...
make[3]: Leaving directory `/mnt/usr2/src/enblend/enblend/src/win32helpers'
make[3]: Entering directory `/mnt/usr2/src/enblend/enblend/src'
g++ -DHAVE_CONFIG_H -I. -I.. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -I../include -DVIGRA_STATIC_LIB -I/usr/include/OpenEXR -O3 -ffast-math -DNDEBUG -Wall -MT enblend-enblend.o -MD -MP -MF .deps/enblend-enblend.Tpo -c -o enblend-enblend.o `test -f 'enblend.cc' || echo './'`enblend.cc
mask.h: In function ‘MaskType* enblend::createMask(const ImageType*, const ImageType*, const AlphaType*, const AlphaType*, const vigra::Rect2D&, const vigra::Rect2D&, bool) [with ImageType = vigra::BasicImage<vigra::RGBValue<unsigned char, 0u, 1u, 2u>, std::allocator<vigra::RGBValue<unsigned char, 0u, 1u, 2u> > >, AlphaType = vigra::BasicImage<unsigned char, std::allocator<unsigned char> >, MaskType = vigra::BasicImage<unsigned char, std::allocator<unsigned char> >]’:
enblend.h:265: instantiated from ‘void enblend::enblendMain(std::list<vigra::ImageImportInfo*, std::allocator<vigra::ImageImportInfo*> >&, vigra::ImageExportInfo&, vigra::Rect2D&) [with ImagePixelType = vigra::RGBValue<unsigned char, 0u, 1u, 2u>]’
enblend.cc:825: instantiated from here
mask.h:323: error: no matching function for call to ‘stride(int&, int&, vigra::triple<vigra::ConstBasicImageIterator<unsigned char, unsigned char**>, vigra::ConstBasicImageIterator<unsigned char, unsigned char**>, vigra::StandardConstValueAccessor<unsigned char> >)’
mask.h:323: error: no matching function for call to ‘stride(int&, int&, std::pair<vigra::ConstBasicImageIterator<unsigned char, unsigned char**>, vigra::StandardConstValueAccessor<unsigned char> >)’
...

> Sorry that I could not help you more, but not being able to
> reproduce the bug on my machines limits my possibilities.
>
> /Chris

Kornel
--
Kornel Benko
Kornel...@berlin.de

signature.asc

cspiel

unread,
Sep 29, 2008, 10:04:00 AM9/29/08
to hugin and other free panoramic software
Kornel Benko wrote:
> --- snip ---
> I tried, with "./configure --enable-image-cache=no", but it is not compilable

What a bummer! This could have been such a simple work-around.

Anyway, I have added the missing template specializations in the
following patch (which hopefully does not get mangled by the news
software). Enblend compiles again when configured with
"--enable-image-cache=no" and produces the same output as with
enabled image cache after the patch has been applied (at least for
me :-)

HTH.
/Chris


--- a/include/vigra/cachedfileimage.hxx Mon Sep 29 09:38:54 2008 +0200
+++ b/include/vigra/cachedfileimage.hxx Mon Sep 29 15:52:50 2008 +0200
@@ -46,6 +46,7 @@
#include <boost/pool/pool.hpp>

#include <vigra/error.hxx>
+#include <vigra/imageiterator.hxx>
#include <vigra/metaprogramming.hxx>
#include <vigra/utilities.hxx>

@@ -2137,6 +2138,66 @@
return
std::make_pair(ConstStridedCachedFileImageIterator<PixelType>(image.first,
xstride, ystride), image.second);
};

+
+////////////////////////////////////////////////////////////////////////
+
+
+template <typename PixelType, typename ImgAccessor, typename
ImgIterator>
+vigra::triple<StridedImageIterator<PixelType>,
+ StridedImageIterator<PixelType>,
+ ImgAccessor>
+stride(int xstride, int ystride,
+ vigra::triple<BasicImageIterator<PixelType, ImgIterator>,
+ BasicImageIterator<PixelType, ImgIterator>,
+ ImgAccessor> image) {
+ Diff2D diff = image.second - image.first;
+ if (diff.x % xstride != 0) {diff.x += xstride - diff.x %
xstride;}
+ if (diff.y % ystride != 0) {diff.y += ystride - diff.y %
ystride;}
+ return vigra::make_triple(
+ StridedImageIterator<PixelType>(image.first, xstride,
ystride),
+ StridedImageIterator<PixelType>(image.first + diff, xstride,
ystride),
+ image.third);
+}
+
+
+template <typename PixelType, typename ImgAccessor, typename
ImgIterator>
+vigra::triple<ConstStridedImageIterator<PixelType>,
+ ConstStridedImageIterator<PixelType>,
+ ImgAccessor>
+stride(int xstride, int ystride,
+ vigra::triple<ConstBasicImageIterator<PixelType, ImgIterator>,
+ ConstBasicImageIterator<PixelType, ImgIterator>,
+ ImgAccessor> image) {
+ Diff2D diff = image.second - image.first;
+ if (diff.x % xstride != 0) {diff.x += xstride - diff.x %
xstride;}
+ if (diff.y % ystride != 0) {diff.y += ystride - diff.y %
ystride;}
+ return vigra::make_triple(
+ ConstStridedImageIterator<PixelType>(image.first, xstride,
ystride),
+ ConstStridedImageIterator<PixelType>(image.first + diff,
xstride, ystride),
+ image.third);
+}
+
+
+template <typename PixelType, typename ImgAccessor, typename
ImgIterator>
+std::pair<StridedImageIterator<PixelType>, ImgAccessor>
+stride(int xstride, int ystride,
+ std::pair<BasicImageIterator<PixelType, ImgIterator>,
ImgAccessor> image) {
+ return std::make_pair(
+ StridedImageIterator<PixelType>(image.first, xstride,
ystride),
+ image.second);
+};
+
+
+template <typename PixelType, typename ImgAccessor, typename
ImgIterator>
+std::pair<ConstStridedImageIterator<PixelType>, ImgAccessor>
+stride(int xstride, int ystride,
+ std::pair<ConstBasicImageIterator<PixelType, ImgIterator>,
ImgAccessor> image) {
+ return std::make_pair(
+ ConstStridedImageIterator<PixelType>(image.first, xstride,
ystride),
+ image.second);
+};
+
+
} // namespace vigra

#endif /* VIGRA_EXT_CACHEDFILEIMAGE_HXX */

Bart.van.Andel

unread,
Oct 8, 2008, 4:27:43 PM10/8/08
to hugin and other free panoramic software
I just adapted Bob's bash script into a Windows batch file, for usage
with Windows 2000 and up. Save the script at the end of this post to a
file named "smartblend-hugin.bat" and store it in the folder where
smartblend was installed.

Usage:
1. Start Hugin.
2. Open File -> preferences.
3. Switch to Enblend tab.
4. Check "Use alternative Enblend program".
5. Choose "smartblend-hugin.bat" as the executable (use the full
path).
6. Press OK to save the settings.
7. On the Stitcher tab in Hugin, click the Options button next to
the Remapper and make sure "Save cropped images" is unchecked.
8. Enjoy SmartBlend!


Script (everything below this line):

@echo off & setlocal

set SMARTBLEND=%~dp0\smartblend.exe
set SMARTBLENDARGS=

:paramstrip
set arg=%1
if not "%arg%"=="" (
if "%arg%"=="--compression" (
rem Skip compression parameter and its argument
shift
) else if "%arg:~0,2%"=="-f" (
rem Skip ...
) else if "%arg:~0,2%"=="-l" (
rem Skip ...
) else if "%arg:~0,2%"=="-o" (
rem Reformat output parameter: add "smartblend-" prefix
set SMARTBLENDARGS=%SMARTBLENDARGS% -o smartblend-%2
shift
) else (
rem Copy other parameters
set SMARTBLENDARGS=%SMARTBLENDARGS% %1
)
shift
goto :paramstrip
)

echo.
echo Executing smartblend.exe %SMARTBLENDARGS%
echo.

%SMARTBLEND% %SMARTBLENDARGS%

endlocal

Yuval Levy

unread,
Oct 9, 2008, 10:20:58 AM10/9/08
to hugi...@googlegroups.com
Bart.van.Andel wrote:
> I just adapted Bob's bash script into a Windows batch file

Thanks a lot. I've added it to SVN (rev. 3489) and will try not to
forget to add it to the next Windows installer.

<http://hugin.svn.sourceforge.net/viewvc/hugin/hugin/trunk/platforms/windows/smartblend-wrapper/>

Yuv

Bart.van.Andel

unread,
Oct 9, 2008, 11:00:17 AM10/9/08
to hugin and other free panoramic software
Great! Bob's bash script (as shown earlier in this thread) should be
added as well.

One thing in the readme is incorrect:
1. save smartblend-hugin.bat to a known path
should be
1. save smartblend-hugin.bat to the path where smartblend.exe
resides

The script uses its own path to determine the location of
smartblend.exe, so they have to be in the same path (either that, or
one has to modify the batch file manually to enter the correct path).

Concerning integration: it seems Hugin is prepared to use different
blenders from the GUI, as the Stitcher tab shows a pulldown menu. It
would be most convenient of course if the items in that menu are
configurable through the options menu, so Smartblend can show up there
as well. For instance like the following:

Name: Enblend
Type: blender
Executable: path\to\enblend\enblend.exe
Parameters: --compression=%compression -f %widthx%height+%x0+%y0 -o
enblend-%out %in

Name: Smartblend
Type: blender
Executable: path\to\smartblend\smartblend.exe
Parameters: -o smartblend-%out %in

Name: Nona
Type: remapper
Executable: path\to\nona\nona.exe
Parameters: (whatever parameters apply)

Just an idea. Of course you still want most options to be configurable
through the GUI, but that's what placeholders can be used for (like
%in or %out).


On Oct 9, 4:20 pm, Yuval Levy <goo...@levy.ch> wrote:
> Bart.van.Andel wrote:
> > I just adapted Bob's bash script into a Windows batch file
>
> Thanks a lot. I've added it to SVN (rev. 3489) and will try not to
> forget to add it to the next Windows installer.
>
> <http://hugin.svn.sourceforge.net/viewvc/hugin/hugin/trunk/platforms/w...>
>
> Yuv

Yuval Levy

unread,
Oct 9, 2008, 5:52:59 PM10/9/08
to hugi...@googlegroups.com
Bart.van.Andel wrote:
> Great! Bob's bash script (as shown earlier in this thread) should be
> added as well.

done two weeks ago when he published his script
<http://hugin.svn.sourceforge.net/viewvc/hugin/hugin/trunk/platforms/linux/>


> One thing in the readme is incorrect:

corrected, thanks.


> Concerning integration: it seems Hugin is prepared to use different
> blenders from the GUI, as the Stitcher tab shows a pulldown menu. It
> would be most convenient of course if the items in that menu are
> configurable through the options menu, so Smartblend can show up there
> as well.

we'll need some major work on the GUI later on. I am not convinced that
preferences is the right place for this choice (like it is not the right
place for the choice of control point generators).

For the information of the community, I've sent an email to Michael
Norel (author of Smartblend), inviting him to join the community and
asking for permission to distribute smartblend with hugin. A copy of my
message is below. If any of you is in contact with him, I would
appreciate if you would follow up with him too. It would be great if he
would join this community.

Yuv

--- copy of message to Michael Norel ---

Dear Michael,

I've heard from different sources on the internet that you inted to
release smartblend soon under an open source license. Is this true?

If Yes, would you be so kind and allow the hugin project to distribute
smartblend with it?

hugin is the most advanced open source panorama making software.

at the moment hugin comes with enblend and adding options is in the
interest of the users and the project.

you will find in the hugin community many people that will be happy to
help porting smartblend to other platforms (AFAIK there is no linux
version). A few have already produced wrappers to use smartblend from
hugin (with wine in Linux or directly in Windows).

I encourage you, if you have not done so yet, to join the hugin mailing
list at <http://groups.google.com/group/hugin-ptx> - you will enjoy to
see how people appreciate your software.

Thank you, and best regards
Yuval Levy

Reply all
Reply to author
Forward
0 new messages