[ptx] Re: Enblend suggestion: focus score weighting

Pablo d'Angelo pablo.dangelo at web.de
Fri Jun 18 08:30:32 BST 2004


Hi Andrew,

> Enblend looks at data in files one scanline at a time, in sequential
> order. For all of the pyramid functions I work from memory. Then I dump
> them back to disk to keep the max memory cross-section down. This was a
> very intuitive place to make the split between disk/memory and it seems to
> be ok. Maybe others can relate their memory usage requirements for enblend
> projects. Is anyone still having out-of-memory problems? What's the
> biggest project you've done?

Hmm, will work for most images, but for really extreme cases, like the 800
MPixel image done by Martin Kulhavý, it's probably not sufficient. He had to
split the pano in several columns.

http://www.tawbaware.com/cgi-bin/forum/cutecast.pl?forum=2&thread=785

> > Where would boost::variant come into play?
> 
> Since I keep dumping data to disk and loading it back again in random
> places, I was looking for a way to modularize between loading images and
> doing image processing.

My approach is currently:

template <class ImgType, class PanoImgType>
void stitch(Panorama & pano, output filename)

Then I have one big switch, which calls the respective
algorithm, which will call its functions with the right type.

> I want to avoid this:
> 
> if binary {
> 	make bimage
> 	get bimage iterators/accessors
> 	call image processing routine 1
> 	dump to disk
> 	reload
>         call image processing routine 2
> 	...
> } else if float {
> 	make fimage
> 	get fimage iterators/accessors
> 	call image processing routine 1
> 	dump to disk
>         reload
>         call image processing routine 2
>         ...
> }        
> ...
> 
> Because that copies the blending loop code N times.
> With a variant I could do:
> 
> for each input image {
> 	variant = load image
> 	visit variant
> }

Yes, that looks nicer! If it works well, its probably the way to go.
However, one must take care that no unnecessary copying of the image
into the variant occurs.

> Of course, I'm getting a crash course in vigra and templates here, so I 
> could be totally off the mark.

No sounds plausible.

ciao
  Pablo


More information about the ptX mailing list