3 #define DEMO_IMAGE "../../../../bmp/frame0206.bmp"
17 #include <Interfaces/MainWindowInterface.h>
18 #include <Interfaces/MainWindowEventInterface.h>
19 #include <VideoCapture/BitmapCapture.h>
20 #include <Helpers/helpers.h>
22 #include <Image/ByteImage.h>
23 #include <Image/FloatImage.h>
24 #include <Image/IntImage.h>
25 #include <Image/ShortImage.h>
26 #include <Image/ImageProcessor.h>
27 #include <Image/PrimitivesDrawer.h>
28 #include <Math/Vecd.h>
29 #include <Classification/NearestNeighbor.h>
33 #include <opencv2/core/core.hpp>
34 #include <opencv2/highgui/highgui.hpp>
35 #include <opencv2/imgproc/imgproc.hpp>
52 HoG(
int numOfBing = 16,
int sampleTime = 500,
int numOfHistory = 2,
int minRandomWindow = 20,
int randomWindowScaleFloor = 1,
int randomWindowScaleCeil = 2);
60 bool hogDescriptor(CByteImage* origin, CFloatImage* outImage, CFloatImage* amplitude);
61 void calculateHist(
int range,
int bin, CFloatImage* inputImg, std::vector<float>* output, CFloatImage* amplitude);
62 void histogramNorm(std::vector<float>*
input, std::vector<float>* normOutput);
63 float distanceBetweenPoints(std::vector<float> firstPoint, std::vector<float> secondPoint,
int metrics);
65 void findThreeNearstNeighbors(std::vector<float> testWindow, std::vector<std::vector<float> > trainingHistTable,
int lable, std::pair <std::vector<float>*,
int>* nearstNeighbor, std::pair <std::vector<float>*,
int>* secondNeighbor, std::pair <std::vector<float>*,
int>* thirdNeighbor,
float* nearstDistance,
float* secondDistance,
float* thirdDistance);
66 bool knn(std::vector<std::vector<float> > trainingHistTable, std::vector<std::vector<float> > trainingHistTableNegative, std::vector<float> testWindow);
67 void preprocess(
const CByteImage* origin, CByteImage* outImage);
68 void histogramRotationInvariant(std::vector<float>* inputHist, std::vector<float>* outputHist);
71 void doLoadTrainingData(std::string path, std::vector<std::vector<float> >& histTable,
int scaling);
73 std::vector<std::vector<float> > trainingHistTable;
74 std::vector<std::vector<float> > trainingHistTableNegative;
75 std::vector<std::vector<float> > samplHistTable;
79 int minimumRandomWindow;
80 int randomWindowScaleRateFloor;
81 int randomWindowScaleRateCeil;
86 bool useHoughDetector;