Boost logo

Boost :

From: Ullrich Koethe (u.koethe_at_[hidden])
Date: 2001-11-15 13:13:41


Peter Dimov wrote:
> > Yes, an RLE image class makes much sense to me. Among other benefits, it
> > allows for extremely fast morphological filters (erosion, dilation etc.)
> > because they can operate directly on the RLE images, without
> > decompression. (AFAIK, such optimized filters are part of the HALCON
> > image analysis system.)
>
> This is one of the rare cases where I'd recommend a policy-based design. The
> type of an 'image element' is orthogonal to the storage policy.
>

In principle, I agree, and VIGRA is designed this way. But in case of
packed bits and RLE images, I think 'image elements' and storage policy
are NOT orthogonal. You loose most of the benefits of the specific
storage format if you force orthogonality here.

> In addition (sorry if I'm misreading something since I've only glanced at
> VIGRA)

You glanced correctly :-)

> I've found it useful to separate the number of channels from the
> element type. That is, in my image library, I don't use
>
> image<rgb>
>
> but
>
> image<unsigned char, 3>
>

Both formats have their merits (only the first form allows for the
implementation of a STL-like RGBImage iterator). In fact, in the Python
version of VIGRA, I'm also using a band oriented format.

This very problem was a major motivation for the introduction of
'accessors'. By using accessors (in particular RGBAccessor, RedAccessor,
GreenAccessor, BlueAccessor, and VectorBandAccessor), the difference
becomes completely transparent for algorithms. This has worked very well
also in the case of complex numbers - from the algorithms' point of
view, it's not important whether a complex image is
image<std::complex<double> > or image<double, 2>.
 
BTW, what's your image library doing? Is it also public?

Regards
Ulli

-- 
 ________________________________________________________________
|                                                                |
| Ullrich Koethe  Universität Hamburg / University of Hamburg    |
|                 FB Informatik / Dept. of Computer Science      |
|                 AB Kognitive Systeme / Cognitive Systems Group |
|                                                                |
| Phone: +49 (0)40 42883-2573                Vogt-Koelln-Str. 30 |
| Fax:   +49 (0)40 42883-2572                D - 22527 Hamburg   |
| Email: u.koethe_at_[hidden]               Germany             |
|        koethe_at_[hidden]                        |
| WWW:   http://kogs-www.informatik.uni-hamburg.de/~koethe/      |
|________________________________________________________________|

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk