반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- CES 2O21 참가
- 대이터
- CES 2O21 참여
- cudnn
- 웹 용어
- KNeighborsClassifier
- 자료구조
- web 사진
- java역사
- 결합전문기관
- tensorflow
- Keras
- web 개발
- broscoding
- classification
- html
- paragraph
- bccard
- 재귀함수
- web
- postorder
- 머신러닝
- C언어
- mglearn
- pycharm
- discrete_scatter
- web 용어
- vscode
- 데이터전문기관
- inorder
Archives
- Today
- Total
bro's coding
detect workers in C++ 본문
반응형
#include"opencv2/opencv.hpp"
#include<iostream>
#include<String.h>
using namespace cv;
using namespace std;
int main() {
VideoCapture cap("C:/opencv/opencv-4.0.0/samples/data/vtest.avi");
if (!cap.isOpened()) {
cerr << "Video open failed!" << endl;
return -1;
}
HOGDescriptor hog;
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());
Mat frame;
while (true) {
cap >> frame;
if (frame.empty()) {
break;
}
vector<Rect> detected;
hog.detectMultiScale(frame, detected);
String text = format("count : %d", detected.size());
putText(frame, text, Point(20, 50), FONT_HERSHEY_SIMPLEX, 1, Scalar(0, 0, 255));
for (Rect r : detected) {
Scalar c = Scalar(rand() % 256, rand() % 256, rand() % 256);
rectangle(frame, r, c, 3);
}
imshow("frame", frame);
if (waitKey(10) == 27)
break;
}
return 0;
}
반응형
'[AI] > openCV' 카테고리의 다른 글
손가락 인식 키보드 in python (0) | 2020.06.30 |
---|---|
명함 인식 in python (0) | 2020.06.25 |
이미지 변형 in python (1) | 2020.06.24 |
opencv install in python (0) | 2020.06.23 |
QRcode read in C++ (0) | 2020.06.23 |
adaptiveThreshold (0) | 2020.06.23 |
binarization (0) | 2020.06.23 |
Canny_edge (0) | 2020.06.23 |
Comments