-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetectUpperbody.cpp
More file actions
40 lines (40 loc) · 1.19 KB
/
detectUpperbody.cpp
File metadata and controls
40 lines (40 loc) · 1.19 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
//#include <string>
//#include <vector>
//
//#include <opencv2/imgproc/imgproc.hpp> // Gaussian Blur
//#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
//#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
//#include <opencv2/features2d/features2d.hpp>
//#include <opencv2/objdetect/objdetect.hpp>
//
//#include"filesystem.h"
//
//using namespace std;
//using namespace cv;
//
//int main(int argc, char* argv)
//{
// CascadeClassifier cc("haarcascade_upperbody.xml");
// string dir = "./cam";
// vector<string> imgpaths;
// FileSystem::readDirwithpath(dir, "jpg", imgpaths);
// string outdir = "./camout";
// if (!FileSystem::isExists(outdir))
// {
// FileSystem::makeDir(outdir);
// }
// for (int i = 0; i < imgpaths.size(); i++)
// {
// string imgname = imgpaths[i].substr(imgpaths[i].find_last_of("/"));
// Mat src = imread(imgpaths[i]);
// vector<Rect> rects;
// cc.detectMultiScale(src, rects, 1.1, 2, 0, Size(30, 10), Size(src.rows, src.cols));
// for (int j = 0; j < rects.size(); j++)
// {
// rectangle(src, rects[j], Scalar(250, 60, 60), src.rows / 500 + 1, 8);
// }
// string outpath = outdir + imgname;
// imwrite(outpath,src);
// }
// return 0;
//}