|
[DPRG] EmbedCV
Subject: [DPRG] EmbedCV
From: Dave Hylands
dhylands at gmail.com
Date: Tue Oct 17 19:35:40 CDT 2006
Hi Chris,
> > I'm also in favor of fixed-point math, or as Clem points out, a
> > mixture where fxed point is used in the performance sensitive stuff.
>
> This is one of those areas where C++ templates are so nice.
>
> template <typename PIXEL, size_t WIDTH, size_t HEIGHT>
> class Image
> {
>
> std::vector< PIXEL > _pixels;
> ...etc...
>
> So you can write
>
> Image< uint16_t, 320, 240 > anImg;
>
> or
>
> Image< float, 320, 240 > anotherImg;
My experience is that for embedded stuff people are often willing to
make a compromise and stick to one particular representation.
So, as long as you use an appropriate type (lets call it Pixel_t or
Number_t) then you could still make a choice about the type of number
to be used, but you'd have to use the same type for all of the
images/algorithims.
And of course, there are the inevitable games that can be played with
the preprocessor... Not for the faint of heart, but still useful
enough to get some performance out where it counts.
--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/
More information about the DPRG mailing list
|