Matthew E. Weippert wrote:
> A few developers here at SAIC Tucson have been looking at Blitz++ as a
> potential building block for our image processing applications. I
> have some simple questions. (My apologies if any are clearly
> explained in the documentation. I have read through it quickly
> twice.)
>
> I want to be able to view an image as a single dim array of points and
> simultaneously (i.e. aliased) as a two dimensional array (like
> normal). I am almost sure this can be done with valarray.
Yes, this can be done with blitz.
> When considering color and multi-spectral images, should we think
> about a 3 dimensional array, or rather an array of tinyVectors? Are
> there efficiency considerations in each case?
I implemented in C++ image processing library a while back (in '94).
One problem with
class RGB24 {
unsigned char r, g, b;
};
Array<RGB24> x;
is that on some architectures RGB24 will be padded up to 4 or 8 bytes,
resulting in a lot of wasted space. There are tricky ways to avoid
this if you really want to do it this way.
The alternative is:
enum { red=0, green=1, blue=2 };
Array<uchar,3> x;
x(i,j,red) = ...
This can be a pain too. The solution I ended up using was to
Array<uchar,3> and stick in some extra methods which allow the
image to be viewed as a 2-dimensional array of tuples.
> General windows and slices are important in many image processing
> applications. Do you have experience implementing those kinds of apps
> using Blitz++? Do you think those features are currently well
> supported?
You'll have to describe what you mean by "general windows and slices".
Blitz++ arrays support subarrays, which might be what you mean.
Cheers,
Todd
This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 04:30:04 EST