-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcv_objDetect.h
More file actions
88 lines (62 loc) · 2.59 KB
/
cv_objDetect.h
File metadata and controls
88 lines (62 loc) · 2.59 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include <cmath>
#include <vector>
#include <numeric>
#include <random>
#include <functional>
#include <ctime>
#include <algorithm>
#include <chrono>
#include <fstream>
#include <cassert>
#include <map>
#include <set>
#include <iostream>
#include <sstream>
#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "dataManipulate.h"
#define __cv_objDetect
#ifndef __cvlib
#define __cvlib
#include "cvlib.h"
#endif
using namespace std;
using namespace cv;
namespace cv_lib
{
//尺度變換
void CreateScaleSpace(Mat srcImage, vector<vector<Mat>>& ScaleSpace, vector<vector<Mat>>& DoG);
//特徵檢測
Mat cacORBFeatureAndCompare(Mat srcImage1, Mat srcImage2); //ORB特徵匹配
vector<Mat> calculateIntegralHOG(Mat& srcMat, int THETA); //HOG積分圖
void calculateHOGinCell(Mat& HOGCellMat, Rect roi, vector<Mat>& integrals); //區域積分直方圖
Mat getHOG(Point pt, vector<Mat>& integrals, Size cellsize, int blocksize, int THETA);
vector<Mat> cacHOGFeature(Mat srcImage, Size cellsize = Size(0, 0), int THETA = 20);
double HaarExtract(Mat srcImage, int type, Rect roi);
double calIntegral(Mat srcIntegral, int x, int y, int width, int height);
Mat OLBP(Mat& srcImage);
//人臉辨識
Mat dectect_Skin_Color(Mat& srcImage);
void detectFaces(Mat frame, CascadeClassifier face_cascade, CascadeClassifier eye_cascade);
int detectEye(Mat& srcImage, vector<Rect>& eyeRect, CascadeClassifier face_cascade, CascadeClassifier eye_cascade);
void trackEye(Mat& srcImage, Mat& target, Rect& eyeRect);
//車牌辨識
Mat detect_License_Plate(Mat& srcImage);
vector<Mat> extract_License_Plate(Mat& srcImage);
vector<Mat> extract_License_Plate_by_MorphologyEx(Mat& srcImg);
vector<Rect> mserGetPlate(Mat srcImage); //Debug模式lib有bug 請使用Release Mode
Mat char_feature(Mat srcImage);
//特徵點鑑別
Mat getRansacMat(const vector<DMatch>& matches, vector<KeyPoint>& keypoints1, vector<KeyPoint>& keypoints2, vector<DMatch>& outMatches, bool refineF = true);
//影像穩定
void videoOutput(Ptr<videostab::IFrameSource> stabFrames, string outputPath, double outputFps = 20);
void cacStabVideo(Ptr<videostab::IFrameSource> stabFrames, string inputPath, string outputPath);
//背景建模
void detectBackGround(Ptr<BackgroundSubtractorKNN> pBackgroundKnn, string videoFileName);
//運動目標檢測
vector<Rect> get_foreground_objects(Mat scene, Ptr<BackgroundSubtractorKNN> pBackgrounndKnn, double scale, bool isFlag);
}