-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathimage_preprocessor.h
41 lines (29 loc) · 1.06 KB
/
image_preprocessor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef IMAGEPREPROCESSOR_H
#define IMAGEPREPROCESSOR_H
#include <vector>
#include <base_detector.h>
namespace htwk {
class ImagePreprocessor : BaseDetector
{
public:
ImagePreprocessor();
ImagePreprocessor(int8_t* lutCb, int8_t* lutCr, HtwkVisionConfig &config, int scaledWidth, int scaledHeight);
ImagePreprocessor(const ImagePreprocessor&) = delete;
ImagePreprocessor(const ImagePreprocessor&&) = delete;
ImagePreprocessor& operator=(const ImagePreprocessor&) = delete;
ImagePreprocessor& operator=(ImagePreprocessor&&) = delete;
~ImagePreprocessor() = default;
void proceed(uint8_t* img);
const std::vector<float>& getScaledImage() { return scaledImage; }
void drawScaledImage(uint8_t *yuvImage);
// Helper function for the machine learning tools
void createInputDataRaw(const uint8_t *img, std::vector<float> &dest);
private:
const int scaledWidth;
const int scaledHeight;
std::vector<float> scaledImage;
void scaleImage(uint8_t *img);
void scaleImage4(uint8_t *img);
};
}
#endif // IMAGEPREPROCESSOR_H