21 #ifndef _INTEGRAL_IMAGE_PREPROCS_H
22 #define _INTEGRAL_IMAGE_PREPROCS_H
29 #include "IntegralImage.h"
74 unsigned int DataSize(
unsigned int width,
unsigned int height)
const
76 return sizeof(uint32_t) * (width + 1) * (height + 1);
82 memcpy(buf, src.data, n);
88 dst.data =
new uint32_t[n/4];
89 memcpy(dst.data, buf, n);
95 params.stride = width+1;
97 params.height = height;
102 static bool Process(std::pair<IntegralImageData, IntegralImageParams> & out,
const T *image,
unsigned int width,
unsigned int height,
long stride)
105 integral_image.
Build(image, width, height, stride,
true);
107 out.first.data = integral_image.
data;
109 out.second.width = width;
110 out.second.height = height;
111 out.second.stride = integral_image.
width;
118 out.first.data = src.
data;
120 out.second.width = src.
width-1;
121 out.second.height = src.height-1;
122 out.second.stride = src.
width;
T * data
Definition: IntegralImage.h:48
IntegralImageData DataType
Data provided by this Preprocessor.
Definition: IntegralImagePreprocessors.h:40
unsigned int DataSize(unsigned int width, unsigned int height) const
compute memory required to serialize/deserialize the preprocessed image
Definition: IntegralImagePreprocessors.h:74
Definition: IntegralImagePreprocessors.h:36
a descritor based on a integral image
void GetConf(char *strconf) const
return null string configuration
Definition: IntegralImagePreprocessors.h:57
static bool Process(std::pair< IntegralImageData, IntegralImageParams > &out, const IntegralImageHandle< uint32_t > &src)
the operator used to convert an integral image to the data
Definition: IntegralImagePreprocessors.h:116
static bool Process(std::pair< IntegralImageData, IntegralImageParams > &out, const T *image, unsigned int width, unsigned int height, long stride)
the operator used to convert an image to an integral image
Definition: IntegralImagePreprocessors.h:102
unsigned int width
probably an offset is better than stride
Definition: IntegralImageData.h:33
void DeSerialize(IntegralImageData &dst, const unsigned char *buf, int n) const
to store on disk or use with MPI
Definition: IntegralImagePreprocessors.h:86
unsigned int width
Definition: IntegralImage.h:50
void Configure(char *strconf) const
in haar preprocessor nothing to do
Definition: IntegralImagePreprocessors.h:64
static void GetParam(IntegralImageParams ¶ms, unsigned int width, unsigned int height)
compute the params required to addess a image of width x height pixels
Definition: IntegralImagePreprocessors.h:93
il dato IntegralImage e' pressoche' equivalente a quello di RawData < uint32_t >
Definition: IntegralImageData.h:52
void Build(const _S *src, unsigned int width, unsigned int height, long stride, bool extend=false)
Build integral image from buffer.
Definition: IntegralImage.h:202
void Serialize(unsigned char *buf, const IntegralImageData &src, int n) const
to store on disk or use with MPI
Definition: IntegralImagePreprocessors.h:80
std::pair< DataType, ParamType > ReturnType
Data provided by this preprocessor.
Definition: IntegralImagePreprocessors.h:46
parameters required to access to integral image and to create features
Definition: IntegralImageData.h:31
IntegralImageParams ParamType
parameters used to store data and use with feature extractor
Definition: IntegralImagePreprocessors.h:43